I am having trouble accessing my USB camera using OpenCV with python.
I get the following error message which I understand means no frame was captured?
error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\highgui\src\window.cpp:356: error: (-215) size.width>0 && size.height>0 in function cv::imshow
My camera is the following: https://www.gophotonics.com/products/scientific-industrial-cameras/point-grey-research-inc/45-571-cm3-u3-50s5m-cs
Simple code as below. Any thoughts? Some help I'll appreciate
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()