diff options
Diffstat (limited to 'src/argaze/utils/tobii_segment_aruco_aoi_edit.py')
-rw-r--r-- | src/argaze/utils/tobii_segment_aruco_aoi_edit.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/argaze/utils/tobii_segment_aruco_aoi_edit.py b/src/argaze/utils/tobii_segment_aruco_aoi_edit.py index f25138c..57ac756 100644 --- a/src/argaze/utils/tobii_segment_aruco_aoi_edit.py +++ b/src/argaze/utils/tobii_segment_aruco_aoi_edit.py @@ -26,7 +26,7 @@ def main(): parser.add_argument('-r', '--time_range', metavar=('START_TIME', 'END_TIME'), nargs=2, type=float, default=(0., None), help='start and end time (in second)') parser.add_argument('-c', '--camera_calibration', metavar='CAM_CALIB', type=str, default=None, help='json camera calibration filepath') parser.add_argument('-p', '--aruco_tracker_configuration', metavar='TRACK_CONFIG', type=str, default=None, help='json aruco tracker configuration filepath') - parser.add_argument('-md', '--marker_dictionary', metavar='MARKER_DICT', type=str, default='DICT_ARUCO_ORIGINAL', help='aruco marker dictionnary (DICT_4X4_50, DICT_4X4_100, DICT_4X4_250, DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, DICT_5X5_1000, DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL,DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10, DICT_APRILTAG_36h11)') + parser.add_argument('-md', '--marker_dictionary', metavar='MARKER_DICT', type=ArUcoMarkersDictionary.ArUcoMarkersDictionary, default='DICT_ARUCO_ORIGINAL', help='aruco marker dictionnary (DICT_4X4_50, DICT_4X4_100, DICT_4X4_250, DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, DICT_5X5_1000, DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL, DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10, DICT_APRILTAG_36h11)') parser.add_argument('-ms', '--marker_size', metavar='MARKER_SIZE', type=float, default=6, help='aruco marker size (cm)') parser.add_argument('-mi', '--marker_id_scene', metavar='MARKER_ID_SCENE', type=json.loads, help='{"marker": "aoi scene filepath"} dictionary') parser.add_argument('-o', '--output', metavar='OUT', type=str, default=None, help='destination folder path (segment folder by default)') @@ -37,9 +37,9 @@ def main(): # Manage markers id to track if args.marker_id_scene == None: - print(f'Track any Aruco markers from the {args.marker_dictionary} dictionary') + print(f'Track any Aruco markers from the {args.marker_dictionary.name} dictionary') else: - print(f'Track Aruco markers {list(args.marker_id_scene.keys())} from the {args.marker_dictionary} dictionary') + print(f'Track Aruco markers {list(args.marker_id_scene.keys())} from the {args.marker_dictionary.name} dictionary') # Manage destination path destination_path = '.' @@ -76,7 +76,7 @@ def main(): # Load a tobii segment video tobii_segment_video = tobii_segment.load_video() - print(f'Video properties:\n\tduration: {tobii_segment_video.get_duration()/1e6} s\n\twidth: {tobii_segment_video.get_width()} px\n\theight: {tobii_segment_video.get_height()} px') + print(f'Video properties:\n\tduration: {tobii_segment_video.duration/1e6} s\n\twidth: {tobii_segment_video.width} px\n\theight: {tobii_segment_video.height} px') # Create aruco camera aruco_camera = ArUcoCamera.ArUcoCamera() @@ -100,7 +100,7 @@ def main(): aruco_tracker.load_configuration_file(args.aruco_tracker_configuration) - print(f'ArUcoTracker configuration for {aruco_tracker.get_markers_dictionay().get_markers_format()} markers detection:') + print(f'ArUcoTracker configuration for {args.marker_dictionary.name} markers detection:') aruco_tracker.print_configuration() load_configuration_file() @@ -133,7 +133,7 @@ def main(): # Display first frame video_ts, video_frame = tobii_segment_video.get_frame(0) - cv.imshow(f'Segment {tobii_segment.get_id()} ArUco marker editor', video_frame.matrix) + cv.imshow(f'Segment {tobii_segment.id} ArUco marker editor', video_frame.matrix) # Init mouse interaction variables pointer = (0, 0) @@ -217,7 +217,7 @@ def main(): aruco_tracker.draw(visu_frame.matrix) # Project 3D scene on each video frame and the visualisation frame - if aruco_tracker.get_markers_number(): + if aruco_tracker.markers_number(): # Write detected marker ids cv.putText(visu_frame.matrix, f'Detected markers: {aruco_tracker.get_markers_ids()}', (20, visu_frame.height - 40), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv.LINE_AA) |