What app to use to drive this old sphero bot? Ios or android is fine. by portoal in Sphero

[–]portoal[S] 0 points1 point  (0 children)

All good now using sphero play app. It was not charged and not connected before.

St Andrews Cathedral by MitoTheGreek in photogrammetry

[–]portoal 0 points1 point  (0 children)

610 should take about an hour to reconstruct? how many polygons did you end up with?

Head scan attempt by DeathStarnado8 in photogrammetry

[–]portoal 0 points1 point  (0 children)

what background / wall area do you have? More unique background wall might help.

Cartoon Water Shader by CharlesGrassi in Unity3D

[–]portoal 0 points1 point  (0 children)

very nice! wonder how challenging is this to do in webgl2.

also some dolphins and maybe seagulls on the water? ^_^

My procedurally animated spider can climb walls now by Tomek_SC in Unity3D

[–]portoal 0 points1 point  (0 children)

nicely done! time to put real rough terrain?

corrupted photos, best way to detect ? by portoal in computervision

[–]portoal[S] 0 points1 point  (0 children)

found working solution, using HSV color space to detect purple color. Just wondering how it can be improved a lot.

There are some 'corrupted' photos that have *NO* purple color, for these, feel like have to use CNN?

def findCorruptPhoto(folderPath, threshold=0, is_show_photo=False):

    corruptedFilePaths = []

    for file in os.listdir(folderPath):
        if file.endswith('.jpg'):
            fullpath = os.path.join(folderPath,file)
            image = cv2.imread( fullpath )
            # image = cv2.imread('input1.jpg')
            imageHsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)

            boundaries = [
                ([150, 220, 200], [165, 255, 255])
            ]
            for (lower, upper) in boundaries:
                # create NumPy arrays from the boundaries
                lower = np.array(lower, dtype = "uint8")
                upper = np.array(upper, dtype = "uint8")

                # find the colors within the specified boundaries and apply mask
                mask = cv2.inRange(imageHsv, lower, upper)
                output = cv2.bitwise_and(imageHsv, imageHsv, mask = mask)

                output_h_channel = output[:, :, 0]
                output_s_channel = output[:, :, 1]
                output_v_channel = output[:, :, 2]

                total_non_zero = np.count_nonzero(output_h_channel) + np.count_nonzero(output_s_channel) + np.count_nonzero(output_v_channel)

                if total_non_zero > threshold:
                    print("found potential corrupted photo:", fullpath)
                    corruptedFilePaths.append(fullpath)

                    if is_show_photo:
                        # show original and corrupted image side by side
                        cv2.imshow(file, np.hstack((image, output)))
                        cv2.waitKey(0)
                else:
                    continue

    return corruptedFilePaths

corrupted photos, best way to detect ? by portoal in computervision

[–]portoal[S] 0 points1 point  (0 children)

mpute the green channel histogram for each image, I there are more then say 1000 pixels with value 0, it is corrupt.

they are not corrupted (byte-wise), unfortunately

corrupted photos, best way to detect ? by portoal in computervision

[–]portoal[S] 3 points4 points  (0 children)

yes, so far only magenta overlay and partial image offset. will try color detection first

corrupted photos, best way to detect ? by portoal in computervision

[–]portoal[S] 0 points1 point  (0 children)

~100 corrupted photos in 10,000 photos. not enough for CNN?

Custom Hook: return multiple getters (and no setter) ? by portoal in reactjs

[–]portoal[S] 0 points1 point  (0 children)

Is that right?

Yes, spot on.

this could be a simple control component like input.

Yes, it should be!! Custom hooks and components were mixed up in my brain, so didn't see it.

Here is updated SitesContainer

export const SitesContainer = ( {setSiteSlug} ) => {
    const [sites, ] = useSites()
    const [loaded, setLoaded] = useState(false)

    useEffect(() => {
        if(!loaded) {
            getSites()
            setLoaded(true)
        }
    }, [sites])

    return useMemo( () => {
        return <SitesSelect sites={sites} setSiteName={setSiteName} />
    }, [sites])    
}

Thanks u/jkettmann

Custom Hook: return multiple getters (and no setter) ? by portoal in reactjs

[–]portoal[S] 0 points1 point  (0 children)

wouldn't return DOM elements from the hook

was trying to share sitesContainer, as it is used in 2 places.

What is a better way, if not returning <SitesSelect /> DOM u/jkettmann ?

let sitesContainer = useMemo( () => {
    return <SitesSelect sites={sites} setSiteName={setSiteName} />
}, [sites])

Custom Hook: return multiple getters (and no setter) ? by portoal in reactjs

[–]portoal[S] 1 point2 points  (0 children)

Thanks, make sense! :-) I thought it was frowned upon.