1 | initial version |
you do not have to "kill imshow()". all you have to do is "catch" the event you're looking for, and make it break the loop.
a typical program looks like this:
while True:
img = cv2.imread("some_random.png")
# some processing
if my_event_happened: # insert your event here!
break
cv2 imshow("I", img)
cv2.waitKey(20)
note, that you still need the waitKey() call for showing the image !
2 | No.2 Revision |
you do not have to "kill imshow()". all you have to do is "catch" the event you're looking for, and make it break the loop.
a typical program looks like this:
while True:
img = cv2.imread("some_random.png")
# some processing
if my_event_happened: # insert your event here!
break
cv2 imshow("I", img)
cv2.waitKey(20)
note, that you still need the waitKey() call for showing the image !