Commit 6489d8a9 authored by Simon Hänisch's avatar Simon Hänisch Committed by GitHub

update watershed.py: check if windows are still open

change the `while` loop to check if the two windows created by this example still exist, stop the program otherwise
parent 0e436c3f
......@@ -55,7 +55,7 @@ class App:
cv2.imshow('watershed', vis)
def run(self):
while True:
while cv2.getWindowProperty('img', 0) != -1 or cv2.getWindowProperty('watershed', 0) != -1:
ch = 0xFF & cv2.waitKey(50)
if ch == 27:
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment