ROS2相机内参标定

参考Nav2中文网内容:http://nav2.fishros.com/doc/tutorials/docs/camera_calibration.html

相机校准

概述
本教程演示如何获取标定参数单目相机。

要求
1-安装相机校准解析器、相机信息管理器,并使用操作系统的包管理器启动测试组件:

sudo apt install ros--camera-calibration-parsers

sudo apt install ros--camera-info-manager

sudo apt install ros--launch-testing-ament-cmake

2-图像管道需要从工作区中的源构建,具有:

git clone – b git@github.com:ros-perception/image_pipeline.git

Also另外,请确保您具有以下内容: Also [待校准@1161]

A大棋盘已知尺寸。本教程使用7x9棋盘200毫米广场。* * 校准使用interior顶点的棋盘,所以 “8x10” 板使用内部顶点参数 “7x9” 如下例所示。* * 棋盘具有设定尺寸可以从 here 。

一个光线充足的5米 × 5米区域,没有障碍物和检查板图案
单筒摄像机在ROS上发布图像

教程步骤
1-在GUI中启动终端

2-为您的特定相机启动ROS驱动程序。

3-确保相机通过ROS发布图像。这可以通过运行来测试:

ros2 topic list

4-这将显示你所有主题发表确保一个image_raw主题/相机/image_raw。确认其真正话题实际上出版检查主题hz: [待校准@1170]

ros2 topic hz /camera/image_raw

…/…/_images/ROS2_topic_hz.png

5启动摄像机标定节点

ros2 run camera_calibration cameracalibrator --size 7x9 --square 0.20 image:=/my_camera/image_raw camera:=/my_camera

Camera Name:

-c, --camera_name
name of the camera to appear in the calibration file

Chessboard Options:

You must specify one or more chessboards as pairs of --size and–square options.

-p PATTERN, --pattern=PATTERN
calibration pattern to detect - ‘chessboard’,‘circles’, ‘acircles’,‘charuco’
-s SIZE, --size=SIZE
chessboard size as NxM, counting interior corners (e.g. a standard chessboard is 7x7)
-q SQUARE, --square=SQUARE
chessboard square size in meters

ROS Communication Options:

–approximate=APPROXIMATE
allow specified slop (in seconds) when pairing images from unsynchronized stereo cameras
–no-service-check
disable check for set_camera_info services at startup

Calibration Optimizer Options:

–fix-principal-point
fix the principal point at the image center
–fix-aspect-ratio
enforce focal lengths (fx, fy) are equal
–zero-tangent-dist
set tangential distortion coefficients (p1, p2) to
zero
-k NUM_COEFFS, --k-coefficients=NUM_COEFFS
number of radial distortion coefficients to use (up to
6, default 2)
–disable_calib_cb_fast_check
uses the CALIB_CB_FAST_CHECK flag for findChessboardCorners

This will open a calibration window which highlight the checkerboard.

…/…/_images/window1.png

6为了良好校准你需要移动棋盘在相机骨架,:

相机视野左侧、右侧、顶部和底部的棋盘
◦ X酒吧左/右在视场

Y条-视野中的顶部/底部

尺寸条-朝向/远离并从相机倾斜

棋盘填满整个视野

棋盘向左、向右、顶部和底部倾斜 (倾斜)

…/…/_images/calibration.jpg

7作为棋盘格移动4酒吧标定侧边栏增加长度。当所有然后4酒吧绿色足够数据校准校准按钮会亮起。单击查看结果。大约需要一分钟校准发生

…/…/_images/greenbars.png

8-校准完成后,保存和提交按钮亮起。您还可以在终端中看到结果。

…/…/_images/calibration_complete.png

…/…/_images/calibration_parameters.png

9-按保存按钮查看结果。数据保存到 “/tmp/校准数据.Tar.gz”
10-使用校准文件解压缩calibration.tar.gz
tar -xvf calibration.tar.gz

11-在用于校准的文件夹中,图像以及 “ost.yaml” 和 “ost.txt” 都可用。您可以使用yaml文件,该文件包含相机驱动程序指示的校准参数。

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值