This repository implements algorithms for stereo rectification/calibration using checkerboard patterns with the following procedures:
-
estimate rectified homographies for left and right images using combination of uncalibrated methods of Hartley and Loop&Zhang's.
-
estimate the remapping tables for undistortion. This requires each of the cameras' intrinsic parameters, which is out of scope of this repository. Therefore, opencv's functions are used for calculating monocular camera intrinsic matrix and distortion coefficients.
-
this repository is for pure interest of better understanding of stereo calibration's mechanism/algorithms, so might not be suitable for production purpose.
- rectification without undistortion
- rectification with undistortion
- estimation of fundamental matrix by eight-point algorithm, and refinement by gold-standard algorithm
- estimation of uncalibrated rectification homographies based on combination of Hartley and Loop&Zhang's methods.
- test on calibration board dataset
- from debian
sudo apt-get install \
libopencv-dev \
rapidjson-dev \
# build the lib
make default
# build examples
make apps
-
Download sample calibration data from HERE. This is modified version of The EuRoC MAV Dataset (custom calibration).
-
Uncompress the data
tar -xf ./data/calibration_data.tar.xz -C ./data/
- Each monocular camera (left/right) has been calibrated separately, and the intrinsic calibration params can be seen in ./data/calibration/left(right)_calib_params.yml. You can also test the simple monocular camera calibration app in examples after build by:
./build/examples/mono_cam_intrinsic_calib ./data/calibration_data/left_param_config.json ./left_calib_params.yml
# or
./build/examples/mono_cam_intrinsic_calib ./data/calibration_data/right_param_config.json ./right_calib_params.yml
- Run stereo rectification app (that does estimation of fundamental matrix and image rectification)
./build/examples/stereo_rectification_app ./data/stereo_param_config.json ./data/sample_left.png ./data/sample_right.png