Why does the cv2.imshow() does not render without cv2.waitkey()?

Viewed 8913

Without the cv2.waitkey() method the cv2.imshow() displays black window. Why does the rendering does not happen properly without the wait?

cap = cv2.VideoCapture(video_path)
while cap.isOpened():
    ret,frame = cap.read()
    cv2.imshow('window-name',frame)
    # without the following cv2.waitkey(1) statement the cv2.imshow() displays a blank window
    if cv2.waitKey(1) & 0xFF == ord('q'): # wait for 1 millisecond
        break
    continue
1 Answers
Related