diff options
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] |