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
pull/6733/head
Simon Hänisch 9 years ago committed by GitHub
parent 0e436c3fe9
commit 6489d8a96f
  1. 2
      samples/python/watershed.py

@ -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…
Cancel
Save