xmba15 / stereo_calibration

stereo rectification/calibration from almost^^ scatch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐Ÿ“ Stereo Rectification/Calibration from almost^^ scatch


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.

Sample Result Images


  • rectification without undistortion

rectified_distorted

  • rectification with undistortion

rectified_undistorted

๐ŸŽ‰ TODO


  • 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

๐ŸŽ› Dependencies


  • from debian
sudo apt-get install \
    libopencv-dev \
    rapidjson-dev \

๐Ÿ”จ How to Build


# build the lib
make default

# build examples
make apps

๐Ÿƒ How to Run


  • 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

๐Ÿ’Ž References


  1. Computing Rectifying Homographies for Stereo Vision, CVPR 1999
  2. Determining the Epipolar Geometry and its Uncertainty: A Review
  3. A โ€œLoop and Zhangโ€ Reader for Stereo Rectification
  4. Multiple View Geometry in Computer Vision
  5. Machine Vision Toolbox Matlab
  6. CS231A Course Notes 3: Epipolar Geometry

About

stereo rectification/calibration from almost^^ scatch


Languages

Language:C++ 89.4%Language:CMake 10.1%Language:Makefile 0.5%