aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/contexts/OpenCV.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/argaze/utils/contexts/OpenCV.py b/src/argaze/utils/contexts/OpenCV.py
index a65d40e..25b3dd7 100644
--- a/src/argaze/utils/contexts/OpenCV.py
+++ b/src/argaze/utils/contexts/OpenCV.py
@@ -31,7 +31,7 @@ class Window(ArFeatures.ArContext):
@DataFeatures.PipelineStepInit
def __init__(self, **kwargs):
- # Init ArContext classe
+ # Init ArContext class
super().__init__()
@DataFeatures.PipelineStepEnter
@@ -50,6 +50,14 @@ class Window(ArFeatures.ArContext):
return self
+ @DataFeatures.PipelineStepExit
+ def __exit__(self, exception_type, exception_value, exception_traceback):
+
+ logging.info('OpenCV context stops...')
+
+ # Delete window
+ cv2.destroyAllWindows()
+
def __on_mouse_event(self, event, x, y, flags, param):
"""Process pointer position."""
@@ -59,4 +67,4 @@ class Window(ArFeatures.ArContext):
self._process_gaze_position(
timestamp = int((time.time() - self.__start_time) * 1e3),
x = x,
- y = y) \ No newline at end of file
+ y = y)