[ROS2 humble] Camera Calibration

방선생·2025년 8월 10일
0

PROJECT

목록 보기
4/5

1. 패키지 설치

sudo apt update

sudo apt install \
   ros-humble-image-pipeline \
   ros-humble-camera-calibration \
   ros-humble-v4l2-camera \
   ros-humble-image-tools \
   ros-humble-image-view \
   ros-humble-rqt-image-view
    
sudo apt install ros-humble-usb-cam

2. 카메라 번호 확인

v4l2-ctl --list-devices

3. 실행

(실행전 체커보드 필요)

  • 1번 터미널
# image_size:="[640,480]" - 필요시 수정
ros2 run v4l2_camera v4l2_camera_node --ros-args   -r __ns:=/camera   -p video_device:=/dev/video2   -p image_size:="[640,480]"   -p pixel_format:=YUYV   -p camera_frame_id:=camera_optical_frame
  • 2번 터미널
ros2 topic list | grep camera
ros2 topic info /camera/image_raw
ros2 topic hz /camera/image_raw
ros2 topic echo --once /camera/image_raw.encoding
ros2 topic echo --once /camera/camera_info.header
  • 3번 터미널
ros2 run rqt_image_view rqt_image_view
  • 4번 터미널
# size 8x6 - 교차점의 개수
# square 0.024 - 한 칸의 길이
ros2 run camera_calibration cameracalibrator   --size 8x6 --square 0.024   --camera_name usb_2_0_camera   --no-service-check   --pattern chessboard   --ros-args --remap image:=/camera/image_raw --remap camera:=/camera

4. Calibration 확인

image_width: 640
image_height: 480
camera_name: usb_2_0_camera

camera_matrix:
   rows: 3
   cols: 3
   data: [674.530021, 0.0, 287.183912, 0.0, 674.653627, 242.592687, 0.0, 0.0, 1.0]
   
distortion_model: plumb_bob

distortion_coefficients:
   rows: 1
   cols: 5
   data: [-0.434607, 0.142210, -0.002016, 0.002811, 0.0]

rectification_matrix:
   rows: 3
   cols: 3
   data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
   
projection_matrix:
   rows: 3
   cols: 4
   data: [596.468225, 0.0, 279.908803, 0.0, 0.0, 634.342872, 242.347132, 0.0, 0.0, 0.0, 1.0, 0.0]




체커보드 이미지







참고자료

[ROS2 humble] Camera Calibration 실행 영상

ROS melodic - 카메라 캘리브레이션 수행하기

profile
AI & Robotics

0개의 댓글