cv2.VideoCapture.open() always returns FALSE

后端 未结 8 2158
没有蜡笔的小新
没有蜡笔的小新 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:41

    I found something in documentation which might just help.

    cap.read() returns a bool (True/False). If frame is read correctly, it will be True. Sometimes, cap may not have initialized the capture. In that case, the code shows error. You can check whether it is initialized or not by the method cap.isOpened(). If it is True, OK. Otherwise open it using cap.open().

    Source: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video

提交回复
热议问题