Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it means, your image is empty, it never read something from your webcam.

video_capture = cv2.VideoCapture(0)
# please CHECK, if it worked !
if not video_capture.isOpened(): raise Exception("camera could not be opened !")

while True:
    ret, frame = video_capture.read()
    # CHECK again !
    if not ret: 
         print("no image !")
         break

it means, your image is empty, it never read something from your webcam.

video_capture = cv2.VideoCapture(0)
# please CHECK, if it worked !
if not video_capture.isOpened(): raise Exception("camera could not be opened !")

while True:
    ret, frame = video_capture.read()
    # CHECK again !
    if not ret:  # if this was a video *file, it means, that the movie's over.
         print("no image !")
         break