An application that use DSLR camera to track the pose(position and orientation) of ArUco markers in images, video or live video(not implemented yet).
- The program detects ArUco markers in image, this program allows user set parameters regarding to the detection algorithm and determine the detection regions on images.
- Using IPPE algorithm (A Perspective-n-Point(PnP) Method) to track the pose of detected markers. The global coordinate system is the camera coordinate system. Hence, the origin is at camera center.
- Using Bundle Adjustment to refine calculated markers pose (Can be turned off).
- User could visualize and get a tracking result csv file. The csv file conatins marker's IDs, position and pose information, sorted by image.
- VTK: For marker tracking result visualization.
- Eigen For matrix calculation.
- OpenCV: For ArUco marker detection, pose estimation and image I/O. Opencv Contrib Module is required(viz).
- g2o: For Bundle Adjustment.
- MarkerBA: For marker-based Bundle Adjustment (Optimizing marker pose rather than marker corners positions).
- json: For json file I/O.
-
Aruco marker preparation: Print and Place ArUco markers where you want to track. Fill in marker size (meter) in config/params.json. If having markers with different size, fill in the size with specified ID in "specialMarkerSize".
-
Camera calibration: Using exsited camera calibration tools to obtain camera intrinsic matrix and distortion coeeficient. Fill in camera matrix(kmat) and distortion coefficient(distmat) in config/params.json. During and after this step, the camera auto focus must be turned off.
-
Include files
-
Declare ArucoLocating
-
(Optional) Declare ArucoLocating::arucoDetectionSet(source, sourcePath): Adjust the aruco detection algorithm parameters. Recommanded for blurred or scenario that marker is hard to detect.
-
Declare ArucoLocating::run(source,sourcePath,BA,monitor,parallel):
- Source: Source::IMG for img file; Source Vidoe for video file
- sourcePath: folder where the images stored or the path of the video file
- BA: Turn on/off Bundle Adjustment for optimizing marker pose.
- monitor: 3D Visualize each img/frame marker detection and tracking result.
- parallel: Allow Multiprocess for better efficiency.
Hint: When parallel is on, monitor cannot be switched on.
-
Declare ArucoLocating.save(path): Save the marker tracking result as csv file in specificed path.
//4
#include "pch.h"
#include "aruco_locating.h"
int main(){
ArucoLocating arucoLocator; //5
//arucoLocator.arucoDetectionSet(Source::IMAGE, "asset/imgs"); //6
arucoLocator.run(Source::IMAGE, "asset/imgs", true,false, true); //7
arucoLocator.save("asset/saved"); //8
}
- Garrido-Jurado, Sergio, et al. "Automatic generation and detection of highly reliable fiducial markers under occlusion." Pattern Recognition 47.6 (2014): 2280-2292.
- https://github.com/HeYijia/MarkerBA/tree/master
- Collins, Toby, and Adrien Bartoli. "Infinitesimal plane-based pose estimation." International journal of computer vision 109.3 (2014): 252-286.
- 高翔, 视觉 SLAM 十四讲: 从理论到实践. 电子工业出版社, 2017.
- Graphics Designed By TIM-Chang From LovePik.com