Ubuntu2204+ROS2(humble)+usb_cam内参标定

1、安装usb_cam包

pip install pydantic==1.10.14

sudo apt install ros-humble-usb-cam

# 测试打开相机
ros2 launch usb_cam camera.launch.py

# 显示图像
ros2 run image_view image_view image:=/camera1/image_raw

2、安装 camera_calibration

sudo apt install ros-humble-camera-calibration

3、执行标定程序

ros2 run camera_calibration cameracalibrator --size 9x6 --square 0.026 image:=/camera1/image_raw camera:=/usb_cam

参数说明:

  1. --size 当前标定板大小
  2. --square 每个小棋盘格的边长,单位米
  3. image:=/camera1/image_raw 图像来源主题
  4. camera:=/usb_cam 相机名称

4、通过不停的移动标定板:直到X、Y、Size、Skew四个都变成绿色,点击CALIBRATE按钮;

完成后可点击“save”进行保存,文件保存路径在终端里有显示。再次将标定板放在视野里时,右上角会出现一个数值,代表标定误差。

5、点击SAVE按钮

结果以压缩包形式保存在:/tmp/calibrationdata.tar.gz中。

image_width: 640
image_height: 480
camera_name: narrow_stereo
camera_matrix:
  rows: 3
  cols: 3
  data: [620.78764,   0.     , 301.03635,
           0.     , 623.18712, 249.98162,
           0.     ,   0.     ,   1.     ]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [0.156418, -0.248802, 0.003859, -0.003760, 0.000000]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1., 0., 0.,
         0., 1., 0.,
         0., 0., 1.]
projection_matrix:
  rows: 3
  cols: 4
  data: [635.97443,   0.     , 298.43981,   0.     ,
           0.     , 638.92316, 251.00522,   0.     ,
           0.     ,   0.     ,   1.     ,   0.     ]

image_height、image_width:图片的高、宽

camera_name:摄像头名

camera_matrix:摄像头的内部参数矩阵

distortion_model:畸变模型

distortion_coefficients:畸变模型的系数

rectification_matrix:为矫正矩阵,一般为单位阵

projection_matrix:为外部世界坐标到像平面的投影矩阵

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值