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

相关推荐
YHHLAI16 分钟前
TypeScript 高级工具类型面试指南
ubuntu·面试·typescript
海阔天空任鸟飞~43 分钟前
rclpy
ros2
微小冷1 小时前
ROS2 URDF机器人建模初步教程
机器人·ros2·urdf·机器人建模
CS_Zero1 小时前
Ubuntu 22.04挂载新硬盘
linux·运维·ubuntu
洪流之源2 小时前
Windows 远程 Ubuntu 24.04 桌面
linux·windows·ubuntu
视觉小萌新1 天前
A1——基于AMD-48G显卡下载Gemma4模型
linux·ubuntu
MSTcheng.1 天前
【Linux】Linux学习第三弹——Linux基本指令2
linux·windows·学习·ubuntu·操作系统
苏三福2 天前
ubuntu 在文件管理系统中用sftp打开远程文件空白的问题解决
linux·运维·ubuntu
Anesthesia丶2 天前
llama-server编译部署+opencode验证记录(Ubuntu, GPU)
ubuntu·opencode·llama-server·qwen3.8-9b
Sunqk56652 天前
将开发板串口连接到Ubuntu后未找到对应的设备文件?
linux·运维·ubuntu