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

1、安装usb_cam包

bash 复制代码
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

bash 复制代码
sudo apt install ros-humble-camera-calibration

3、执行标定程序

bash 复制代码
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中。

XML 复制代码
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:为外部世界坐标到像平面的投影矩阵

相关推荐
奔跑的大白啊12 小时前
多容器共享目录权限踩坑记
linux·ubuntu·共享目录·linux权限·docker 容器化部署
缘友一世1 天前
银河护卫队在steam(linux Proton GE-Proton10-34)上启动无窗口问题修复
linux·ubuntu·steam·proton
刘胡子大叔1 天前
repo 与 index:站点目录该怎么切
ubuntu·php
朝朝辞暮i1 天前
C++ 第 36 课:Action——机械臂/VLA 非常重要
开发语言·c++·算法·ros2
zhangrelay2 天前
用ROS2Lyrical实验报告册思路重做蓝桥云课ROS1实验并改进
linux·笔记·学习·ubuntu·机器人
朝朝辞暮i2 天前
C++ 第 39 章: 阶段性总复习——类、对象、构造、继承、this、指针与智能指针
开发语言·c++·算法·ros2
朝朝辞暮i2 天前
C++ 第 40 章:ROS2 Publisher + Timer + Subscriber + Callback + Executor 完整闭环
开发语言·c++·算法·ros2
朝朝辞暮i2 天前
C++ 第 38 课:线程、SingleThreadedExecutor、MultiThreadedExecutor、Callback Group
开发语言·c++·算法·ros2
小小龙学IT2 天前
ROS2 安装完全指南(Ubuntu 版):从零开始到跑通第一个节点本文
linux·运维·ubuntu
小奇不哭3 天前
ROS2 单节点,RGB-D 深度相机局部路径提取 + B 样条平滑路径 + YOLOv8 障碍物检测 + 深度测距,用于移动机器人视觉局部循迹。
python·yolov8·ros2·cv2·路径探索循迹