Kinect2.0相机标定
尝试进行Kinect2.0相机进行标定
1. Color镜头标定
$(u_{rgb},v_{rgb},1)=W_{rgb}*(x,y,z)$
Calibration results after optimization (with uncertainties): Focal Length: fc = [ 1094.03583 1087.37528 ] +/- [ 55.02816 51.42175 ] Principal point: cc = [ 942.00992 530.35240 ] +/- [ 13.00131 31.27892 ] Skew: alpha_c = [ 0.00000 ] +/- [ 0.00000 ] => angle of pixel axes = 90.00000 +/- 0.00000 degrees Distortion: kc = [ 0.06857 -0.10542 0.00233 0.00092 0.00000 ] +/- [ 0.02206 0.02884 0.00379 0.00492 0.00000 ] Pixel error: err = [ 0.49343 0.67737 ]
2. 红外镜头标定
$(u_{ir},v_{ir},1)=W_{ir}*(x,y,z)$
Calibration results after optimization (with uncertainties): Focal Length: fc = [ 379.40726 378.54472 ] +/- [ 40.73354 34.75290 ] Principal point: cc = [ 263.73696 201.72450 ] +/- [ 9.17740 30.29723 ] Skew: alpha_c = [ 0.00000 ] +/- [ 0.00000 ] => angle of pixel axes = 90.00000 +/- 0.00000 degrees Distortion: kc = [ 0.03377 -0.04195 0.00519 0.00734 0.00000 ] +/- [ 0.07368 0.25678 0.01111 0.00965 0.00000 ] Pixel error: err = [ 0.88997 0.92779 ]
根据上面两个式子可以推导出两个图像像素之间的对应关系。先将RGB图像映射和depth同样大小。
3. 2个相机相对关系计算
前面两个相机都是以相机中心作为世界坐标系的原点。要建立两个相机之间的关系,需要构建以统一的世界坐标系。以深度相机中心为世界坐标的原点。
则RGB相机和相机原点存在如下关系
$(x_{w},y_{w},z_{w})=(x_{ir},y_{ir},z_{ir})=R*(x_{rgb},y_{rgb},z_{rgb})+T$
补充:两个相机的配准问题当前的好多博客里写的方法,根据color和Ir 的外参计算的说法很扯淡。
因为2个图像的分辨率不同,外参根本不在一个框架下。这应该是一个立体匹配的问题。
A Quantitative Comparison of Calibration Methods for RGB-D Sensors Using Different Technologies
https://github.com/rgbdemo/rgbdemo/blob/master/calibration/calibrate_kinect.cpp
工具包:
Matlab自带工具箱:
http://www.ilovematlab.cn/thread-267670-1-1.html
http://www.cnblogs.com/li-yao7758258/p/5929145.html
其他工具箱:
张正友标定法 Camera Calibration Toolbox for Matlab 这个工具箱使用standard可以,但是另外一个不读到内存的好像有bug。
http://www.vision.caltech.edu/bouguetj/calib_doc/index.html
http://blog.csdn.net/felix86/article/details/38401447
kinect 2.0 SDK学习笔记(四)--深度图与彩色图对齐
orbslam2的基础理论(一):https://blog.csdn.net/qq_18661939/article/details/51829573