diff options
author | Théo de la Hogue | 2023-07-05 17:36:56 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-07-05 17:36:56 +0200 |
commit | 5253d5464ed2512f05bc3c4ad31f9fdf110fc36e (patch) | |
tree | 214e2ab859b2aa693ab3a0ceed39d9661eac1c1b | |
parent | 0d3eb5a2051cda1e96b7db6d55b5050d535e5368 (diff) | |
download | argaze-5253d5464ed2512f05bc3c4ad31f9fdf110fc36e.zip argaze-5253d5464ed2512f05bc3c4ad31f9fdf110fc36e.tar.gz argaze-5253d5464ed2512f05bc3c4ad31f9fdf110fc36e.tar.bz2 argaze-5253d5464ed2512f05bc3c4ad31f9fdf110fc36e.tar.xz |
Returning detection time as float value.
-rw-r--r-- | src/argaze/ArFeatures.py | 9 | ||||
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoDetector.py | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py index dc696ee..09edc6c 100644 --- a/src/argaze/ArFeatures.py +++ b/src/argaze/ArFeatures.py @@ -305,6 +305,9 @@ class ArFrame(): # Update current gaze position self.__gaze_position = inner_gaze_position + # No aoi is looked by default + look_at = None + # Init scan path analysis report scan_step_analysis = {} aoi_scan_step_analysis = {} @@ -317,9 +320,7 @@ class ArFrame(): if GazeFeatures.is_fixation(ended_gaze_movement): - # Does the fixation match an AOI? - look_at = None - + # Does the fixation match an aoi? for name, aoi in self.aoi_2d_scene.items(): _, _, circle_ratio = aoi.circle_intersection(ended_gaze_movement.focus, ended_gaze_movement.deviation_max) @@ -923,7 +924,7 @@ class ArEnvironment(): yield aoi_frame - def detect_and_project(self, image: numpy.array) -> int: + def detect_and_project(self, image: numpy.array) -> Tuple[float, dict]: """Detect environment aruco markers from image and project scenes into camera frame. Returns: diff --git a/src/argaze/ArUcoMarkers/ArUcoDetector.py b/src/argaze/ArUcoMarkers/ArUcoDetector.py index 723bc26..3fb17bf 100644 --- a/src/argaze/ArUcoMarkers/ArUcoDetector.py +++ b/src/argaze/ArUcoMarkers/ArUcoDetector.py @@ -176,7 +176,7 @@ class ArUcoDetector(): return output - def detect_markers(self, image: numpy.array) -> int: + def detect_markers(self, image: numpy.array) -> float: """Detect all ArUco markers into an image. .. danger:: DON'T MIRROR IMAGE @@ -196,7 +196,7 @@ class ArUcoDetector(): self.__detected_markers_corners, self.__detected_markers_ids, _ = aruco.detectMarkers(cv.cvtColor(image, cv.COLOR_BGR2GRAY), self.dictionary.markers, parameters = self.parameters.internal) # Assess marker detection time in ms - detection_time = int((time.time() - detection_start) * 1e3) + detection_time = (time.time() - detection_start) * 1e3 # Is there detected markers ? if len(self.__detected_markers_corners) > 0: |