Calibration - julian-steiner/Waveshare-Stereo-Camera GitHub Wiki
Calibrating the camera
For calibration you can use the calibrationAssistant provided by the library. This simplifies the calibration a lot by just having to call two functions.
Generating calibration images
For the generation of the images, you will need a chessboard which can be used for camera calibration. It is also neccessary to have a calibration config file in the folder.
It is important that the calibration resolution is the same as the resolution of the application afterwards.
The folders left/ and right/ have to be present in the specified folder in the config in order for the imageGeneration to work.
This program will start a video Stream of the camera and when you press enter, the current image is validated and checked if it's containing the chessboard. If it is valid, it is saved and this is repeated as many times as specified in the config file.
#include "StereoCamera.h"
#include "CameraCalibrationAssistant.h"
waveshare::StereoCamera camera(2, 4);
camera.setResolution({1280, 720});
waveshare::calibrationAssistant::generateCalibrationImages(&camera);
Calibrating the camera
To calibrate the camera you have to have a config file and the images for the calibration have to be generated.
Furthermore you need to have an empty xml or yml file present to save the calibration to.
waveshare::CalibrationAssistant::computeCalibrationMatrices("CalibrationOutput.xml");