diff options
author | Théo de la Hogue | 2024-06-19 13:58:20 +0200 |
---|---|---|
committer | Théo de la Hogue | 2024-06-19 13:58:20 +0200 |
commit | b228251eeb521559ce452f392304d2a06f3bf1cc (patch) | |
tree | bebb34d841feee5672a22de35d93d1e20f16d905 /src | |
parent | 31a612da77d19cdf93a3ac8b2ecb7e1a61074ff6 (diff) | |
download | argaze-b228251eeb521559ce452f392304d2a06f3bf1cc.zip argaze-b228251eeb521559ce452f392304d2a06f3bf1cc.tar.gz argaze-b228251eeb521559ce452f392304d2a06f3bf1cc.tar.bz2 argaze-b228251eeb521559ce452f392304d2a06f3bf1cc.tar.xz |
Refactoring broken line.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/ArUcoMarker/ArUcoDetector.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/argaze/ArUcoMarker/ArUcoDetector.py b/src/argaze/ArUcoMarker/ArUcoDetector.py index 1af5e7d..4a011d6 100644 --- a/src/argaze/ArUcoMarker/ArUcoDetector.py +++ b/src/argaze/ArUcoMarker/ArUcoDetector.py @@ -193,9 +193,7 @@ class ArUcoDetector(DataFeatures.PipelineStepObject): self.__detected_markers, detected_markers_corners, detected_markers_ids = {}, [], [] # Detect markers into gray picture - detected_markers_corners, detected_markers_ids, _ = aruco.detectMarkers(cv.cvtColor(image, cv.COLOR_BGR2GRAY), - self.__dictionary.markers, - parameters=self.__parameters.internal) + detected_markers_corners, detected_markers_ids, _ = aruco.detectMarkers(cv.cvtColor(image, cv.COLOR_BGR2GRAY), self.__dictionary.markers, parameters=self.__parameters.internal) # Is there detected markers ? if len(detected_markers_corners) > 0: @@ -236,17 +234,17 @@ class ArUcoDetector(DataFeatures.PipelineStepObject): for marker_id, marker in self.__detected_markers.items(): if marker_id in ids: + selected_markers_corners += (marker.corners,) selected_markers_ids.append(marker_id) # Estimate pose of selected markers if len(selected_markers_corners) > 0: - markers_rvecs, markers_tvecs, markers_points = aruco.estimatePoseSingleMarkers(selected_markers_corners, - size, numpy.array( - self.__optic_parameters.K), numpy.array(self.__optic_parameters.D)) + markers_rvecs, markers_tvecs, markers_points = aruco.estimatePoseSingleMarkers(selected_markers_corners, size, numpy.array(self.__optic_parameters.K), numpy.array(self.__optic_parameters.D)) for i, marker_id in enumerate(selected_markers_ids): + marker = self.__detected_markers[marker_id] marker.translation = markers_tvecs[i][0] |