Ask Your Question

Revision history [back]

In order to display windows, you need to add a delay. This is achieved by adding cv2.waitKey() right after your imshow. This will leave the window open until a key press is detected. Right after this, you'd want to destroy the window(s) using cv2.destroyAllWindows()

Next time, please use the official OpenCV Python tutorials. This issue is addressed right from the first code sample.