This repository contains a C++ implementation of an AprilTag pose estimator using OpenCV and Eigen libraries. The ApriltagPoseEstimator class detects AprilTags in a video file and maintains a history of poses for each detected tag. The primary goal of this project is to measure the ground truth trajectory for a drone using an AprilTag placed on it.
- Detects AprilTags in video files.
- Maintains a history of poses for each detected tag.
- Uses OpenCV for video processing and Eigen for matrix operations.
Ensure you have the following dependencies installed:
- OpenCV
- Eigen
- AprilTag3 library
On Ubuntu, you can install the dependencies using apt:
sudo apt-get update
sudo apt-get install -y libopencv-dev libeigen3-dev libapriltag-dev- Clone the repository:
git clone https://github.com/tuxliri/ApriltagPoseEstimator.git
cd ApriltagPoseEstimator- Create a
builddirectory and navigate into it:
mkdir build
cd build- Compile the project using
g++:
g++ -o apriltag_pose_estimator ../main.cpp ../apriltag_pose_estimator.cpp -I/usr/include/eigen3 `pkg-config --cflags --libs opencv4`-
Ensure you have a video file (e.g.,
example.mp4) in the project directory. -
Run the executable:
./apriltag_pose_estimator <path_to_video> <path_to_camera_calibration>.
├── apriltag_pose_estimator.cpp
└── README.md
Dockerfile: Dockerfile for setting up the development environment.README.md: This file.main.cpp: Contains themainfunction and example usage of theApriltagPoseEstimatorclass.apriltag_pose_estimator.cpp: Implementation of theApriltagPoseEstimatorclass.apriltag_pose_estimator.h: Header file for theApriltagPoseEstimatorclass.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.