我的github
posts - 3243,  comments - 42,  views - 158万

RGB camera

Bring up the OpenNI driver: 

roslaunch openni_launch openni.launch

Now follow the standard monocular camera calibration instructions. Use the following command (substituting the correct dimensions of your checkerboard): 

rosrun camera_calibration cameracalibrator.py image:=/camera/rgb/image_raw camera:=/camera/rgb --size 5x4 --square 0.0245

Don't forget to Commit your successful calibration. 

IR (depth) camera

The Kinect detects depth by using an IR camera and IR speckle projector as a pseudo-stereo pair. We will calibrate the "depth" camera by detecting checkerboards in the IR image, just as we calibrated the RGB camera. 

The speckle pattern makes it impossible to detect the checkerboard corners accurately in the IR image. The simplest solution is to cover the projector (lone opening on the far left) with one or two Post-it notes, mostly diffusing the speckles. An ideal solution is to block the projector completely and provide a separate IR light source. Good illumination sources include sunlight, halogen lamps, or incandescent lamps. 

IR

IR covered

IR with speckle pattern

IR with projector covered by Post-it note

As before, follow the monocular camera calibration instructions: 

rosrun camera_calibration cameracalibrator.py image:=/camera/ir/image_raw camera:=/camera/ir --size 5x4 --square 0.0245

The Kinect camera driver cannot stream both IR and RGB images. It will decide which of the two to stream based on the amount of subscribers, so kill nodes that subscribe to RGB images before doing the IR calibration. 

Don't forget to Commit your successful calibration. 

 

Where are the intrinsics saved?

When you click Commit, cameracalibrator.py sends the new calibration to the camera driver as a service call. The driver immediately begins publishing the updated calibration on its camera_info topic. 

openni_camera uses camera_info_manager to manage calibration parameters. By default, it saves intrinsics to $HOME/.ros/camera_info/NAME.yaml and identifies them by the device serial number: 

$ ls ~/.ros/camera_info/
depth_B00362708888047B.yaml  rgb_B00362708888047B.yaml

Whenever you bring up the OpenNI driver, it will look for a previously saved calibration. If you want to share the intrinsics among multiple users, move them somewhere public (e.g. /public/path/) and use a launch file which configures the camera info URLs: 

<launch>

 <!-- Include official launch file and specify camera_info urls -->
 <include file="$(find openni_launch)/launch/openni.launch">
   <!-- provide arguments to that launch file -->
   <arg name="rgb_camera_info_url"
        value="file:///public/path/rgb_B00362708888047B.yaml" />
   <arg name="depth_camera_info_url"
        value="file:///public/path/depth_B00362708888047B.yaml" />
 </include>

</launch>
 

Wiki: openni_launch/Tutorials/IntrinsicCalibration (last edited 2015-02-06 01:36:34 by AlexanderReimann)

http://wiki.ros.org/openni_launch/Tutorials/IntrinsicCalibration

使用ls ~/.ros/camera_info/之后,发现有7个.yaml后缀文件。使用cat ~/.ros/camera_info/1.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [370.515976248363, 0, 313.8790868840471, 0, 372.6830969227434, 231.7153990263267, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.3004104519610615, 0.07652258370676726, -0.001477826771302646, -0.001199374872901745, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [270.0549621582031, 0, 307.5854707490471, 0, 0, 317.0104064941406, 226.6749221178361, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

 2.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [366.8006737481114, 0, 313.2319307503966, 0, 369.4691705536239, 225.8932701116596, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.2955066415987022, 0.07398741879692314, 0.001109057089446478, 0.0005550013886223383, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [267.2522277832031, 0, 310.626720252556, 0, 0, 314.1973266601562, 220.8795998314854, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

3.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [367.7203842386191, 0, 312.1633776999364, 0, 369.8504643810227, 222.327969033836, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.3028043701396974, 0.08016316913146398, 0.001972259854054233, -0.0005855105383069578, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [271.3121643066406, 0, 309.4569959074397, 0, 0, 313.3587341308594, 216.6703090559513, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

4.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [374.4079261743749, 0, 312.6902058006406, 0, 377.1063870868036, 231.8591658323552, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.3010382975004438, 0.07439561116406565, -0.001492430415890119, -0.0003780448972454258, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [271.7996520996094, 0, 307.0881469125889, 0, 0, 321.7455749511719, 226.9183813513646, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

5.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [373.5111594774043, 0, 315.8084189513565, 0, 375.5234360862851, 229.6133929271384, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.2970245237058798, 0.07110293616491861, -0.0001459348712873391, -0.0009524327516462756, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [257.2185668945312, 0, 313.4603221630314, 0, 0, 259.698974609375, 229.0707409084716, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

6.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [371.5469859488027, 0, 313.7857920360233, 0, 374.1714701553096, 230.9875296271416, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.3041189203607426, 0.07966724101404286, -0.001437047423319973, -0.0007192846641734516, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [262.8392028808594, 0, 312.3786083245795, 0, 0, 265.9633483886719, 227.7569378555927, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

7.yaml

复制代码
image_width: 640
image_height: 480
camera_name: head_camera
camera_matrix:
  rows: 3
  cols: 3
  data: [371.5334862939256, 0, 315.9415386864103, 0, 374.2254744680155, 230.2973984145617, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
  rows: 1
  cols: 5
  data: [-0.3008205280473007, 0.07564784106509534, -0.0009834589984554513, -0.001248593384655783, 0]
rectification_matrix:
  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
  rows: 3
  cols: 4
  data: [259.6164855957031, 0, 313.3351599445923, 0, 0, 262.554443359375, 227.852100494405, 0, 0, 0, 1, 0]xiaoqiang@xiaoqiang-desktop:~$ 
复制代码

 

 

相机矩阵(Camera Matrix):https://blog.csdn.net/zb1165048017/article/details/71104241

posted on   XiaoNiuFeiTian  阅读(624)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示