Webcam Camera Example


#1

Hello,

I’m unable to get a proper image out from the Camera in the nengo extras package.
Images appear to end up as a color gradient no matter which camera I end up using. I’m following the examples from the “Classifying Webcam Images” but have had no luck.

I am able to generate an image outside of nengo using OpenCV and gstreamer but not with using the Camera capability in nengo extras. Am I missing something to get a proper picture out from the Camera as a node?


#2

If OpenCV is working for you, it should be fairly quick to wrap that in a Node you write yourself. Assuming your setup is something like this https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html, then your Node would look like

cap = cv2.VideoCapture(0)
def camera_func(t):
    _, frame = cap.read()
    return np.ravel(frame)
node = nengo.Node(camera_func)