Ask Your Question

Revision history [back]

Is there a way to have an image close after a set time?

I'm writing a method and currently I have

cv2.imread(file) cv2.waitKey(0) cv2.destroyAllWindows

This will display the image and close the image after a key is pressed (as expected) but I want to be able to close the image without user input after a set time. I tried removing the cv2.waitKey() but then the image doesn't show.

How would I go about doing this?

Thanks in advance