Kalibr&TartanCalib开源项目进行双目相机标定

一.环境准备

参考上篇文章:

        Kalibr&TartanCalib开源项目进行单目相机标定

1.使用的相机

  双目相机,成像图像一张,可利用python工具进行图像分割成两张,并保存在相应文件夹中,我的文件夹格式;

        -database

                -cam0

                        .jpg

                -cam1

                        .jpg

 二.资源准备

         标定板yaml文件、.bag文件打包方式、相关注意事项参考上篇文章:

                      Kalibr&TartanCalib开源项目进行单目相机标定

三.执行命令-输出

 rosrun kalibr kalibr_calibrate_cameras --target checkerboard.yaml --models pinhole-radtan pinhole-radtan --topics /cam0/image_raw /cam1/image_raw --bag multiCap.bag

注意事项:models参数与topics参数跟的相机顺序要匹配;执行报错则建议手敲指令

 执行 参数说明可通过rosrun kalibr kalibr_calibrate_cameras -h命令了解

usage:
    Example usage to calibrate a camera system with two cameras using an aprilgrid.

    cam0: omnidirection model with radial-tangential distortion
    cam1: pinhole model with equidistant distortion

    kalibr_calibrate_cameras --models omni-radtan pinhole-equi --target aprilgrid.yaml \
              --bag MYROSBAG.bag --topics /cam0/image_raw /cam1/image_raw

    example aprilgrid.yaml:
        target_type: 'aprilgrid'
        tagCols: 6
        tagRows: 6
        tagSize: 0.088  #m
        tagSpacing: 0.3 #percent of tagSize

optional arguments:
  -h, --help            show this help message and exit
  --models MODELS [MODELS ...]
                        The camera model ['pinhole-radtan', 'pinhole-equi', 'pinhole-fov', 'omni-none', 'omni-radtan', 'eucm-none', 'ds-none']
                        to estimate

Data source:
  --bag BAGFILE         The bag file with the data
  --topics TOPICS [TOPICS ...]
                        The list of image topics
  --bag-from-to bag_from_to bag_from_to
                        Use the bag data starting from up to this time [s]

Calibration target configuration:
  --target TARGETYAML   Calibration target configuration as yaml file

Image synchronization:
  --approx-sync MAX_DELTA_APPROXSYNC
                        Time tolerance for approximate image synchronization [s] (default: 0.02)

Calibrator settings:
  --qr-tol QRTOL        The tolerance on the factors of the QR decomposition (default: 0.02)
  --mi-tol MITOL        The tolerance on the mutual information for adding an image. Higher means fewer images will be added. Use -1 to force
                        all images. (default: 0.2)
  --no-shuffle          Do not shuffle the dataset processing order

Outlier filtering options:
  --no-outliers-removal
                        Disable corner outlier filtering
  --no-final-filtering  Disable filtering after all views have been processed.
  --min-views-outlier MINVIEWOUTLIER
                        Number of raw views to initialize statistics (default: 20)
  --use-blakezisserman  Enable the Blake-Zisserman m-estimator
  --plot-outliers       Plot the detect outliers during extraction (this could be slow)

Output options:
  --verbose             Enable (really) verbose output (disables plots)
  --show-extraction     Show the calibration target extraction. (disables plots)
  --plot                Plot during calibration (this could be slow).
  --dont-show-report    Do not show the report on screen after calibration.
 

四.输出文件

 

 通过上述步骤后可得到一个yaml文件和一个txt文档。

yaml文件内包含我们所需的相机内参、畸变系数、和双目标定特有的外参(旋转矩阵和平移向量)

 

        黄色框内的T_cn_cnm1是一个变换矩阵 ,这个矩阵可以分解为旋转矩阵R和平移向量t,r11r33是旋转矩阵R的元素,txtytz是平移向量t的元素

T_cn_cnm1 = [ R | t ]  
          = [ r11 r12 r13 tx ]  
            [ r21 r22 r23 ty ]  
            [ r31 r32 r33 tz ]  
            [ 0   0   0   1  ]

五.结语

通过TartanCalib这个工具可以很好的对双目相机进行标定,针对自己不同种类的摄像头,它提供了不同的相机模型供使用。当然,具体的标定性能这里不做说明也没有参考,TartanCalib与Kalibr不仅仅可以用于双目相机的标定,也适用与单目相机标定、IMU标定、IMU与双目联合标定等场景,想了解更多信息,参考github官方:

kalibr:

https://github.com/ethz-asl/kalibr/wiki/multiple-camera-calibration

tartancalib:

https://github.com/D2SLAM-Fusion/tools-tartancalib?tab=readme-ov-file

  • 12
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值