aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/argaze/ArUcoMarkers/ArUcoCamera.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoCamera.py b/src/argaze/ArUcoMarkers/ArUcoCamera.py
index 4f00a3a..33f5b37 100644
--- a/src/argaze/ArUcoMarkers/ArUcoCamera.py
+++ b/src/argaze/ArUcoMarkers/ArUcoCamera.py
@@ -11,6 +11,7 @@ from typing import TypeVar, Tuple
from dataclasses import dataclass, field
import json
import os
+import time
from argaze import ArFeatures, DataStructures
from argaze.ArUcoMarkers import ArUcoMarkersDictionary, ArUcoDetector, ArUcoOpticCalibrator, ArUcoScene
@@ -146,6 +147,7 @@ class ArUcoCamera(ArFeatures.ArCamera):
Returns:
detection time: aruco marker detection time in ms.
+ projection time: scenes projection time in ms.
exception: dictionary with exception raised per scene.
"""
@@ -155,6 +157,9 @@ class ArUcoCamera(ArFeatures.ArCamera):
# Lock camera frame exploitation
self._frame_lock.acquire()
+ # Store projection execution start date
+ projection_start = time.perf_counter()
+
# Fill camera frame background with image
self.background = image
@@ -206,11 +211,14 @@ class ArUcoCamera(ArFeatures.ArCamera):
exceptions[scene_name] = e
+ # Assess projection time in ms
+ projection_time = (time.perf_counter() - projection_start) * 1e3
+
# Unlock camera frame exploitation
self._frame_lock.release()
- # Return dection time and exceptions
- return detection_time, exceptions
+ # Return detection time, projection time and exceptions
+ return detection_time, projection_time, exceptions
def __image(self, draw_detected_markers: dict = None, draw_scenes: dict = None, draw_optic_parameters_grid: dict = None, **kwargs: dict) -> numpy.array:
"""Get frame image with ArUco detection visualisation.