From a4de511eb715d7afddfd3be50400ad86b7ba3e06 Mon Sep 17 00:00:00 2001 From: Gary Bradski Date: Sun, 18 Mar 2012 23:21:54 +0000 Subject: [PATCH] Added cv.DestroyAllWindows() to file close --- samples/python/camera.py | 1 + samples/python/camshift.py | 1 + samples/python/chessboard.py | 1 + samples/python/contours.py | 1 + samples/python/convexhull.py | 1 + samples/python/cv20squares.py | 1 + samples/python/demhist.py | 1 + samples/python/dft.py | 1 + samples/python/distrans.py | 1 + samples/python/dmtx.py | 5 +++++ samples/python/drawing.py | 1 + 11 files changed, 15 insertions(+) diff --git a/samples/python/camera.py b/samples/python/camera.py index 9a57ac5215..747bb4575c 100644 --- a/samples/python/camera.py +++ b/samples/python/camera.py @@ -10,3 +10,4 @@ while True: cv.ShowImage("camera", img) if cv.WaitKey(10) == 27: break +cv.DestroyAllWindows() diff --git a/samples/python/camshift.py b/samples/python/camshift.py index 2f28977267..446b4672a8 100644 --- a/samples/python/camshift.py +++ b/samples/python/camshift.py @@ -113,3 +113,4 @@ class CamShiftDemo: if __name__=="__main__": demo = CamShiftDemo() demo.run() + cv.DestroyAllWindows() diff --git a/samples/python/chessboard.py b/samples/python/chessboard.py index 86ac05a97c..c204d6fabe 100755 --- a/samples/python/chessboard.py +++ b/samples/python/chessboard.py @@ -31,3 +31,4 @@ if __name__ == "__main__": cv.ShowImage("win", im3); cv.WaitKey() + cv.DestroyAllWindows() diff --git a/samples/python/contours.py b/samples/python/contours.py index 4388b8eced..05078be95a 100755 --- a/samples/python/contours.py +++ b/samples/python/contours.py @@ -133,3 +133,4 @@ if __name__ == '__main__': # wait a key pressed to end cv.WaitKey (0) + cv.DestroyAllWindows() diff --git a/samples/python/convexhull.py b/samples/python/convexhull.py index 8795d0bd92..ea7ccb0e06 100755 --- a/samples/python/convexhull.py +++ b/samples/python/convexhull.py @@ -62,3 +62,4 @@ if __name__ == '__main__': if k == 27: # user has press the ESC key, so exit break + cv.DestroyAllWindows() diff --git a/samples/python/cv20squares.py b/samples/python/cv20squares.py index 7bb0c7a9ee..4cdcd67d76 100644 --- a/samples/python/cv20squares.py +++ b/samples/python/cv20squares.py @@ -164,3 +164,4 @@ def main(): if __name__ == "__main__": main() + cv.DestroyAllWindows() diff --git a/samples/python/demhist.py b/samples/python/demhist.py index a037940f24..d2645e82d5 100755 --- a/samples/python/demhist.py +++ b/samples/python/demhist.py @@ -77,3 +77,4 @@ if __name__ == "__main__": dh = DemHist(src_image) cv.WaitKey(0) + cv.DestroyAllWindows() diff --git a/samples/python/dft.py b/samples/python/dft.py index 1ef0a2908d..5a5e8dbebb 100755 --- a/samples/python/dft.py +++ b/samples/python/dft.py @@ -111,3 +111,4 @@ if __name__ == "__main__": cv.ShowImage("magnitude", image_Re) cv.WaitKey(0) + cv.DestroyAllWindows() diff --git a/samples/python/distrans.py b/samples/python/distrans.py index 3bd7121933..9a23274500 100755 --- a/samples/python/distrans.py +++ b/samples/python/distrans.py @@ -69,3 +69,4 @@ if __name__ == "__main__": # Wait for a key stroke; the same function arranges events processing cv.WaitKey(0) + cv.DestroyAllWindows() diff --git a/samples/python/dmtx.py b/samples/python/dmtx.py index 847f8507ec..6b3a6bd180 100644 --- a/samples/python/dmtx.py +++ b/samples/python/dmtx.py @@ -5,6 +5,10 @@ import numpy import sys import math +''' +Find 2 D barcode based on up to 3 channel datamatrix +''' + def absnorm8(im, im8): """ im may be any single-channel image type. Return an 8-bit version, absolute value, normalized so that max is 255 """ (minVal, maxVal, _, _) = cv.MinMaxLoc(im) @@ -166,6 +170,7 @@ for (sym, coords) in df.find(bg).items(): cv.ShowImage("results", scribble) cv.WaitKey() +cv.DestroyAllWindows() sys.exit(0) diff --git a/samples/python/drawing.py b/samples/python/drawing.py index 584e599605..956dcdbeef 100755 --- a/samples/python/drawing.py +++ b/samples/python/drawing.py @@ -159,3 +159,4 @@ if __name__ == '__main__': # wait some key to end cv.WaitKey(0) + cv.DestroyAllWindows()