Ask Your Question
0

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

asked 2016-11-22 13:43:50 -0600

mfu gravatar image

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-11-22 16:15:33 -0600

matman gravatar image

The value in waitKey is the waiting time in milliseconds.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-22 13:43:50 -0600

Seen: 3,057 times

Last updated: Nov 22 '16