记录一下使用ros进行单目相机标定的过程。
1. 运行usb_cam(需下载功能包,进行编译才可以使用)
roslaunch usb_cam usb_cam-test.launch
2.安装ros的标定功能包
sudo apt-get install ros-melodic-camera-calibration*
3.运行ros标定功能包
0.0375是指单个网格的大小,我的棋盘是3.75cm,/usb_cam/image_raw是订阅的图像,/usb_cam是相机的功能包名称
rosrun camera_calibration cameracalibrator.py-size 8x5 --square 0.0375 image:=/usb_cam/image_raw camera:=/usb_cam
4.标定结果:
camear matrix的含义为:813.2063是fx,810.540255是fy,312.0097是cx,246.07311是fy
distorition则分别是k1,k2,p1,p2,k3
[image]
width
640
height
480
[narrow_stereo]
camera matrix
813.206399 0.000000 312.009796
0.000000 810.540255 246.073111
0.000000 0.000000 1.000000
distortion
-0.059806 0.062233 0.002596 -0.001107 0.000000
rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
projection
806.881714 0.000000 311.474214 0.000000
0.000000 806.509705 246.689813 0.000000
0.000000 0.000000 1.000000 0.000000