aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-03-29 10:04:23 +0200
committerThéo de la Hogue2023-03-29 10:04:23 +0200
commit86ca03f4ac5e6bc5b382dc57daf1665611530d8e (patch)
treecbeefc52758c0f8ba9291012fc5f18e4c7d27866
parent147f3e473bbd0e35cbe754baea329c6b5cb7c2d2 (diff)
downloadargaze-86ca03f4ac5e6bc5b382dc57daf1665611530d8e.zip
argaze-86ca03f4ac5e6bc5b382dc57daf1665611530d8e.tar.gz
argaze-86ca03f4ac5e6bc5b382dc57daf1665611530d8e.tar.bz2
argaze-86ca03f4ac5e6bc5b382dc57daf1665611530d8e.tar.xz
Improving calibration board exportation script.
-rw-r--r--src/argaze/utils/README.md2
-rw-r--r--src/argaze/utils/aruco_calibration_board_export.py12
2 files changed, 8 insertions, 6 deletions
diff --git a/src/argaze/utils/README.md b/src/argaze/utils/README.md
index fa49ea5..f91438f 100644
--- a/src/argaze/utils/README.md
+++ b/src/argaze/utils/README.md
@@ -17,7 +17,7 @@ python ./src/argaze/utils/aruco_markers_dictionary_export.py DICT_APRILTAG_16h5
Export a 7 columns and 5 rows calibration board made of 5cm squares with 3cm markers from DICT_APRILTAG_16h5 dictionary at 300 dpi into an \_export folder:
```
-python ./src/argaze/utils/aruco_calibration_board_export.py 7 5 5 3 -o _export -d DICT_APRILTAG_16h5 -r 300
+python ./src/argaze/utils/aruco_calibration_board_export.py 7 5 5 3 DICT_APRILTAG_16h5 -r 300 -o _export
```
# TODO: Camera calibration
diff --git a/src/argaze/utils/aruco_calibration_board_export.py b/src/argaze/utils/aruco_calibration_board_export.py
index dde2b47..cca5bde 100644
--- a/src/argaze/utils/aruco_calibration_board_export.py
+++ b/src/argaze/utils/aruco_calibration_board_export.py
@@ -12,11 +12,11 @@ def main():
parser = argparse.ArgumentParser(description=main.__doc__)
parser.add_argument('columns', metavar='COLS_NUMBER', type=int, default=7, help='number of columns')
parser.add_argument('rows', metavar='ROWS_NUMBER', type=int, default=5, help='number of rows')
- parser.add_argument('square_size', metavar='SQUARE_SIZE', type=int, default=5, help='square size (cm)')
- parser.add_argument('marker_size', metavar='MARKER_SIZE', type=int, default=3, help='marker size (cm)')
- parser.add_argument('-o', '--output', metavar='OUT', type=str, default='.', help='destination path')
- parser.add_argument('-d', '--dictionary', metavar='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('square_size', metavar='SQUARE_SIZE', type=int, default=5, help='square size in cm')
+ parser.add_argument('marker_size', metavar='MARKER_SIZE', type=int, default=3, help='marker size in cm')
+ parser.add_argument('dictionary', metavar='DICT', type=ArUcoMarkersDictionary.ArUcoMarkersDictionary, default='DICT_ARUCO_ORIGINAL', help='dictionnary name: 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('-r', '--resolution', metavar='RES', type=int, default=300, help='picture resolution in dpi')
+ parser.add_argument('-o', '--output', metavar='OUT', type=str, default='.', help='destination folder path')
args = parser.parse_args()
# Manage destination folder
@@ -25,11 +25,13 @@ def main():
print(f'{args.output} folder created')
# Create aruco board
- aruco_board = ArUcoBoard.ArUcoBoard(args.dictionary, args.columns, args.rows, args.square_size, args.marker_size)
+ aruco_board = ArUcoBoard.ArUcoBoard(args.columns, args.rows, args.square_size, args.marker_size, args.dictionary)
# Export aruco board
aruco_board.save(args.output, args.resolution)
+ print(f'{args.columns} x {args.rows} calibration board with {args.marker_size} cm markers from {args.dictionary.name} dictionary exported into {args.output} folder.')
+
if __name__ == '__main__':
main() \ No newline at end of file