cv2.VideoCapture.open() always returns FALSE

后端 未结 8 2135
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 17:52

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.



        
8条回答
  •  旧巷少年郎
    2020-12-09 18:30

    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 :)

提交回复
热议问题