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

相关推荐
勤奋的凯尔森同学5 小时前
webmin配置终端显示样式,模仿UbuntuDesktop终端
linux·运维·服务器·ubuntu·webmin
月光水岸New5 小时前
Ubuntu 中建的mysql数据库使用Navicat for MySQL连接不上
数据库·mysql·ubuntu
莫忘初心丶5 小时前
在 Ubuntu 22 上使用 Gunicorn 启动 Flask 应用程序
python·ubuntu·flask·gunicorn
bugtraq202112 小时前
XiaoMi Mi5(gemini) 刷入Ubuntu Touch 16.04——安卓手机刷入Linux
linux·运维·ubuntu
大地爱14 小时前
在Ubuntu 22.04 LTS 上安装 MySQL两种方式:在线方式和离线方式
mysql·ubuntu·adb
丰色木夕15 小时前
Ubuntu+vscode+CGAL6.0库安装入门教程
ubuntu·cgal
reset20211 天前
ubuntu离线安装ollama
linux·ubuntu·ollama
m0_748248771 天前
在 Ubuntu 上安装 Nginx 的详细指南
nginx·ubuntu·postgresql
猫猫的小茶馆1 天前
【网络编程】UDP协议
linux·服务器·网络·网络协议·ubuntu·udp
AuGuSt_811 天前
在windows下安装windows+Ubuntu16.04双系统(下)
linux·ubuntu·双系统