From f4d60a6cd1e1d8810cf4b9ad7f63a8718069f73a Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Mon, 4 Sep 2023 22:03:46 +0200 Subject: First work on new AR pipeline architecture. Class renaming and replacing. --- .../aruco_markers/markers_scene_description.md | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'docs/user_guide/aruco_markers/markers_scene_description.md') diff --git a/docs/user_guide/aruco_markers/markers_scene_description.md b/docs/user_guide/aruco_markers/markers_scene_description.md index e1cd651..c6dbf31 100644 --- a/docs/user_guide/aruco_markers/markers_scene_description.md +++ b/docs/user_guide/aruco_markers/markers_scene_description.md @@ -1,11 +1,11 @@ Markers scene description ========================= -The ArGaze toolkit provides [ArUcoScene](../../argaze.md/#argaze.ArUcoMarkers.ArUcoScene) class to describe where [ArUcoMarkers](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarker) are placed into a 3D model. +The ArGaze toolkit provides [ArUcoMarkersGroup](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarkersGroup) class to describe where [ArUcoMarkers](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarker) are placed into a 3D model. -![ArUco scene](../../img/aruco_scene.png) +![ArUco scene](../../img/aruco_markers_group.png) -[ArUcoScene](../../argaze.md/#argaze.ArUcoMarkers.ArUcoScene) is useful to: +[ArUcoMarkersGroup](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarkersGroup) is useful to: * filter markers that belongs to this predefined scene, * check the consistency of detected markers according the place where each marker is expected to be, @@ -37,16 +37,16 @@ f 5//2 6//2 8//2 7//2 ... ``` -Here is a sample of code to show the loading of an [ArUcoScene](../../argaze.md/#argaze.ArUcoMarkers.ArUcoScene) OBJ file description: +Here is a sample of code to show the loading of an [ArUcoMarkersGroup](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarkersGroup) OBJ file description: ``` python -from argaze.ArUcoMarkers import ArUcoScene +from argaze.ArUcoMarkers import ArUcoMarkersGroup # Create an ArUco scene from a OBJ file description -aruco_scene = ArUcoScene.ArUcoScene.from_obj('./markers.obj') +aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_obj('./markers.obj') # Print loaded marker places -for place_id, place in aruco_scene.places.items(): +for place_id, place in aruco_markers_group.places.items(): print(f'place {place_id} for marker: ', place.marker.identifier) print(f'place {place_id} translation: ', place.translation) @@ -55,7 +55,7 @@ for place_id, place in aruco_scene.places.items(): ### from JSON -[ArUcoScene](../../argaze.md/#argaze.ArUcoMarkers.ArUcoScene) description can also be written in a JSON file format. +[ArUcoMarkersGroup](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarkersGroup) description can also be written in a JSON file format. ``` json { @@ -83,13 +83,13 @@ for place_id, place in aruco_scene.places.items(): Here is a more advanced usage where ArUco scene is built from markers detected into an image: ``` python -from argaze.ArUcoMarkers import ArUcoScene +from argaze.ArUcoMarkers import ArUcoMarkersGroup # Assuming markers have been detected and their pose estimated thanks to ArUcoDetector ... # Build ArUco scene from detected markers -aruco_scene = ArUcoScene.ArUcoScene(aruco_detector.marker_size, aruco_detector.dictionary, aruco_detector.detected_markers) +aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup(aruco_detector.marker_size, aruco_detector.dictionary, aruco_detector.detected_markers) ``` ## Markers filtering @@ -97,7 +97,7 @@ aruco_scene = ArUcoScene.ArUcoScene(aruco_detector.marker_size, aruco_detector.d Considering markers are detected, here is how to filter them to consider only those which belongs to the scene: ``` python -scene_markers, remaining_markers = aruco_scene.filter_markers(aruco_detector.detected_markers) +scene_markers, remaining_markers = aruco_markers_group.filter_markers(aruco_detector.detected_markers) ``` ## Marker poses consistency @@ -106,12 +106,12 @@ Then, scene markers poses can be validated by verifying their spatial consistenc ``` python # Check scene markers consistency with 10° angle tolerance and 1 cm distance tolerance -consistent_markers, unconsistent_markers, unconsistencies = aruco_scene.check_markers_consistency(scene_markers, 10, 1) +consistent_markers, unconsistent_markers, unconsistencies = aruco_markers_group.check_markers_consistency(scene_markers, 10, 1) ``` ## Scene pose estimation -Several approaches are available to perform [ArUcoScene](../../argaze.md/#argaze.ArUcoMarkers.ArUcoScene) pose estimation from markers belonging to the scene. +Several approaches are available to perform [ArUcoMarkersGroup](../../argaze.md/#argaze.ArUcoMarkers.ArUcoMarkersGroup) pose estimation from markers belonging to the scene. The first approach considers that scene pose can be estimated **from a single marker pose**: @@ -120,20 +120,20 @@ The first approach considers that scene pose can be estimated **from a single ma marker_id, marker = consistent_markers.popitem() # Estimate scene pose from a single marker -tvec, rmat = self.aruco_scene.estimate_pose_from_single_marker(marker) +tvec, rmat = self.aruco_markers_group.estimate_pose_from_single_marker(marker) ``` The second approach considers that scene pose can be estimated by **averaging several marker poses**: ``` python # Estimate scene pose from all consistent scene markers -tvec, rmat = self.aruco_scene.estimate_pose_from_markers(consistent_markers) +tvec, rmat = self.aruco_markers_group.estimate_pose_from_markers(consistent_markers) ``` The third approach is only available when ArUco markers are placed in such a configuration that is possible to **define orthogonal axis**: ``` python -tvec, rmat = self.aruco_scene.estimate_pose_from_axis_markers(origin_marker, horizontal_axis_marker, vertical_axis_marker) +tvec, rmat = self.aruco_markers_group.estimate_pose_from_axis_markers(origin_marker, horizontal_axis_marker, vertical_axis_marker) ``` ## Scene exportation @@ -142,5 +142,5 @@ As ArUco scene can be exported to OBJ file description to import it into most 3D ``` python # Export an ArUco scene as OBJ file description -aruco_scene.to_obj('markers.obj') +aruco_markers_group.to_obj('markers.obj') ``` -- cgit v1.1