This application utilizes OpenCV to generate and detect ArUco markers of various sizes, and to estimate their 3D angles relative to the camera.
The program is designed to perform the following tasks:
- It generates ArUco markers, with the option to select the marker type.
- It detects ArUco markers in real-time and estimates their 3D pose, including both orientation and position.
- It calculates and displays the pitch, yaw, and roll angles for the detected markers.
- It estimates and presents the distance from the camera to each marker.
- Optionally, it preprocesses (either blurs or distorts) the generated ArUco marker if not in real-time, then returns to step 2.
To install the required packages, run the following command:
conda env create -f environment.yml
conda acrivate aruco
This will create a new conda environment called aruco
and install the required packages. You can activate the environment by running conda activate aruco
.
To estimate the 3D angles of the distorted ArUco markers in real-time, run the following command:
python aruco_realtime.py
The program will launch a window that shows a live video feed, within which it will highlight detected ArUco markers. Plese modify the camera_matrix
and dist_coeff
variables through calibrating your own camera parameters.
You can just press the 'q' key to terminate the program.
To generate ArUco markers, run the following command:
python aruco_generator.py
Please modify the aruco_type
variable in the script to generate different types of ArUco markers.
To preprocess(bluring and distorting) the generated ArUco markers from recorded .avi, run the following command:
python aruco_preprocess.py
To detect ArUco markers and estimate their 3D angles from preprocessed ArUco markers, run the following command:
python aruco_pose_est.py