Real time phase calculation of phase shifted structured light based on one-dimensional look-up table
-
摘要: 针对相移结构光中相位计算环节,提出了一种基于一维查找表的相位实时解码算法。首先根据相位计算公式中的反正切函数性质,得到四个象限之间的相位转化关系。基于得到的转换关系,使用线性函数将第一象限中的所有坐标点映射至某个离散整数区间中,结合该区间与线性函数提前建立相位的一维查找表。在相位计算过程中,首先利用相关信息计算一维查找表的索引,直接获取相位值,然后利用线性插值法与相位转换关系调整该相位值,得到最终的真实相位。通过实验验证了所提算法的有效性,与使用传统相位计算方法相比,本文提出的方法最快可提升3.97倍,使用线性插值后,相位精度可达
${10^{ - 8}}$ 。与传统的多项式逼近算法相比,该算法速度提升了1.29倍;与传统的一维查找表算法相比,该算法速度提升了1.22倍。Abstract: We propose a fast phase decoding algorithm based on a one-dimensional look-up table. Firstly, according to the property of the arctangent function in the phase calculation formula, the phase relationship between the four quadrants is obtained. A linear function is used to map the coordinate points in the first quadrant to a discrete integer interval, and a one-dimensional look-up table of phases is established in advance by combining the interval with the linear function. In the process of phase calculation, firstly, the index of the one-dimensional look-up table is calculated by using relevant information to directly obtain the phase value, and then the phase value is adjusted by the linear interpolation method and phase relationship to obtain the final real phase. Experiments have verified the effectiveness of the proposed algorithm. Compared with the traditional phase calculation method, the proposed method can improve the speed by 3.97 times, 1.29 times compared with the traditional polynomial approximation algorithm, and 1.20 times compared with the traditional one-dimensional look-up table algorithm. -
表 1 各算法计算复杂度
Table 1. Calculation complexity of each algorithm
method compare multiplication division addition/subtraction round Eq(19) in Ref [14] 3 7 1 5 0 Lut(8) 3 2 2 5 1 Lut(12) 2 2 1 5 1 表 2 各算法相位计算速度对比
Table 2. Comparison of phase calculation speed of each algorithm
step Eq(2) Eq(16) in Ref [14] Lut(8) Lut(12) N=3 speed 189.92 fps 585.80 fps 619.84 fps 754.83 fps improvement − 3.08× 3.26× 3.97× N=5 speed 166.13 fps 462.63 fps 493.83 fps 588.49 fps improvement − 2.78× 2.97× 3.54× N=16 speed 50.06 fps 54.08 fps 57.32 fps 59.02 fps improvement − 1.08× 1.15× 1.18× 表 3 各算法计算反正切值时间
Table 3. Calculation time of arctangent value by each algorithm
method Eq(2) Eq(19) in Ref [14] Lut(8) Lut(12) time 17.08 ns 3.20 ns 2.75 ns 2.31 ns improvement − 5.34× 6.21× 7.39× -
[1] 苏显渝, 张启灿, 陈文静. 结构光三维成像技术[J]. 中国激光, 2014, 41:0209001 doi: 10.3788/CJL201441.0209001Su Xianyu, Zhang Qican, Chen Wenjing. Three-dimensional imaging based on structured illumination[J]. Chinese Journal of Lasers, 2014, 41: 0209001 doi: 10.3788/CJL201441.0209001 [2] 丁榆德, 杨斌. 三维数字化扫描及测量技术在下颌前突畸形诊治中的应用[J]. 中国组织工程研究, 2016, 20(20):2992-2999 doi: 10.3969/j.issn.2095-4344.2016.20.015Ding Yude, Yang Bin. Application of three-dimensional scanning and measuring techniques in the diagnosis and treatment of mandibular prognathism[J]. Chinese Journal of Tissue Engineering Research, 2016, 20(20): 2992-2999 doi: 10.3969/j.issn.2095-4344.2016.20.015 [3] Sansoni G, Trebeschi M, Docchio F. State-of-the-art and applications of 3D imaging sensors in industry, cultural heritage, medicine, and criminal investigation[J]. Sensors, 2009, 9(1): 568-601. doi: 10.3390/s90100568 [4] 喻彩丽. 基于逆向工程的三维测量技术的研究[J]. 计量与测试技术, 2010, 37(7):38-39 doi: 10.3969/j.issn.1004-6941.2010.07.024Yu Caili. Research of 3D measurement based on reverse-engineering[J]. Metrology & Measurement Technique, 2010, 37(7): 38-39 doi: 10.3969/j.issn.1004-6941.2010.07.024 [5] Zuo Chao, Feng Shijie, Huang Lei, et al. Phase shifting algorithms for fringe projection profilometry: a review[J]. Optics and Lasers in Engineering, 2018, 109: 23-59. doi: 10.1016/j.optlaseng.2018.04.019 [6] 刘凯, 龙云飞, 王帅军, 等. 相位测量轮廓术中结合几何标定的非线性校正[J]. 强激光与粒子束, 2015, 27:071005 doi: 10.11884/HPLPB201527.071005Liu Kai, Long Yunfei, Wang Shuaijun, et al. Nonlinearity calibration incorporated with geometrical calibration for phase measuring profilometry[J]. High Power Laser and Particle Beams, 2015, 27: 071005 doi: 10.11884/HPLPB201527.071005 [7] 边心田, 程菊, 左芬, 等. 基于光栅预校正的三维面形测量方法[J]. 激光与光电子学进展, 2017, 54:011202Bian Xintian, Cheng Ju, Zuo Fen, et al. A method of 3D shape measurement based on alignment grating projection[J]. Laser & Optoelectronics Progress, 2017, 54: 011202 [8] Huang P S, Zhang Chengping, Chiang F P. High-speed 3-D shape measurement based on digital fringe projection[J]. Optical Engineering, 2003, 42(1): 163-168. doi: 10.1117/1.1525272 [9] Griesser A, Koninckx T P, Van Gool L. Adaptive real-time 3D acquisition and contour tracking within a multiple structured light system[C]//Proceedings of the 12th Pacific Conference on Computer Graphics and Applications. 2004: 361-370. [10] Huang P S, Zhang Song, Chiang F P. Trapezoidal phase-shifting method for three-dimensional shape measurement[J]. Optical Engineering, 2005, 44: 123601. doi: 10.1117/1.2147311 [11] Jia Peirong, Kofman J, English C E. Two-step triangular-pattern phase-shifting method for three-dimensional object-shape measurement[J]. Optical Engineering, 2007, 46: 083201. doi: 10.1117/1.2768616 [12] Liu Kai, Song Jianwen, Lau D L, et al. Reconstructing 3D point clouds in real time with look-up tables for structured light scanning along both horizontal and vertical directions[J]. Optics Letters, 2019, 44(24): 6029-6032. doi: 10.1364/OL.44.006029 [13] Liu Kai, Zhang Kangkang, Wei Jinghe, et al. Extending epipolar geometry for real-time structured light illumination[J]. Optics Letters, 2020, 45(12): 3280-3283. doi: 10.1364/OL.390212 [14] Guo Hongwei, Liu Guoqing. Approximations for the arctangent function in efficient fringe pattern analysis[J]. Optics Express, 2007, 15(6): 3053-3066. doi: 10.1364/OE.15.003053 [15] 周珺, 郭红卫. 三角函数逼近算法及其在光学条纹图像分析中的应用[J]. 光学仪器, 2013, 35(1):22-29 doi: 10.3969/j.issn.1005-5630.2013.01.005Zhou Jun, Guo Hongwei. Approximation of trigonometric function and its application in optical fringe analysis[J]. Optical Instruments, 2013, 35(1): 22-29 doi: 10.3969/j.issn.1005-5630.2013.01.005 [16] Pilato L, Fanucci L, Saponara S. Real-time and high-accuracy arctangent computation using CORDIC and fast magnitude estimation[J]. Electronics, 2017, 6: 22. doi: 10.3390/electronics6010022 [17] Torres V, Valls J. A fast and low-complexity operator for the computation of the arctangent of a complex number[J]. IEEE Transactions on Very Large Scale Integration (VLSI) Systems, 2017, 25(9): 2663-2667. doi: 10.1109/TVLSI.2017.2700519 [18] Benammar M, Alassi A, Gastli A, et al. New fast arctangent approximation algorithm for generic real-time embedded applications[J]. Sensors, 2019, 19: 5148. doi: 10.3390/s19235148 [19] Liu Kai, Wang Yongchang, Lau D L, et al. Dual-frequency pattern scheme for high-speed 3D shape measurement[J]. Optics Express, 2010, 18(5): 5229-5244. doi: 10.1364/OE.18.005229 [20] Ukil A, Shah V H, Deck B. Fast computation of arctangent functions for embedded applications: a comparative analysis[C]//Proceedings of 2011 IEEE International Symposium on Industrial Electronics. 2011: 1206-1211.