ROS下采用camera_calibration進行雙目相機標定

Amelie_xiao發表於2020-10-30

使用ROS官方提供的 camera_calibration 包對雙目相機進行標定

更多細節可移步至官網

一、準備工作:

  1. 系統環境:Ubuntu16.04
  2. ROS版本:ros-kinetic
  3. 雙目相機:Intel RealSense D435i
  4. 標定板:7×6

二、雙目標定:

  1. 啟動雙目相機驅動:
source devel/setup.bash
roslaunch realsense2_camera rs_camera.launch
  1. 檢視影像是否釋出:
rostopic list  #列出 topic 確保相機正在通過ROS釋出影像

這會顯示所有已釋出的topic,檢查是否有雙目相機左右影像的topic。以下是本實驗的相機topic:

buu@buu-OptiPlex-7060:~$ rostopic list
/camera/accel/imu_info
/camera/accel/sample
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/extrinsics/depth_to_color
/camera/extrinsics/depth_to_infra1
/camera/extrinsics/depth_to_infra2
/camera/gyro/imu_info
/camera/gyro/sample
/camera/infra1/camera_info
/camera/infra1/image_rect_raw
/camera/infra2/camera_info
/camera/infra2/image_rect_raw
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/clicked_point
/diagnostics
/health_aggregator/error_text
/health_aggregator/fatal_text
/health_aggregator/ok_text
/health_aggregator/warn_text
/initialpose
/linear_velocity_viz
/move_base_simple/goal
/ndt_monitor/ndt_info_text
/points_raw
/rosout
/rosout_agg
/tf
/tf_static
  1. 安裝編譯image_pipeline包:
cd catkin_ws/src  
git clone https://github.com/ros-perception/image_pipeline/tree/kinetic  # 注意:要下載kinetic版本的包
cd ..  
rosdep install --from-paths src --ignore-src   # 安裝image_pipeline 所需的依賴
catkin_make
  1. 啟動標定程式:
source devel/setup.bash
rosrun camera_calibration cameracalibrator.py --approximate 0.1 --size 7x6 --square 0.025 left:=/camera/infra1/image_rect_raw right:=/camera/infra2/image_rect_raw right_camera:=/camera/right left_camera:=/camera/left --no-service-check
  1. 標定完成後,點選”SAVE"儲存標定結果,預設儲存在/tmp/calibrationdata.tar.gz路徑下。
    在這裡插入圖片描述
    在這裡插入圖片描述
    在這裡插入圖片描述

相關文章