【SLAM】【ROS】摄像头标定camera calibration

第一步:先准备一张标定板

(下图中间是6x4个角点,角点请看下边实验中的彩线点。实际打印的A4纸一个格子是4cm )

第二步:知道文件夹运行位置

rostopic  list

/image_view/output
/image_view/parameter_descriptions
/image_view/parameter_updates
/rosout
/rosout_agg
/usb_cam/camera_info
/usb_cam/image_raw
/usb_cam/image_raw/compressed
/usb_cam/image_raw/compressed/parameter_descriptions
/usb_cam/image_raw/compressed/parameter_updates
/usb_cam/image_raw/compressedDepth
/usb_cam/image_raw/compressedDepth/parameter_descriptions
/usb_cam/image_raw/compressedDepth/parameter_updates
/usb_cam/image_raw/theora
/usb_cam/image_raw/theora/parameter_descriptions
/usb_cam/image_raw/theora/parameter_updates

第三步:运行标定程序

注意下面这句话,不要生搬硬套,要根据实际调整!!!

rosrun camera_calibration cameracalibrator.py --size 6x4 --square 0.04 image:=/usb_cam/image_raw camera:=/usb_cam

拿着标定板移动,它会自动识别然后标定出6*4个点,这就是刚刚为什么是6*4的原因了

大概标定出几十个后,左侧第一个CALIBRATE按钮会亮起来

点击CALIBRATE按钮,此时会变灰色图像,耐心等待,不是死机

点击SAVE,COMMIT按钮

 窗口提示1

[image]

width
640

height
480

[narrow_stereo]

camera matrix
1275.773525 0.000000 328.646812
0.000000 1350.885244 -18.289759
0.000000 0.000000 1.000000

distortion
0.444253 -0.058494 -0.131486 0.004057 0.000000

rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000

projection
1302.730957 0.000000 329.148206 0.000000
0.000000 1264.319214 -27.245782 0.000000
0.000000 0.000000 1.000000 0.000000

窗口提示2

 

[ INFO] [1571392954.109543476]: writing calibration data to /home/user/.ros/camera_info/head_camera.yaml

标定文件 

参考文献:

https://blog.csdn.net/heyijia0327/article/details/43538695

发布了394 篇原创文章 · 获赞 562 · 访问量 48万+

猜你喜欢

转载自blog.csdn.net/qq_15698613/article/details/102629065