OpenCV - Assertion failed on imshow function call

34 views
Skip to first unread message

t...@growthtech.com.br

unread,
Oct 3, 2018, 5:43:51 PM10/3/18
to Django users
When running:
import cv2

cap = cv2.VideoCapture(0)

while (True):

  ret,frame = cap.read()
  cv2.imshow('Webcam', frame) 

  if cv2.waitKey(1) & 0xFF == ord('q'):
      break

I'm experiencing the following error:
cv2.error: OpenCV(3.4.3) /io/opencv/modules/highgui/src/window.cpp:356: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
How to solve this ?

Jason

unread,
Oct 3, 2018, 7:19:35 PM10/3/18
to Django users
what does this have to do with django?
Reply all
Reply to author
Forward
0 new messages