全息中基于多算法融合的相位拼接方法研究 下载: 1277次
为了解决数字全息中子孔径相位拼接的效率和精度问题,提出了数字全息中基于多算法融合优化的相位拼接方法来实现相位的双方向拼接。首先,在相位拼接中选用相位相关法确定重叠区域,以限定特征点检测和提取范围,从而提升特征点检测的速率和有效特征点检测的占比;然后,对重叠区域进行Harris角点检测和角点匹配,并根据角点匹配点对来缩小块匹配算法的搜索范围;最后,采用全匹配搜索算法对最佳角点匹配点对进行精确匹配,并通过加权融合实现三维形貌的再现相位拼接。实验结果表明,本文算法能够在保证较高的拼接精度的情况下,极大地提高相位拼接的效率。
Objective In digital holography, CCD or CMOS photodetectors are used to record holograms instead of the traditional recording plate in optical holography. The holograms are reproduced through digital simulation. However, array size and the total number of pixels of CCD or CMOS photodetectors restrict the imaging field of view and quality of reconstructed images, limiting the widespread application of digital holography. The main methods to obtain a large field of view images include hologram splicing and phase splicing. The hologram-splicing method is affected by the clarity and noise of the hologram. However, phase stitching provides a method to increase the size of the detection field and improve the quality of three-dimensional (3D) images without increasing the difficulty of the experimental optical system for digital holography. In the field of digital holographic phase stitching, the conventional block-matching algorithm has the disadvantage that the splicing efficiency of block matching is significantly reduced with the increase in the size of the subaperture phase map after the phase image is stitched many times. Block matching is prone to mismatching in similar regions of the phase map. The conventional corner-detection algorithm extracts corners from the entire image with unnecessary corner detection and extraction, leading to excessive registration time consumption and affecting registration accuracy. To solve the problem of efficiency and accuracy of phase stitching of subaperture phase diagram in digital holography, a phase-stitching method based on multi-algorithm fusion optimization is proposed to realize two-way phase stitching in digital holography.
Methods In phase stitching, the phase correlation method is used to determine the overlapping area to limit the detection and extraction range of feature points, thus improving the feature point detection speed and the proportion of effective feature point detection. Harris corner detection is conducted for the overlapping area, and the pseudocorners caused by flat area, noise point, and edges are eliminated according to the phase information of the corner neighborhood. Then, the normalized cross-correlation function is applied for corner matching. Guided complementary matching and voting filtering methods are used to simultaneously eliminate mismatched corner-matching point pairs, and the corresponding best matching point pair is obtained. The search range of the small block matching algorithm is reduced according to the best corner-matching point pair. Finally, the full matching search algorithm is used to accurately match the best corner-matching point pair, and weighted fusion is adopted to realize the reconstruction and phase splicing of 3D topography.
The sub-aperture holograms of four parts of the letter “a” of glass sample plate are collected using the reflection off-axis digital holography experiment system; at least 50% overlapping area should be reserved in the adjacent holograms. Next, the diffraction of a light wave is simulated using a computer. The reconstructed image phase is analyzed using the Fresnel integral formula. The reconstructed image phase distribution is obtained using the least square phase unwrapping. Finally, Harris algorithm, scale-invariant feature transform (SIFT) algorithm, Susan algorithm, full search method, and the proposed algorithm are used to splice the phase map of each subaperture of the letter “a” of the glass template to obtain the intensity map and phase distribution map of the letter “a” of the glass template. The splicing experiment is conducted hierarchically, i.e., the transverse adjacent subaperture phase map (85 pixel×85 pixel) is horizontally spliced, and then the resultant image (115 pixel×85 pixel) is longitudinally spliced. Finally, the overall splicing phase distribution map (115 pixel×125 pixel) is obtained.
Results and Discussions The experimental results showed that there are obvious errors in the phase stitching based on the Harris algorithm; moreover, the phase splicing results based on Susan algorithm are greatly misplaced. However, the results of SIFT algorithm, full search method, and proposed algorithm are better (
Conclusions Phase stitching is an effective method to enlarge the field of view in digital holography. The phase-matching stitching technique of the Harris corner detection algorithm for each subaperture is simple. However, the splicing result has a certain error due to error accumulation. The full search method has the advantages of simple operation and high search accuracy, but it has a large calculation quantity and is prone to mismatching in similar regions. In this study, the phase splicing method based on multi-algorithm fusion optimization in digital holography is proposed by combining the Harris algorithm and full search method points, which can improve the matching efficiency and accuracy. Moreover, it provides full play to the high robustness of the Harris algorithm and does not require objects to have strong edges. It has a wide application prospect in high-resolution mosaic measurement.
1 引言
数字全息技术是用CCD或CMOS等光电探测器件来代替传统光学全息的记录干板进行全息图的记录,并将全息图传入计算机,用数字仿真的方法再现全息图[1-3]。与此同时,CCD或CMOS等光电传感器件的阵列尺寸和像素总数也限制了数字全息的成像视场及再现像的质量,影响了数字全息技术应用范围的扩展。而目前数字全息获得大视场图像的方法主要有全息图拼接和相位拼接,全息图拼接主要是获取物体不同区域的子全息图,然后利用图像拼接技术合成一幅大范围的全息图,再进行重建从而获得物体的大范围信息,但是全息图清晰度较低,且有很大的噪声影响,所以全息图拼接停滞不前[4]。相位拼接技术[5-6]——将全息图进行重建和相位解包裹之后得到物体的正确相位图像进行拼接,提供了一种在不大幅度增加数字全息实验光路系统难度的情况下,明显增加检测视场大小和提高三维图像质量的方法。
图像配准是图像拼接的核心部分,主要包括基于灰度的配准和基于特征的配准[7-9]。在传统图像拼接领域,基于灰度配准的配准精度高,但其对灰度变化较为敏感,尤其是非线性化的光照变化,将降低算法的性能,而且它的计算复杂度高,对被测对象的旋转、形变以及遮挡比较敏感;基于特征匹配可以改善上述方法的缺陷,其用于匹配的特征点远少于原图的像素点,大大减少了匹配过程的计算量,而且特征点匹配对位置变化较为敏感,对噪声的干扰、灰度的变化、图像的形变和遮挡等有较好的适应能力,但其配准效率和特征搜索精度难以同时保证[10-15]。
对数字全息的相位拼接而言,数字全息图解包裹得到的子孔径相位图像较小,无旋转、无尺度变化,且图像质量易受光路系统中噪声的影响[16-18]。在数字全息相位拼接领域中,传统块匹配算法在相位图进行多次拼接之后,块匹配的拼接效率将随着拼接相位图尺寸的增加而大幅度下降,并且块匹配在相位图相似区域极易发生误配现象;与此同时,传统角点检测算法在整幅图像提取角点,存在不必要的角点检测和提取,会导致配准耗时过大,且影响配准精度。
为了保证相位拼接的效率、精度以及拼接的成功率,本文将相位相关法[19-21]、Harris算法[22-23]和全匹配搜索(FS)算法[24]从图像拼接领域引入数字全息的相位拼接中,提出了一种数字全息中基于多算法融合优化的相位拼接方法,有效解决了灰度配准算法存在的计算时间较长、适应性较差、相似部分容易发生误配的问题,同时保证了特征匹配算法的配准效率、特征搜索精度和拼接的成功率,提高了数字全息的测量效率和测量精度,有效扩大了数字全息被测物体的测量面积。
2 基于多算法融合优化的相位拼接方法
针对传统Harris角点检测算法在整幅图像提取角点存在的问题,本文算法选用相位相关法确定各子孔径相位图的重叠区域,显著缩小了Harris角点检测的范围,提高了Harris角点检测的效率,同时避免了对无效角点的检测,进一步提升角点的配准精度。相位相关法算法简单、运行速度快、抗干扰能力强,但在利用该算法进行重叠区域计算时,需保证各子孔径相位图的重叠区域不小于50%,否则将会影响相位相关法的计算准确性[25]。
之后,使用Harris算法对相位图重叠区域进行角点检测。同时,针对Harris角点检测算法抗噪能力差、散斑噪声会导致出现伪角点的问题,本文算法再对Harris角点邻域的相位信息进行分析,剔除平坦区域、噪声点、边缘引起的伪角点[26]。
伪角点剔除后,本文算法通过归一化互相关函数(NCC) [27]进行特征点配准。以每个特征点为中心,取一个N×N 大小的相关窗口,设参考图像第i个特征点和输入图像中第j个特征点对应的窗口像素的相位值分别是I1
式中:I1 和I2为两幅图窗口内相位的平均值。
CNC的值域为[-1,1], CNC=-1表示两个相关窗口完全不相似,CNC=1表示两个窗口完全相同,当CNC值大于阈值时认为特征点匹配。但是,基于NCC匹配的方法受光照、尺度变换、噪声影响时,其匹配准确率会降低。因此,本文算法根据引导互匹配法[28]和投票过滤法剔除误配的角点匹配点对。随后,根据剔除误配点对后的各Harris角点匹配点对的CNC值,选择CNC最大值对应的匹配点对作为最佳匹配点对,并利用全匹配搜索算法对相位图进行精确匹配。
全匹配搜索算法是对每一个像素点(搜索范围内)进行匹配运算,最后找到各子孔径相位图像的平移量,是搜索精度最高的算法。全匹配搜索算法以最佳匹配点对所对应的特征点为中心,在参考图像中选取一个N×N大小的块区域作为参考模板,在输入图像中选取一个2N×2N 大小的块区域作为搜索区域,先从搜索区域的中心点出发,按照由近及远顺时针的方向,在搜索区域范围内在所有像素点的位置处利用SAD匹配准则[29-31]来计算每个像素点对应的DSA
式中:fk(s,t)和fk-1(s,t)为参考模板和匹配区域的像素,(s,t)为像素坐标,匹配块的大小为N×N,(i,j)为匹配块相对参考块的偏移量。最小DSA值对应的偏移量即对应最佳匹配块,则各子孔径相位图像的偏移量可由参考模板和最佳匹配块的初始点坐标差得到。同时,全匹配搜索算法简单、可靠,找到的匹配块必为全局最优点。匹配后根据计算出的偏移量对非重叠区域进行平移,同时采用加权平均法对重叠区域进行处理,从而得到被测物体的拼接相位分布图。
如
3 实验
3.1 实验平台
为检验本文算法,采用反射式离轴数字全息实验系统进行验证,实验光路图如
图 2. 反射式离轴数字全息实验系统。(a)实验光路图;(b)数字全息装置
Fig. 2. Reflective off-axis digital holography experimental system. (a) Experimental light path diagram; (b) digital holography setup
如
受光斑大小限制,系统无法采集到完整的被测区域。因此,通过
图 3. 各子孔径的全息图和再现相位分布图。(a)~(d)各子孔径全息图;(e)~(h)各子孔径再现相位分布图
Fig. 3. Holograms and reproduced phase distributions of each sub-aperture. (a)--(d) Holograms of each sub-aperture; (e)--(h) reproduced phase distributions of each sub-aperture
3.2 基于多算法融合优化的相位拼接实验
本实验采用层次式的拼接方式,对四幅子孔径相位图先进行x方向的横向拼接,分别获得“a”字样的上半部分和下半部分,再进行y方向的纵向拼接,获取拼接的整体相位分布图。根据数字全息干涉原理,表面尺寸与相位值存在一一对应的映射关系,由此可计算得到被测物件的表面尺寸值。
以
图 4. 纵向拼接子孔径相位分布图。(a)上半部分相位分布图;(b)下半部分相位分布图
Fig. 4. Phase distributions of sub-aperture of longitudinal splicing. (a) Upper half phase distribution; (b) lower half phase distribution
先使用相位相关法获得子孔径相位图重叠区域如
图 5. 纵向拼接重叠区域角点检测及滤波。(a)(b)子孔径相位图重叠区域;(c)(d)重叠区域Harris角点检测;(e)(f)Harris角点滤波
Fig. 5. Corner detection and filtering in overlapping area of longitudinal splicing. (a)(b) Overlapping region of sub-aperture phase diagram; (c)(d) Harris corner detection in overlapping region; (e)(f) Harris corner filtering
使用归一化互相关函数对两幅子孔径相位图像检测到的角点进行配准,配准结果如
图 6. 纵向拼接特征点配准。(a)NCC特征点配准图;(b)误配点对剔除效果图;(c)最佳匹配点对
Fig. 6. Registration of feature points of longitudinal splicing. (a) Feature point registration map of NCC algorithm; (b) result chart of mismatch point pair elimination; (c) best match point pair
匹配后根据计算出的偏移量对非重叠区域进行平移,同时采用加权平均法对重叠区域进行相位融合,得到玻璃样板上“a”字样的再现强度图和相位分布图。同时,分别使用Harris算法、尺度不变特征变换(SIFT)算法、Susan算法和全匹配搜索算法对玻璃样板上“a”字样的各个子孔径相位图进行相位拼接,得到玻璃样板上“a”字样的再现强度图和相位分布图。
图 7. 各相位拼接算法结果比较。(a)(f)Harris;(b)(g)SIFT;(c)(h)Susan;(d)(i)FS;(e)(j)本文算法
Fig. 7. Comparison of the results of each phase stitching algorithms. (a)(f) Harris; (b)(g) SIFT; (c)(h) Susan; (d)(i) FS; (e)(j) proposed algorithm
通过对比
如
此外,为了进一步比较
图 10. Prewitt算子边缘检测轮廓图。(a)Harris;(b)SIFT;(c)Susan;(d)FS;(e)本文算法;(f)影像图
Fig. 10. Prewitt operator edge detection image contour. (a) Harris; (b) SIFT; (c) Susan; (d) FS; (e) proposed algorithm; (f) image map
表 1. 各算法与影像图的轮廓相似性比较
Table 1. Comparison of structural similarity between each algorithm and image map
|
3.3 实验结果分析
匹配成功率和匹配时间可体现算法的有效性、适用性和效率。本文算法从以上两个方面与经典Harris算法、SIFT算法、Susan算法、全匹配搜索算法进行了对比,通过对50组不同的实验数据使用上述各个算法进行层次式拼接,所得拼接结果如
表 2. 各相位拼接算法的数据对比
Table 2. Data comparison of each phase splicing algorithm
|
在本实验所采用的实验拼接结果中,对测量仪测得的影像图和各拼接算法得到的拼接相位图进行轮廓比较,如
本实验采用层次式方法进行拼接,即先对横向相邻的子孔径相位图(85 pixel×85 pixel)进行横向拼接,再对横向拼接的结果图(115 pixel×85 pixel)进行纵向拼接,最终获取整体拼接相位分布图(115 pixel×125 pixel),各算法进行层次式拼接的横向拼接匹配时间和纵向拼接匹配时间如
表 3. 各相位拼接算法进行层次式拼接的匹配时间
Table 3. Matching time of each phase stitching algorithm for hierarchical splicing unit: s
|
由于纵向拼接的子孔径相位图的像素数量明显多于横向拼接所对应的子孔径相位图,分析
4 结论
相位拼接是数字全息中扩大视场的有效手段。Harris 角点检测算法对各子孔径进行的相位匹配拼接技术实现简单,但由于误差累积,拼接的结果有一定的误差;全匹配搜索算法具有简单易行、搜索精度高的优点,但其计算量较大,且相似区域容易发生误配;本文提出的数字全息中基于多算法融合优化的相位拼接方法结合了Harris算法和全匹配搜索算法各自的优点,在提高配准效率的同时保证了配准精度,又充分发挥了Harris算法的高抗鲁棒性特点,在高分辨率的拼接测量中具有较为广泛的应用前景。
除解决上述关键问题以外,由于本文算法利用Harris算法进行角点检测,故本文算法并不要求物体具备强边缘,但是要求各子孔径相位图重叠区域有Harris特征角点的存在,否则本文算法将不再适用。
[1] CordaR. Digital holography data compression[C] //2018 26th Telecommunications Forum (TELFOR), November 20-21, 2018, Belgrade, Serbia. New York: IEEE Press, 2018: 1- 4.
[2] Oh KJ, Choo HG, KimJ. Analysis on digital holographic data representation and compression[C] //2016 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA), December 13-16, 2016, Jeju, South Korea. New York: IEEE Press, 2016: 1- 4.
[4] 税云秀. 基于数字全息的三维物体轮廓融合技术研究[D]. 重庆: 重庆理工大学, 2019.
Shui YX. Research on 3D object contour fusion technology based on digital holography[D]. Chongqing: Chongqing University of Technology, 2019.
[5] 孔明, 郝玲, 刘维, 等. 数字全息中基于优化Harris角点的相位拼接算法[J]. 红外与激光工程, 2019, 48(11): 1126002.
[6] 孙佳嵩, 张玉珍, 陈钱, 等. 傅里叶叠层显微成像技术: 理论、发展和应用[J]. 光学学报, 2016, 36(10): 1011005.
[7] Liu ZY, Guo YN, FengZ, et al.Improved rectangle template matching based feature point matching algorithm[C] //2019 Chinese Control And Decision Conference (CCDC), June 3-5, 2019, Nanchang, China. New York: IEEE Press, 2019: 2275- 2280.
[8] 尧思远, 王晓明, 左帅. 基于SURF的特征点快速匹配算法[J]. 激光与红外, 2014, 44(3): 347-350.
[11] 徐晨. 基于块匹配的图像识别方法研究及应用[D]. 北京: 北方工业大学, 2015.
XuC. Research of image recognition method based on block matching and applications[D]. Beijing: North China University of Technology, 2015.
[12] ChenL, HanJ, ZhangY, et al. Real-time panoramic image mosaic via Harris corner detection on FPGA[C] //International Conference on Image and Graphics. Springer, Cham, 2015: 111- 124.
[13] 刘加林, 王慧琴, 王可, 等. 基于快速稳健特征最大子矩阵的光谱图像配准方法[J]. 激光与光电子学进展, 2019, 56(6): 063002.
[14] MaikV, ChaeE, LeeE, et al.Robust sub-pixel image registration based on combination of local phase correlation and feature analysis[C] //The 18th IEEE International Symposium on Consumer Electronics (ISCE 2014), June 22-25, 2014, JeJu Island, South Korea. New York: IEEE Press, 2014: 1- 2.
[15] 刘鹏飞, 高如新. 基于相位相关法与改进SURF算法的图像拼接方法[J]. 软件导刊, 2019, 18(11): 157-160,164.
[17] 李芹, 刘维, 王道档, 等. 基于二阶质量权的四向剪切相位解包裹算法[J]. 光电子·激光, 2018, 29(6): 618-626.
[18] Montresor S, Picart P. Quantitative appraisal for noise reduction in digital holographic phase imaging[J]. Optics Express, 2016, 24(13): 14322-14343.
[19] Wang R Y, Gao Z S, Zhu D, et al. Subaperture stitching interferometry based on the combination of the phase correlation and iterative gradient methods[J]. Applied Optics, 2020, 59(13): 4176-4182.
[20] ZhangJ, Wang CS, Liao WL. An image mosaics algorithm based on improved phase correlation[C] //2009 International Conference on Environmental Science and Information Application Technology, July 4-5, 2009, Wuhan, China. New York: IEEE Press, 2009: 383- 386.
[21] 孙步强, 静大海. 相位相关法实现视频实时拼接的应用与优化[J]. 科学技术与工程, 2012, 12(26): 6618-6621.
[22] Hong YX, Jie ZQ, Zhao DD, et al.UAV image automatic mosaic method based on matching of feature points[C] //2013 Chinese Automation Congress, November 7-8, 2013, Changsha, China. New York: IEEE Press, 2013: 33- 36.
[23] Babu V MM, SanthaT. Efficient brightness adaptive deep-sea image stitching using biorthogonal multi-wavelet transform and Harris algorithm[C] //2017 International Conference on Intelligent Computing and Control (I2C2), June 23-24, 2017, Coimbatore, India. New York: IEEE Press, 2017: 1- 5.
[24] Choudhury HA, SaikiaM. Block matching algorithms for motion estimation: a performance-based study[M]. New Delhi: Springer, 2015: 149- 160.
[25] 周美丽, 白宗文, 延小进. 基于相位相关法的图像拼接系统设计[J]. 国外电子测量技术, 2015, 34(5): 31-33.
[26] 张立亭, 黄晓浪, 鹿琳琳, 等. 基于灰度差分与模板的Harris角点检测快速算法[J]. 仪器仪表学报, 2018, 39(2): 218-224.
[27] 李浩, 秦姣华, 向旭宇, 等. 结合自适应阈值与Forstner的Harris角点匹配优化算法[J]. 电讯技术, 2018, 58(9): 1079-1085.
[28] Zhang ST, LiC, Li LQ. An improved method for eliminating false matches[C] //2017 2nd International Conference on Image, Vision and Computing (ICIVC), June 2-4, 2017, Chengdu, China. New York: IEEE Press, 2017: 133- 137.
[29] 陈宫, 牛秦洲. 图像序列运动估计中经典块匹配算法研究[J]. 计算机应用与软件, 2012, 29(5): 147-151.
[30] Feng YP, LiS, DaiM. An image matching algorithm based on sub-block coding[C] //2009 Second International Workshop on Computer Science and Engineering, October 28-30, 2009, Qingdao, China. New York: IEEE Press, 2009: 599- 603.
[32] 黄威龙, 白欣, 梁海坤, 等. 数字全息光学实验探究及再现清晰度优化[J]. 物理实验, 2019, 39(4): 44-48.
[33] 钱晓凡, 张永安, 李新宇, 等. 基于掩膜和最小二乘迭代的相位解包裹方法[J]. 光学学报, 2010, 30(2): 440-444.
[34] 张鑫, 潘锋, 伊小素, 等. 基于相位拼接的数字全息大视场成像方法研究[J]. 现代电子技术, 2013, 36(21): 96-99.
[35] 冯方, 田爱玲, 刘丙才, 等. 基于数字全息扫描成像的划痕缺陷全场三维测试[J]. 中国激光, 2020, 47(4): 0409003.
[36] 李萌阳, 曹庭分, 袁晓东, 等. 参考面误差对平面子孔径拼接的影响[J]. 中国激光, 2019, 46(12): 1204006.
[37] 张俊凯. 一种快速的旋转模板匹配算法的设计与实现[D]. 哈尔滨: 哈尔滨工业大学, 2013.
Zhang JK. Design and implementation of a novel template matching algorithm invariant to rotation[D]. Harbin: Harbin Institute of Technology, 2013.
谢中思, 郭天太, 刘维, 孔明, 王道档, 郝玲. 全息中基于多算法融合的相位拼接方法研究[J]. 中国激光, 2021, 48(7): 0709001. Zhongsi Xie, Tiantai Guo, Wei Liu, Ming Kong, Daodang Wang, Ling Hao. Phase Splicing Method Based on Multi-Algorithm Fusion in Holography[J]. Chinese Journal of Lasers, 2021, 48(7): 0709001.