[Japanese/English]
AprilTag detection sample in Python.
I use pupil-labs/apriltags for detection.
※For environments other than Windows, you can use AprilRobotics/apriltag or duckietown/lib-dt-apriltags.
Demo.mp4
- opencv-python 4.5.3.56 or later
- pupil-apriltags 1.0.4 or later
pupil-apriltags can be installed with pip.
pip install pupil-apriltags
Please obtain the tag image from the following.
The images used in the demo are stored in the pdf directory.
Here's how to run the demo.
python sample.py
- --device
Specifying the camera device number
Default:0 - --width
Width at the time of camera capture
Default:960 - --height
Height at the time of camera capture
Default:540 - --families
Tag family
If you specify more than one, separate them with spaces.
Default:tag36h11 - --nthreads
Number of threads
Default:1 - --quad_decimate
Quad detection to increase speed (decrease accuracy)
Full resolution if 1.0 is specified
Default:2.0 - --quad_sigma
Whether to apply Gaussian blur
The setting value indicates the standard deviation in pixels
Very noisy images may be improved by setting a non-zero value (0.8 etc.)
Default:0.0 - --refine_edges
Whether the edges of each Quad are close to a strong gradient
Default:1 - --decode_sharpening
How sharpen the decoded image is
Default:0.25 - --debug
Whether to save the debug image
Default:0
※See pupil-labs/apriltags#usage for details on each option
Kazuhito Takahashi(https://twitter.com/KzhtTkhs)
AprilTag-Detection-Python-Sample is under MIT License.