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

相关推荐
冲上云霄的Jayden17 小时前
Ubuntu 22.04 中查看指定进程 ID(PID)状态的五种方法
运维·ubuntu·ps·top·pid·htop·proc
搬砖的小码农_Sky17 小时前
如何从Windows 操作系统登录Linux(Ubuntu)操作系统
linux·windows·ubuntu·远程工作
搬砖的小码农_Sky17 小时前
如何在Linux(Ubuntu)操作系统上查看文件的MD5,SHA256等校验码
linux·运维·ubuntu
洛克大航海1 天前
虚拟机 Ubuntu 中安装 Google Chrome 浏览器
linux·chrome·ubuntu
csdn_aspnet1 天前
如何在 Ubuntu 24.04/22.04/20.04 上安装 MySQL 8.0
linux·mysql·ubuntu
北城笑笑1 天前
Server 15 ,VMware ESXi 实战指南:Ubuntu 20.04.6 版本虚拟机静态 IP 配置、分辨率固定及远程访问实践
linux·运维·ubuntu·1024程序员节
洛克大航海1 天前
Ubuntu部署集群环境(3台)
linux·ubuntu·集群搭建
小志biubiu1 天前
linux_缓冲区及简单libc库【Ubuntu】
linux·运维·服务器·c语言·学习·ubuntu·c
木法星人2 天前
Ubuntu安装nvm(无需梯子自动连接github下载安装)
ubuntu·nvm·1024程序员节
宇宙浪子2 天前
在 UOS(统信操作系统,基于 Debian/Ubuntu 体系)上编译 OpenCV 4.10.0
opencv·ubuntu·debian