I've seen from the sample how to display an image from the webcam, but how do I get the image captured as an array?
import cv
capture = cv.CaptureFromCAM(0)
img = cv.QueryFrame(capture)
img.tostring() gives me weird caracters. Thanks in adv.
I've seen from the sample how to display an image from the webcam, but how do I get the image captured as an array?
import cv
capture = cv.CaptureFromCAM(0)
img = cv.QueryFrame(capture)
img.tostring() gives me weird caracters. Thanks in adv.
According to the docs, QueryFrame returns an IplImage. IplImage can be treated as an arbitrary array. It looks like you'll want to use the "Get" set of functions to access array elements.
I believe your problem might be the way you are printing/displaying the contents of the array.
Nevertheless, this blog post shows how to capture frames from a webcam on linux using python.