Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import cv2
  2.  
  3. cap = cv2.VideoCapture(0)
  4.  
  5.  
  6. while True:
  7. ret, frame = cap.read()
  8. cv2.imshow('Live Video', frame)
  9. if cv2.waitKey(1) & 0xFF == ord('q'):
  10. break
  11.  
  12. cap.release()
  13. cv2.destroyAllWindows()
  14.  
  15. Traceback (most recent call last):
  16.  
  17. File "C:/Users/Admin/PycharmProjects/industrialcamera/ICvideocapture.py", line 11, in <module>
  18.  
  19. cv2.imshow('Live Video', frame)
  20.  
  21. cv2.error: OpenCV(4.1.0) C:projectsopencv-pythonopencvmoduleshighguisrcwindow.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement