This sample shows how to reset the ZED camera tracking to a known reference using an ArUco marker.
Point the camera to this marker and press the space bar to reset the positional tracking reference. This feature can be useful to avoid accumulating drift when moving the camera or to get multiple cameras in the same referential.
- First, download the latest version of the ZED SDK on stereolabs.com.
- For more information, read the ZED API documentation.
- ZED SDK and its dependencies (CUDA)
- A Stereolabs Stereo Camera
Download the sample and follow the instructions below: More
- Create a "build" folder in the source folder
- Open cmake-gui and select the source and build folders
- Generate the Visual Studio
Win64
solution - Open the resulting solution and change configuration to
Release
- Build solution
Open a terminal in the sample directory and execute the following command:
mkdir build
cd build
cmake ..
make
-
Navigate to the build directory and launch the executable file
-
Or open a terminal in the build directory and run the sample :
./ZED_Reloc_Aruco [path/to/svo] [path/to/aruco_poses.txt]
p
: pause the videospace
: reset the camera position based on the closest aruco tagz
: display the world coordinate system axes in the RGB image from the zed positional trackinga
: display the world coordinate system axes in the RGB image from the aruco detectiond
: toggle the display of the positions of the camera pose estimated by aruco detection
This website can be used to easily display Aruco patterns.
The sample is expecting a 6x6 Aruco
Dictionary with a 160mm marker by default. The bigger the marker, the better the camera position will be.
It's important to make sure that the real-world size of the marker matches the size set in the samples (160mm) to avoid scale issues in the tracking.
The Aruco detection code is taken from OpenCV Contrib module, please refer to the source files for the license information (BSD 3).