projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e436c3
)
update watershed.py: check if windows are still open
author
Simon Hänisch
<simonhaenisch@users.noreply.github.com>
Mon, 27 Jun 2016 15:03:37 +0000
(17:03 +0200)
committer
GitHub
<noreply@github.com>
Mon, 27 Jun 2016 15:03:37 +0000
(17:03 +0200)
change the `while` loop to check if the two windows created by this example still exist, stop the program otherwise
samples/python/watershed.py
patch
|
blob
|
history
diff --git
a/samples/python/watershed.py
b/samples/python/watershed.py
index
6d349e1
..
134e499
100755
(executable)
--- 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