I am trying to access a Logitech c310 webcam on my beaglebone. It always returns false for any device ID, I am not sure why.
I use the following code.
HIGHGUI ERROR: V4L: index 1 is not correct!
False
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /home/kaushik/Desktop/OpenCV-2.4.1/modules/core/src/array.cpp, line 2482
Traceback (most recent call last):
File "x2.py", line 8, in
cv2.imshow('frame', frame)
cv2.error: /home/kaushik/Desktop/OpenCV-2.4.1/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat
if you are getting this kind of an error then probably something is wrong with the indexing.
instead of cv2.VideoCapture(0) add:
cv2.VideoCapture(-1)
this will get you the first working camera. And if anything goes wrong, just post the stack trace here and i'll see if i can help you :)