Skip to content

相机内参标定和双目标定, 支持多种相机模型和多种标定板,

Notifications You must be signed in to change notification settings

KingRichord/camera_model-stereo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

camera_model

相机内参标定和双目标定

支持多种相机模型:

  • pinhole model
  • kannala-brandt model
  • mei model
  • scaramuzza model

支持多种标定板

  • chessboard
  • circles grid
  • asymmetric circles grid
  • aruco makers
  • charuco makrers

编译 & 安装

依赖项

  • OpenCV (with opencv_contrib)
  • Ceres Solver
  • boost
cd camera_model
mkdir build
cd build
cmake ..
make
sudo make install

调用

编译安装之后, camera_model会作为共享库被安装在系统目录, 使用时无需添加源码,只添加依赖关系即可

cmake_minimum_required(VERSION 3.0)
project(camera_model_example)

add_executable(example example.cc)
target_link_libraries(example camera_model)

参考 & 感谢

part of camodocal

感谢原作者 Lionel Heng

感谢 YZF 整理camera_model

感谢 Tianbo 添加Scaramuzza模型实现

用法

相机内参标定 intrinsic_calib

Use intrinsic_calib.cc to calibrate your camera.

双目标定 stereo_calib

Use stereo_calib.cc to calibrate your camera.

Undistortion:

See Camera.h for general interface:

  • liftProjective: Lift points from the image plane to the projective space.
  • spaceToPlane: Projects 3D points to the image plane (Pi function)

案例

相机内参标定 intrinsic calib

mei model

./intrinsic_calib -w 9 -h 6 -i ../data/fisheye -p left -e jpg --camera-model mei --camera-name fisheye_mei -v

pinhole model

./intrinsic_calib -w 9 -h 6 -i ../data/fisheye -p left -e jpg --camera-model pinhole --camera-name fisheye_pinhole -v

kannala-brandt

./intrinsic_calib -w 9 -h 6 -i ../data/fisheye -p left -e jpg --camera-model kannala-brandt --camera-name fisheye_kannala-brandt -v

scaramuzza

./intrinsic_calib -w 9 -h 6 -i ../data/fisheye -p left -e jpg --camera-model scaramuzza --camera-name fisheye_scaramuzza -v --view-results

asymmetric cirlces grid

./intrinsic_calib -w 4 -h 11 -i ../data/asymmetric_circles_grid -p asymmetric_circles_grid -e jpg --pattern asymmetric_circles_grid --camera-model pinhole --camera-name webcam -v --view-results

注意,这里一定要4x11, 设置为11x4就不行

circles grid

./intrinsic_calib -w 9 -h 6 -i ../data/circles_grid -p circles_grid -e jpg --pattern circles_grid --camera-model pinhole --camera-name circles_grid_cam -v --view-results

charuco marker

./intrinsic_calib -w 4 -h 6 -s 0.04 --marker-size 0.024 -i ../data/charuco -p charuco -e jpg --pattern charuco --dp ../data/pattern/detector_params.yml -d 10 --camera-model pinhole --camera-name charuco_cam -v --view-results
./intrinsic_calib -w 4 -h 6 -s 0.04 --marker-size 0.024 -i ../data/charuco -p charuco -e jpg --pattern charuco --dp ../data/pattern/detector_params.yml -d 10 --camera-model kannala-brandt --camera-name charuco_cam -v --view-results

stereo calibration

./stereo_calib -i ../data/stereo_images/ -e jpg --prefix-l left --prefix-r right --camera-model mei -v --view-results

stereo calibration circles (virtual test with mono image)

./stereo_calib -i ../data/circles_grid --pattern circles_grid -e jpg --prefix-l circles_grid --prefix-r circles_grid --camera-model mei -v --view-results

TODO

  • add aruco marker

About

相机内参标定和双目标定, 支持多种相机模型和多种标定板,

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 71.1%
  • Python 28.5%
  • CMake 0.4%