-
摘要: 相对于普通灰度和彩色二维图像,深度图像可以得到物体的三维信息,使视觉识别和人机交互更加智能。国内外目前还没有低成本、公开的实时获取高质量深度图的方法。本文在对散斑图获取深度图原理研究的基础上,采取激光散斑的方式,运用块匹配的方法给出了一种大范围深度图的获取方法。首先,从原理上验证了块匹配方法的可行性;然后,分别从理论和实验两个方面对深度图的计算公式进行了推导和验证;再次,对深度图恢复过程进行了详细叙述,包括散斑图像的预处理和块匹配的过程;最后,给出了运用该块匹配方法得到的实验数据。实验结果表明,本文方法在物体距离相机50 cm左右时精度可以达到5 mm,200 cm时精度可以达到5 cm,可以满足室内大部分对象的识别要求。Abstract: Compared with the ordinary 2D gray and color images, 3D information of target can be obtained by depth image, making the visual identification and human-computer interaction more intelligent. There is no open and real-time method to obtain high quality depth image at low cost at home and abroad. In this paper, based on the principle research on obtaining the depth image by laser speckle, a way to obtain wide range of depth image is presented by laser speckle and the method of template matching. Firstly, the feasibility of the method of template matching is proved in this paper. Then, the formula of depth image is calculated and verified from both theory and experiments. After that, the process of recovering depth image is described in detail, including pretreatment of speckle image and the process of block matching. Finally, the experimental data obtained by this template matching method are given. The experimental results show that the precision can reach 5 mm when the objects is 50 cm far from the camera and 5 cm when the object is 200 cm far from the camera by using the method proposed in this paper, which can satisfy the reguirements of most indoor objects' recognition.
-
Key words:
- laser speckle /
- depth image /
- template matching /
- fast algorithm of template matching
-
表 1 深度与横向偏移量关系
Table 1. Relation of depth and crosswise offset
深度/m 横向偏移/pixel 纵向偏移/pixel 深度/m 横向偏移/pixel 纵向偏移/pixel 深度/m 横向偏移/pixel 纵向偏移/pixel 深度/m 横向偏移/pixel 纵向偏移/pixel 0.5 58.87 -0.82 0.9 5.99 0.26 1.3 -13.18 1.10 1.7 -25.17 1.16 0.6 39.22 -0.42 1.0 0 0 1.4 -16.52 1.36 1.8 -24.97 0.86 0.7 24.62 0 1.1 -3.69 0.43 1.5 -19.88 1.49 1.9 -28.23 0 0.8 14.84 0.17 1.2 -8.80 0.75 1.6 -23.89 1.68 2.0 -28.71 0.75 表 2 实际深度与计算出的深度对比
Table 2. Comparison of real depth and computed depth
实际深度/cm 测量深度/cm 实际深度/cm 测量深度/cm 实际深度/cm 测量深度/cm 实际深度/cm 测量深度/cm 50 49.5 90 88.07 130 128.48 170 172.09 60 58.27 100 100 140 140.72 180 183.23 70 69.00 110 109.09 15 149.97 190 192.00 80 79.12 120 119.97 160 161.04 200 205.94 -
[1] 王一娇.结构光深度图像获取算法研究[D].北京:清华大学,2011.WANG Y J. Algorithm of obtaining the structure optical depth image[D]. Beijing:Tsinghua University,2011.(in Chinese) [2] 朱猛,李翔宇,龙宁波,等.大视场双缝载频散斑干涉成像检测系统[J].光学精密工程,2014,22(1):13-17. doi: 10.3788/OPE.ZHU M,LI X Y,LONG Y B,et al.. Double-slit based carrier frequency speckle interferometric system with large viewing filed[J]. Opt. Precision Eng.,2014,22(1):13-17.(in Chinese) doi: 10.3788/OPE. [3] 王永红,梁恒,王硕,等.数字散斑相关方法及应用进展[J].中国光学,2013,6(4):470-480. http://www.chineseoptics.net.cn/CN/abstract/abstract8999.shtmlWANG Y H,LIANG H,WANG SH,et al.. Advance in digital speckle correlation method and its application[J]. Chinese Optics,2013,6(4):470-480.(in Chinese) http://www.chineseoptics.net.cn/CN/abstract/abstract8999.shtml [4] 王希军.纳米磁流体动态散斑干涉场的奇异场分布[J].中国光学,2015(6):919-925. http://www.chineseoptics.net.cn/CN/abstract/abstract9363.shtmlWANG X J. Singularity distribution of the dynamic specklein the nano-magnetic fluid interferometry[J]. Chinese Optics,2015(6):919-925.(in Chinese) http://www.chineseoptics.net.cn/CN/abstract/abstract9363.shtml [5] 王永红,李骏睿,孙建飞,等.散斑干涉相位条纹图的频域滤波处理[J].中国光学,2014,7(3):389-395. http://www.chineseoptics.net.cn/CN/abstract/abstract9139.shtmlWANG Y H,LI J R,SUN J F,et al.. Frequency domain filtering for phase fringe patterns of digital specklepattern interferometry[J]. Chinese Optics,2014,7(3):389-395.(in Chinese) http://www.chineseoptics.net.cn/CN/abstract/abstract9139.shtml [6] 范哲.基于Kinect的三维重建[D].西安:西安电子科技大学,2013.FAN ZH. Three dimensional reconstruction of Kinect based on[D]. Xi'an:Xi'an Electronic and Science University,2013.(in Chinese) [7] SMISEK J,JANCOSEK M,PAJDLA T. 3D with Kinect[C]. 2011 IEEE International Conference on Computer Vision Workshops(ICCV Workshops),IEEE,2011:1154-1160. [8] FREEDMAN B,SHPUNT A,MACHLINE M,et al.. Depth mapping using projected patterns:US,8493496 B2[P]. 2013-07-23. [9] GARCIA J,ZALEVSKV Z. Range mapping using speckle decorrelation:US,7433024 B2[P]. 2008-10-07. [10] SPEKTOR E,MOR Z,RAIS D. Integrated processor for 3D mapping:US,8456517[P]. 2013-06-04. [11] SHPUNT A. Optical designs for zero order reduction:EP,US,8630039[P]. 2014-01-14. [12] 樊雪松.数字散斑相关方法的研究[D].天津:天津大学,2004.FAN X S. Research on digital speckle correlation method[D]. Tianjin:Tianjin University,2004.(in Chinese) [13] 曾毅.激光散斑测量应用研究[D].重庆:重庆大学,2005.ZENG Y. Study on the application of laser speckle measurement[D].Chongqing:Chongqing University,2005.(in Chinese) [14] 李喜德.散斑检测技术及其应用[J].理化检验:物理分册,2004(5):245-251. http://www.cnki.com.cn/Article/CJFDTOTAL-LHJW200405010.htmLI X D. speckle detection technology and its application[J]. Physical and Chemical Inspection:Physical Sciences,2004(5):245-251.(in Chinese) http://www.cnki.com.cn/Article/CJFDTOTAL-LHJW200405010.htm [15] 王梦伟,黄向生,陈则西,等.基于投影散斑的实时场景深度恢复[J].计算机辅助设计与图形学学报,2014(8):1304-1313. http://www.cnki.com.cn/Article/CJFDTOTAL-JSJF201408013.htmWANG M W,HUANG X SH,CHEN Z X,et al.. Depth recovery of real time scene based on projection speckle[J]. Computer Aided Design and Graphics Journal,2014(8):1304-1313.(in Chinese) http://www.cnki.com.cn/Article/CJFDTOTAL-JSJF201408013.htm [16] 金观昌,孟利波,陈俊达,等.数字散斑相关技术进展及应用[J].实验力学,2007,21(6):689-702. http://www.cnki.com.cn/Article/CJFDTOTAL-SYLX200606002.htmJIN G CH,MENG L B,CHEN J D,et al.. Digital speckle correlation technology progress and application[J]. Experimental Mechanics,2007,21(6):689-702.(in Chinese) http://www.cnki.com.cn/Article/CJFDTOTAL-SYLX200606002.htm [17] 潘兵,吴大方,夏勇.数字图像相关方法中散斑图的质量评价研究[J].实验力学,2010(2):120-129. http://www.cnki.com.cn/Article/CJFDTOTAL-SYLX201002001.htmPAN B,WU D F,XIA Y. Study on the quality evaluation of speckle patterns in digital image correlation[J]. Experimental Mechanics,2010(2):120-129.(in Chinese) http://www.cnki.com.cn/Article/CJFDTOTAL-SYLX201002001.htm