ROS下标定RGBD相机内参和外参

测试环境如下:
系统:ubuntu14.04
ros版本: indigo
RGBD相机型号:asus xtion pro


1、深度测量原理

参考:https://wenku.baidu.com/view/3c5d90b658fb770bf78a55a0.html
通过红外发射器向固定深度( z 0 z_0 z0)平面投影,得到一幅散斑图案,将这幅散斑图案作为参考,当场景的深度改变时,散斑图案在像素平面的投影位置会发生变化,即得到散斑视差 d k d_k dk,然后利用该视差即可得到当前场景的深度 z k z_k zk,公式如下:
z k = z 0 1 + z 0 f b d k z_k=\frac {z_0}{1+\frac{z_0}{fb}d_k} zk=1+fbz0dkz0
固定参考量 z o z_o zo f f f b b b 通过标定得到,即可通过上式进行求解.


2、安装openni相机ros驱动

参考: http://wiki.ros.org/openni2_launch

This package contains launch files for using OpenNI-compliant devices in ROS. It supports the Asus Xtion, Xtion Pro, and multiple version of the Primesense 1.08 and 1.09 cameras. It does NOT support any versions of the Kinect. freenect_launch or openni_launch is the recommended package for using a Kinect with ROS

可知我们需要使用openni2的驱动,对于kinect需要使用openni驱动

sudo apt-get install ros-indigo-rgbd-launch ros-indigo-openni2-camera ros-indigo-openni2-launch

接着报错

[ INFO] [1415845653.463960586]: Device "1d27/0609@1/12" with serial number "" connected

[ INFO] [1415845653.468566285]: No matching device found.... waiting for devices. Reason: openni2_wrapper::OpenNI2Device::OpenNI2Device(const string&) @ /tmp/buildd/ros-indigo-openni2-camera-0.2.2-0trusty-20141015-0837/src/openni2_device.cpp @ 74 : Initialize failed

    Could not open "1d27/0609@1/12": Failed to open the USB device!

解决:
创建udev规则: /etc/udev/rules.d/40-libopenni2-0.rules

SUBSYSTEM=="usb", ATTR{idProduct}=="0609", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"

加载规则,执行

sudo service udev reload 
sudo service udev restart

又报错,注意提示信息 Device "1d27/0609@3/12" found ,说明已经找到该设备了,说明上一步成功了

[ INFO] [1534740129.364465286]: Initializing nodelet with 4 worker threads.
[ INFO] [1534740129.577934016]: Device "1d27/0609@3/12" found.
[ INFO] [1534740129.583657124]: No matching device found.... waiting for devices. Reason: openni2_wrapper::OpenNI2Device::OpenNI2Device(const string&) @ /tmp/binarydeb/ros-indigo-openni2-camera-0.4.0/src/openni2_device.cpp @ 75 : Device open failed
	Could not open "1d27/0609@3/12": Failed to open the USB device!

解决
重新插拔相机USB口…


3、标定深度相机内参

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

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 image检测棋盘格,堵住相机自带的红外发生器(因为它发射的是散斑,对红外图像会有影响),因此使用红外光源进行照射,日光、卤素灯或白炽灯都是常见的红外光源,注意LED光源是冷光源(比如,手机相机旁边那个闪光灯)

注意: RGBD相机不能同时输出IR图像和RGB图像

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.


4、depth相机与RGB相机外参标定

参考:Kinect_Tutorial/Tutorial/Kinect相机标定calibration.md

1)depth相机与built-in RGB相机标定
参考教程:http://wiki.ros.org/openni_launch/Tutorials/ExtrinsicCalibration

2)depth相机与external RGB相机标定
参考:http://wiki.ros.org/openni_launch/Tutorials/ExtrinsicCalibrationExternal
使用的是 camera_pose_calibration这个包

注意:external RGB相机要与depth相机的位置尽可能的近,这样重叠区域才多


<完>
@leatherwang


  • 5
    点赞
  • 34
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值