aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2024-04-02 13:10:59 +0200
committerThéo de la Hogue2024-04-02 13:10:59 +0200
commit4b799088a368bd1143fc35b36015a063cec122f6 (patch)
treebaa6b83a7c7a17bdf8bc5e8b910f1f0f4dfeea1f /src
parent5fa525837d885d815074064da5736ef7f8638de0 (diff)
downloadargaze-4b799088a368bd1143fc35b36015a063cec122f6.zip
argaze-4b799088a368bd1143fc35b36015a063cec122f6.tar.gz
argaze-4b799088a368bd1143fc35b36015a063cec122f6.tar.bz2
argaze-4b799088a368bd1143fc35b36015a063cec122f6.tar.xz
Logging watch function.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/ArUcoMarkers/ArUcoCamera.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoCamera.py b/src/argaze/ArUcoMarkers/ArUcoCamera.py
index 1371a38..f32e4b6 100644
--- a/src/argaze/ArUcoMarkers/ArUcoCamera.py
+++ b/src/argaze/ArUcoMarkers/ArUcoCamera.py
@@ -17,6 +17,7 @@ __copyright__ = "Copyright 2023, Ecole Nationale de l'Aviation Civile (ENAC)"
__license__ = "GPLv3"
from typing import Self
+import logging
import json
import os
import time
@@ -132,18 +133,24 @@ class ArUcoCamera(ArFeatures.ArCamera):
def watch(self, image: DataFeatures.TimestampedImage):
"""Detect environment aruco markers from image and project scenes into camera frame."""
+ logging.debug('ArUcoCamera.watch')
+
# Use camera frame locker feature
with self._lock:
# Draw black rectangles to mask sides
if self.__sides_mask > 0:
+ logging.debug('\t> drawing sides mask (%i px)', self.__sides_mask)
+
height, width, _ = image.shape
cv2.rectangle(image, (0, 0), (self.__sides_mask, height), (0, 0, 0), -1)
cv2.rectangle(image, (width - self.__sides_mask, 0), (width, height), (0, 0, 0), -1)
# Detect aruco markers
+ logging.debug('\t> detect markers')
+
self.__aruco_detector.detect_markers(image)
# Fill camera frame background with timestamped image
@@ -178,11 +185,15 @@ class ArUcoCamera(ArFeatures.ArCamera):
'''
# Estimate scene pose from detected scene markers
+ logging.debug('\t> estimate %s scene pose', scene_name)
+
tvec, rmat, _ = scene.estimate_pose(self.__aruco_detector.detected_markers(), timestamp=self.timestamp)
# Project scene into camera frame according estimated pose
for layer_name, layer_projection in scene.project(tvec, rmat, self.visual_hfov, self.visual_vfov, timestamp=self.timestamp):
+ logging.debug('\t> project %s scene %s layer', scene_name, layer_name)
+
try:
# Update camera layer aoi
@@ -230,7 +241,7 @@ class ArUcoCamera(ArFeatures.ArCamera):
self.__aruco_detector.draw_detected_markers(image, draw_detected_markers)
return image
-
+
def image(self, **kwargs: dict) -> numpy.array:
"""
Get frame image.