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
This commit is contained in:
parent
0e436c3fe9
commit
6489d8a96f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user