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

相关推荐
缘友一世6 小时前
GLM5.3 CyberSec w4A16本地部署[6]:加载链路与磁盘规划
ubuntu·vllm·glm5.3 cybersec
张张123y8 小时前
2026 Agent 框架怎么选?拆 3 层底层逻辑(运行循环 / 记忆 / 工具协议)+ 一张决策表
linux·ubuntu·microsoft·langgraph·mcp·crewai·agent 框架
longerxin202011 小时前
Ubuntu 22.04 ARM64 云镜像开启 root 密钥登录(保留 ubuntu 密钥登录,禁止密码登录)
数据库·ubuntu·postgresql
skywalk816311 小时前
FreeBSD仿真环境里的Ubuntu linux系统,安装软件的时候不支持snap怎么办?
linux·运维·ubuntu·系统·freebsd
Cry丶21 小时前
ubuntu安装vsftpd
服务器·网络·ubuntu
程序员-King.1 天前
【ROS1】Noetic 开发工作流程与常用命令
c++·ubuntu·ros
承渊政道1 天前
Linux网络学习【传输层协议UDP】
linux·网络·网络协议·学习·ubuntu·udp
pirateeee1 天前
在ubuntu中通过 docker 搭建 yocto 开发环境
ubuntu·docker·eureka
缘友一世1 天前
GLM5.3 CyberSec w4A16本地部署[5]:卸载换显存的边界
ubuntu·vllm·glm5.3 cybersec
bjxiaxueliang2 天前
一文自建STUN:在Ubuntu上分步搭建STUN服务
linux·运维·ubuntu