From: Simon Hänisch Date: Mon, 27 Jun 2016 15:03:37 +0000 (+0200) Subject: update watershed.py: check if windows are still open X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1830^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6489d8a96fbadfca0070762829bf8374457e809d;p=platform%2Fupstream%2Fopencv.git 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 --- diff --git a/samples/python/watershed.py b/samples/python/watershed.py index 6d349e1..134e499 100755 --- a/samples/python/watershed.py +++ b/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