CN110514137A - Phase unwrapping method, device, system, computer equipment and storage medium - Google Patents
Phase unwrapping method, device, system, computer equipment and storage medium Download PDFInfo
- Publication number
- CN110514137A CN110514137A CN201910633802.9A CN201910633802A CN110514137A CN 110514137 A CN110514137 A CN 110514137A CN 201910633802 A CN201910633802 A CN 201910633802A CN 110514137 A CN110514137 A CN 110514137A
- Authority
- CN
- China
- Prior art keywords
- phase
- matrix
- threshold
- phase matrix
- unwrapped
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 239000011159 matrix material Substances 0.000 claims abstract description 210
- 238000001914 filtration Methods 0.000 claims description 12
- 238000009499 grossing Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 claims description 12
- 238000001228 spectrum Methods 0.000 claims description 8
- 239000004065 semiconductor Substances 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000004422 calculation algorithm Methods 0.000 description 16
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 230000003044 adaptive effect Effects 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000003384 imaging method Methods 0.000 description 6
- 238000007781 pre-processing Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 238000002474 experimental method Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000005259 measurement Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000005305 interferometry Methods 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000001427 coherent effect Effects 0.000 description 1
- 230000000994 depressogenic effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000000691 measurement method Methods 0.000 description 1
- 238000010587 phase diagram Methods 0.000 description 1
- 230000010363 phase shift Effects 0.000 description 1
- 238000001314 profilometry Methods 0.000 description 1
- 238000007430 reference method Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000010008 shearing Methods 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000002834 transmittance Methods 0.000 description 1
- 239000012780 transparent material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S13/00—Systems using the reflection or reradiation of radio waves, e.g. radar systems; Analogous systems using reflection or reradiation of waves whose nature or wavelength is irrelevant or unspecified
- G01S13/88—Radar or analogous systems specially adapted for specific applications
- G01S13/89—Radar or analogous systems specially adapted for specific applications for mapping or imaging
- G01S13/90—Radar or analogous systems specially adapted for specific applications for mapping or imaging using synthetic aperture techniques, e.g. synthetic aperture radar [SAR] techniques
- G01S13/9021—SAR image post-processing techniques
- G01S13/9023—SAR image post-processing techniques combined with interferometric techniques
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/24—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
- G01B11/2433—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures for measuring outlines by shadow casting
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S13/00—Systems using the reflection or reradiation of radio waves, e.g. radar systems; Analogous systems using reflection or reradiation of waves whose nature or wavelength is irrelevant or unspecified
- G01S13/88—Radar or analogous systems specially adapted for specific applications
- G01S13/89—Radar or analogous systems specially adapted for specific applications for mapping or imaging
- G01S13/90—Radar or analogous systems specially adapted for specific applications for mapping or imaging using synthetic aperture techniques, e.g. synthetic aperture radar [SAR] techniques
- G01S13/9004—SAR image acquisition techniques
- G01S13/9005—SAR image acquisition techniques with optical processing of the SAR signals
Landscapes
- Engineering & Computer Science (AREA)
- Remote Sensing (AREA)
- Radar, Positioning & Navigation (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种相位解包裹方法、装置、系统、计算机设备及存储介质,所述方法包括:获取包裹相位干涉图;确定阈值;通过阈值确定包裹相位干涉图的凹陷边界,形成翻转临界线;对包裹相位干涉图的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵;对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵;计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差;当阈值未达到预设值时,返回重新确定阈值及执行后续操作;当阈值达到预设值时,输出最小相对误差对应的阈值和第二解包裹相位矩阵;根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。本发明提高了包裹相位干涉图的真实相位还原的效率及准确性。
The invention discloses a phase unwrapping method, device, system, computer equipment and storage medium. The method includes: acquiring a wrapped phase interferogram; determining a threshold; determining the concave boundary of the wrapped phase interferogram through the threshold to form a flipping critical line ; Automatically flip and replace the concave part of the wrapped phase interferogram to obtain the first unwrapped phase matrix; filter and smooth the first unwrapped phase matrix to obtain the second unwrapped phase matrix; calculate and save the first unwrapped phase The relative error between the matrix and the second unwrapped phase matrix; when the threshold does not reach the preset value, return to re-determine the threshold and perform subsequent operations; when the threshold reaches the preset value, output the threshold corresponding to the minimum relative error and the second unwrapped Phase matrix; output the reconstructed true phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error. The invention improves the efficiency and accuracy of the real phase restoration of the wrapped phase interferogram.
Description
技术领域technical field
本发明涉及一种相位解包裹方法、装置、系统、计算机设备及存储介质,属于图像处理研究领域。The invention relates to a phase unwrapping method, device, system, computer equipment and storage medium, belonging to the field of image processing research.
背景技术Background technique
相位解包裹计算被广泛应用于干涉合成孔径雷达、基于结构光的三维测量、光学干涉测量与成像等测量方法中。在从包裹干涉图获取相位的过程中,一般要用反正切范数提取相位,致使连续的相位被截断,值域被限定在(-π,π],形成包裹相位图。故需要对包裹相位进行解包裹,将截断相位重构,以求得真实的连续相位。但实际情况下,包裹相位由于欠采样、含有噪声、局部阴影等影响因素,常会出现残差点区域,影响解包裹的精度,给解包裹增加了难度,也间接影响真实相位重构的精确度。Phase unwrapping calculation is widely used in interferometric synthetic aperture radar, three-dimensional measurement based on structured light, optical interferometry and imaging and other measurement methods. In the process of obtaining the phase from the wrapped interferogram, it is generally necessary to use the arctangent norm to extract the phase, so that the continuous phase is truncated, and the value range is limited to (-π, π], forming a wrapped phase diagram. Therefore, it is necessary to analyze the wrapped phase Perform unwrapping and reconstruct the truncated phase to obtain the real continuous phase. However, in actual situations, due to factors such as undersampling, noise, and local shadows, residual point areas often appear in the wrapped phase, which affects the accuracy of unwrapping. It increases the difficulty of unwrapping and indirectly affects the accuracy of real phase reconstruction.
现有的相位解包裹算法及方法众多,归纳起来主要有两种:路径跟踪算法和路径无关算法。其中,路径跟踪算法主要有枝切法、质量图导向法和掩膜割线法等;路径无关算法主要是寻求满足最小范数的解,如基于离散余弦变换的最小二乘法、基于快速傅里叶变换的最小二乘法等。严重欠采样和较强噪声对解包裹来说是两个难题,钱晓凡等提出了横向剪切最小二乘法(LSBLS),郭媛等提出了四向横向剪切最小二乘法(FSLBS)。这些算法可以恢复欠采样相位图,但依旧无法有效求解严重欠采样的包裹相位图。There are many existing phase unwrapping algorithms and methods, and they can be summarized into two types: path-following algorithm and path-independent algorithm. Among them, path-tracking algorithms mainly include branch-cut method, quality map-oriented method, mask secant method, etc.; path-independent algorithm mainly seeks a solution that satisfies the minimum norm, such as the least-squares method based on discrete cosine transform, the method based on fast Fourier Least squares method for leaf transformation, etc. Severe undersampling and strong noise are two problems for unwrapping. Qian Xiaofan et al. proposed the transverse shear least squares method (LSBLS), and Guo Yuan et al. proposed the four-way transverse shear least squares method (FSLBS). These algorithms can recover undersampled phase maps, but still cannot effectively solve heavily undersampled wrapped phase maps.
近年来,自适应阈值在图像分割、去噪、去雾、相位转换等方面应用广泛。国外学者Eser Sert等人基于结构光系统提出自适应阈值相位转换三级校准算法进行三维物体测量。在图像处理方面,有研究者提出基于自适应阈值移除背景的边缘投影轮廓测定法,也有将自适应阈值用于细胞图像处理及图像去噪声等。目前,自适应阈值在图像解包裹方面还没有广泛的应用。In recent years, adaptive thresholding has been widely used in image segmentation, denoising, dehazing, phase transformation, etc. Foreign scholars Eser Sert and others proposed an adaptive threshold phase conversion three-level calibration algorithm based on the structured light system for three-dimensional object measurement. In terms of image processing, some researchers proposed an edge projection profilometry method based on adaptive threshold removal for background, and some researchers also used adaptive threshold for cell image processing and image denoising. Currently, adaptive thresholding is not widely used for image unwrapping.
发明内容Contents of the invention
有鉴于此,本发明提供了一种相位解包裹方法、装置、系统、计算机设备及存储介质,其相位解包裹的精度高,提高了包裹相位干涉图的真实相位还原的效率及准确性,解决了现有相位解包裹算法存在的问题。In view of this, the present invention provides a phase unwrapping method, device, system, computer equipment and storage medium, which has high precision of phase unwrapping, improves the efficiency and accuracy of the real phase restoration of the wrapped phase interferogram, and solves the problem of The problems existing in the existing phase unwrapping algorithm are solved.
本发明的第一个目的在于提供一种相位解包裹方法。The first object of the present invention is to provide a phase unwrapping method.
本发明的第二个目的在于提供一种相位解包裹装置。The second object of the present invention is to provide a phase unwrapping device.
本发明的第三个目的在于提供一种相位解包裹系统。The third object of the present invention is to provide a phase unwrapping system.
本发明的第四个目的在于提供一种计算机设备。A fourth object of the present invention is to provide a computer device.
本发明的第五个目的在于提供一种存储介质。A fifth object of the present invention is to provide a storage medium.
本发明的第一个目的可以通过采取如下技术方案达到:First purpose of the present invention can be achieved by taking the following technical solutions:
一种相位解包裹方法,所述方法包括:A phase unwrapping method, the method comprising:
获取包裹相位干涉图;Obtain the package phase interferogram;
确定阈值;determine the threshold;
通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线;Determine the concave boundary wrapping the phase matrix through the threshold to form a flipping critical line;
对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵;automatically flipping and replacing the concave part of the wrapped phase matrix to obtain the first unwrapped phase matrix;
对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵;Filtering and smoothing the first unwrapped phase matrix to obtain a second unwrapped phase matrix;
计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差;calculating and saving the relative error between the first unwrapped phase matrix and the second unwrapped phase matrix;
当阈值未达到预设值时,返回重新确定阈值,并执行后续操作;When the threshold does not reach the preset value, return to re-determine the threshold and perform subsequent operations;
当阈值达到预设值时,输出最小相对误差对应的阈值和第二解包裹相位矩阵;When the threshold reaches a preset value, output the threshold corresponding to the minimum relative error and the second unwrapped phase matrix;
根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。Output the reconstructed real phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error.
进一步的,所述阈值为0.9与1之间的数值,其中0.9是第一个阈值,1是最后一个阈值;所述重新确定阈值是指将当前阈值加上0.01;所述预设值为1。Further, the threshold is a value between 0.9 and 1, wherein 0.9 is the first threshold and 1 is the last threshold; the re-determining the threshold means adding 0.01 to the current threshold; the preset value is 1 .
进一步的,所述通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线,具体包括:Further, the determination of the concave boundary wrapping the phase matrix through the threshold to form the flipping critical line specifically includes:
将阈值W作为获取包裹相位矩阵的凹陷边界的依据,提取包裹相位矩阵中相位值大于W*phi(max)的像素,并将该像素区域设置为1,其中phi(max)为输入相位矩阵的相位最大值,即设置为1的像素区域为凹陷部分,而其余像素设置为0。The threshold W is used as the basis for obtaining the concave boundary of the wrapping phase matrix, and the pixels whose phase value is greater than W*phi(max) in the wrapping phase matrix are extracted, and the pixel area is set to 1, where phi(max) is the input phase matrix The maximum value of the phase, that is, the pixel area set to 1 is the concave part, and the rest of the pixels are set to 0.
进一步的,所述对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵,具体包括:Further, the automatic flip replacement is performed on the concave part of the wrapped phase matrix to obtain the first unwrapped phase matrix, which specifically includes:
对包裹相位矩阵的凹陷部分进行翻转,将翻转后得到的凹陷矩阵替换包裹相位矩阵中凹陷处的位置,得到新的相位矩阵;Flip the concave part of the wrapped phase matrix, and replace the concave position of the wrapped phase matrix with the flipped concave matrix to obtain a new phase matrix;
当凹陷矩阵为非零矩阵时,对该凹陷矩阵进行翻转,将翻转后得到的凹陷矩阵替换当前相位矩阵中凹陷处的位置,得到新的相位矩阵;When the notch matrix is a non-zero matrix, the notch matrix is flipped, and the notch matrix obtained after the flip is replaced by the position of the notch in the current phase matrix to obtain a new phase matrix;
当凹陷矩阵为零矩阵时,将当前相位矩阵作为第一解包裹相位矩阵,并进行输出。When the concave matrix is a zero matrix, the current phase matrix is used as the first unwrapped phase matrix and output.
进一步的,所述获取包裹相位干涉图之后,还包括:Further, after the acquisition of the wrapped phase interferogram, it also includes:
对包裹相位干涉图进行预处理,实际过程中有需要时可将反余弦包裹相位干涉图转化为反正切包裹相位干涉图。The wrapping phase interferogram is preprocessed, and the arccosine wrapping phase interferogram can be converted into an arctangent wrapping phase interferogram when necessary in the actual process.
本发明的第二个目的可以通过采取如下技术方案达到:The second purpose of the present invention can be achieved by taking the following technical solutions:
一种相位解包裹装置,所述装置包括:A phase unwrapping device, said device comprising:
获取模块,用于获取包裹相位干涉图;The acquisition module is used to acquire the package phase interferogram;
第一确定模块,用于确定阈值;a first determining module, configured to determine a threshold;
第二确定模块,用于通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线;The second determination module is used to determine the concave boundary wrapping the phase matrix through a threshold to form a flipping critical line;
翻转替换模块,用于对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵;Flip replacement module, for automatically flipping and replacing the concave part of the wrapped phase matrix, to obtain the first unwrapped phase matrix;
处理模块,用于对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵;A processing module, configured to filter and smooth the first unwrapped phase matrix to obtain a second unwrapped phase matrix;
计算模块,用于计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差;A calculation module, used to calculate and save the relative error between the first unwrapped phase matrix and the second unwrapped phase matrix;
返回模块,用于当阈值未达到预设值时,返回重新确定阈值,并执行后续操作;A return module, used to return to re-determine the threshold and perform subsequent operations when the threshold does not reach the preset value;
第一输出模块,用于当阈值达到预设值时,输出最小相对误差对应的阈值和第二解包裹相位矩阵;The first output module is configured to output the threshold corresponding to the minimum relative error and the second unwrapped phase matrix when the threshold reaches a preset value;
第二输出模块,用于根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。The second output module is configured to output the reconstructed true phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error.
进一步的,所述翻转替换模块,具体包括:Further, the flip replacement module specifically includes:
第一翻转替换单元,用于对包裹相位矩阵的凹陷部分进行翻转,将翻转后得到的凹陷矩阵替换包裹相位矩阵中凹陷处的位置,得到新的相位矩阵;The first flip replacement unit is used to flip the concave part of the wrapped phase matrix, and replace the flipped concave matrix with the position of the concave in the wrapped phase matrix to obtain a new phase matrix;
第二翻转替换单元,用于当凹陷矩阵为非零矩阵时,对该凹陷矩阵进行翻转,将翻转后得到的凹陷矩阵替换当前相位矩阵中凹陷处的位置,得到新的相位矩阵;The second flip replacement unit is used to flip the concave matrix when the concave matrix is a non-zero matrix, and replace the concave matrix obtained after the flip with the position of the concave in the current phase matrix to obtain a new phase matrix;
输出单元,用于当凹陷矩阵为零矩阵时,将当前相位矩阵作为第一解包裹相位矩阵,并进行输出。The output unit is configured to use the current phase matrix as the first unwrapped phase matrix and output when the notch matrix is a zero matrix.
进一步的,所述获取模块之后,还包括:Further, after the acquisition module, it also includes:
预处理模块,用于对包裹相位干涉图进行预处理,实际过程中有需要时可将反余弦包裹相位干涉图转化为反正切包裹相位干涉图。The preprocessing module is used to preprocess the wrapped phase interferogram, and convert the arccosine wrapped phase interferogram into an arctangent wrapped phase interferogram when necessary in the actual process.
本发明的第三个目的可以通过采取如下技术方案达到:The third purpose of the present invention can be achieved by taking the following technical solutions:
一种相位解包裹系统,所述系统包括依次相连的半导体激光器、可调衰减器、扩束镜、针孔滤波器、第一准直透镜、第二准直透镜、相板、第三准直透镜、摄像机和计算机,所述第一准直透镜与第二准直透镜之间放置目标物体,所述目标物体位于第二准直透镜的前焦面处,所述相板位于第二准直透镜的后焦面处,所述摄像机位于第三准直透镜的后焦面处;A phase unwrapping system, the system includes sequentially connected semiconductor lasers, adjustable attenuators, beam expanders, pinhole filters, first collimator lens, second collimator lens, phase plate, third collimator lens, video camera and computer, a target object is placed between the first collimator lens and the second collimator lens, the target object is located at the front focal plane of the second collimator lens, and the phase plate is located at the second collimator lens At the back focal plane of the lens, the camera is located at the back focal plane of the third collimating lens;
所述半导体激光器发出的激光光束依次通过衰减器、扩束镜、针孔滤波器、第一准直透镜后形成平面光波,以照射目标物体;在第二准直透镜的后焦面上获得物光波的频谱,相板使相位调制区域对准物光波频谱的零频区域,通过零频区域的光波与通过零频区域外的光波经历了不同的相位调制,在第三准直透镜的后焦面上产生包裹相位干涉图,由摄像机对包裹相位干涉图进行采集,并输入计算机;The laser beam emitted by the semiconductor laser passes through the attenuator, the beam expander, the pinhole filter, and the first collimator lens in order to form a plane light wave to irradiate the target object; the object is obtained on the back focal plane of the second collimator lens The spectrum of the light wave, the phase plate makes the phase modulation area aligned with the zero frequency area of the object light wave spectrum, the light wave passing through the zero frequency area and the light wave passing outside the zero frequency area have undergone different phase modulations, at the back focus of the third collimating lens The package phase interferogram is generated on the surface, and the camera collects the package phase interferogram and inputs it into the computer;
所述计算机,用于执行上述的相位解包裹方法。The computer is configured to execute the above phase unwrapping method.
本发明的第四个目的可以通过采取如下技术方案达到:The fourth purpose of the present invention can be achieved by taking the following technical solutions:
一种计算机设备,包括处理器以及用于存储处理器可执行程序的存储器,所述处理器执行存储器存储的程序时,实现上述的相位解包裹方法。A computer device includes a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the above phase unwrapping method is realized.
本发明的第五个目的可以通过采取如下技术方案达到:The fifth purpose of the present invention can be achieved by taking the following technical solutions:
一种存储介质,存储有程序,所述程序被处理器执行时,实现上述的相位解包裹方法。A storage medium stores a program, and when the program is executed by a processor, the above phase unwrapping method is realized.
本发明相对于现有技术具有如下的有益效果:Compared with the prior art, the present invention has the following beneficial effects:
1、本发明在获取包裹相位干涉图后,确定阈值,通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线,对包裹相位矩阵的凹陷部分进行自动翻转替换,将自动翻转替换后的相位矩阵进行滤波平滑处理,计算并保存滤波平滑处理前后两个相位矩阵的相对误差,重新确定阈值,执行确定阈值的后续操作,直到阈值达到预设值时,才终止循环,此时通过比较每次确定阈值保存的相对误差,得到最小相对误差,输出最小相对误差对应的阈值和滤波平滑处理后的相位矩阵,在相位解包裹中采用相位翻转恢复相位的方法,最大的优点是利用阈值确定翻转临界线,能够以最小的相对误差求解出完整的真实相位,从而提高了相位解包裹的精度,并且通过自动寻找阈值的方式,能有效避免手动设置阈值,提供正确阈值选择,提高了相位还原的效率及准确性。1. After obtaining the wrapped phase interferogram, the present invention determines the threshold, determines the concave boundary of the wrapped phase matrix through the threshold, forms a flip critical line, automatically flips and replaces the concave part of the wrapped phase matrix, and automatically flips and replaces the phase matrix Perform filtering and smoothing processing, calculate and save the relative error of the two phase matrices before and after the filtering and smoothing processing, re-determine the threshold, perform subsequent operations for determining the threshold, and terminate the loop until the threshold reaches the preset value. At this time, determine by comparing each time The relative error saved by the threshold, the minimum relative error is obtained, and the threshold corresponding to the minimum relative error and the phase matrix after filtering and smoothing are output. In the phase unwrapping, the method of phase inversion and recovery phase is adopted. The biggest advantage is to use the threshold to determine the critical line of inversion , can solve the complete real phase with the smallest relative error, thereby improving the accuracy of phase unwrapping, and by automatically finding the threshold, it can effectively avoid setting the threshold manually, provide the correct threshold selection, and improve the efficiency of phase restoration and accuracy.
2、本发明采用了自动翻转算法对包裹相位矩阵的凹陷部分进行处理,对包裹相位矩阵的凹陷部分进行翻转,将翻转后得到的凹陷矩阵替换包裹相位矩阵中凹陷处的位置,得到新的相位矩阵,此时会对凹陷矩阵进行判断,若凹陷矩阵为非零矩阵,对该凹陷矩阵进行翻转,将翻转后得到的凹陷矩阵替换当前相位矩阵中凹陷处的位置,得到新的相位矩阵,直到凹陷矩阵为零矩阵时,才终止循环,通过自动翻转替换的方式,使得解包裹相位矩阵中找不到凹陷。2. The present invention uses an automatic flip algorithm to process the concave part of the wrapped phase matrix, flips the concave part of the wrapped phase matrix, and replaces the position of the concave part in the wrapped phase matrix with the flipped concave matrix to obtain a new phase At this time, the concave matrix will be judged. If the concave matrix is a non-zero matrix, the concave matrix will be flipped, and the flipped concave matrix will replace the position of the concave in the current phase matrix to obtain a new phase matrix. Until The loop is terminated only when the sag matrix is a zero matrix, and no sag can be found in the unwrapped phase matrix by means of automatic flip replacement.
3、本发明能在较强噪声情况下准确地恢复真实相位,具有一定的抗噪性能,解决了噪声会影响解包裹的精度的问题。3. The present invention can accurately restore the real phase in the case of strong noise, has certain anti-noise performance, and solves the problem that noise will affect the accuracy of unwrapping.
4、本发明得到的重构相位与真实相位的误差较小,能对网格尺寸较大的包裹相位干涉图(如1501×1501)实现相位解包裹,提高了相位解包裹的精度,为高精度、大计算量的解包裹提供了新的参考方法。4. The error between the reconstructed phase obtained by the present invention and the real phase is small, and the phase unwrapping can be realized for the wrapped phase interferogram with a larger grid size (such as 1501×1501), which improves the accuracy of the phase unwrapped, and is high Accurate, computationally intensive unwrapping provides a new reference method.
5、本发明适合于包裹周期为π、2π、3π等的各种包裹相位干涉图的解包裹,应用范围及领域广泛。5. The present invention is suitable for unwrapping various wrapping phase interferograms with wrapping periods of π, 2π, 3π, etc., and has a wide range of applications and fields.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to the structures shown in these drawings without creative effort.
图1为本发明实施例1的相位解包裹系统的光路图。FIG. 1 is an optical path diagram of a phase unwrapping system according to Embodiment 1 of the present invention.
图2为本发明实施例1的本底光强图。FIG. 2 is a background light intensity diagram of Example 1 of the present invention.
图3为本发明实施例1的包裹相位干涉图。Fig. 3 is a wrapping phase interferogram of Embodiment 1 of the present invention.
图4为本发明实施例1的相位解包裹方法的思路流程图。FIG. 4 is a flow chart of a phase unwrapping method according to Embodiment 1 of the present invention.
图5为本发明实施例1的相位解包裹方法的完整流程图。FIG. 5 is a complete flowchart of the phase unwrapping method according to Embodiment 1 of the present invention.
图6为本发明实施例1的自动翻转替换算法的流程图。FIG. 6 is a flowchart of an automatic flip replacement algorithm according to Embodiment 1 of the present invention.
图7为本发明实施例1的采用自适应阈值翻转算法进行解包裹得到的真实相位分布图。FIG. 7 is a real phase distribution diagram obtained by unwrapping using an adaptive threshold flipping algorithm according to Embodiment 1 of the present invention.
图8为采用现有的横向剪切最小二乘法解进行解包裹得到的真实相位分布图。Fig. 8 is a real phase distribution diagram obtained by unwrapping using the existing transverse shearing least squares method solution.
图9为本发明实施例3的相位解包裹装置的结构框图。Fig. 9 is a structural block diagram of a phase unwrapping device according to Embodiment 3 of the present invention.
图10为本发明实施例3的翻转替换模块的结构框图。Fig. 10 is a structural block diagram of a flip replacement module according to Embodiment 3 of the present invention.
图11为本发明实施例4的计算机设备的结构框图。Fig. 11 is a structural block diagram of a computer device according to Embodiment 4 of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative work belong to the protection of the present invention. scope.
实施例1:Example 1:
相衬法是常见的定量相位分布成像方法,在透明生物医学细胞显微成像、透明材料或微透镜检测、干涉计量,流场密度分布测量等领域有广泛应用。在全场的相衬法真实相位分布重构中,常常涉及相位的解包裹过程。Phase contrast method is a common quantitative phase distribution imaging method, which is widely used in transparent biomedical cell microscopic imaging, transparent material or microlens detection, interferometry, flow field density distribution measurement and other fields. The phase unwrapping process is often involved in the reconstruction of real phase distribution by phase contrast method in the whole field.
设目标物体的样品为纯相位型透明物体,简称相位物体,振幅为A的平行光正入射到物平面上,则物光场的复振幅可表示为:Suppose the sample of the target object is a pure phase transparent object, referred to as a phase object, and the parallel light with amplitude A is incident on the object plane, then the complex amplitude of the object light field can be expressed as:
若忽略相干光学系统有限孔径的影响,其频谱为:If the influence of the finite aperture of the coherent optical system is ignored, its spectrum is:
如果在频谱面上加泽尼克相板,其空间滤波函数为:If a Zernike phase plate is added to the spectrum surface, its spatial filtering function is:
其中,t及分别为相板的振幅透过率与相移量。加相板后,像面的光强分布数学表达式可写为:Among them, t and are the amplitude transmittance and phase shift of the phase plate, respectively. After adding the phase plate, the mathematical expression of the light intensity distribution on the image plane can be written as:
要求解出相位分布还需要知道不放置样品和相板时,像面本底光强度I0的大小。考虑到对实际样品成像时,多次移动相板会增加许多无谓的工作量,因此在不移动相板的情况下,直接移开样品或让样品中不含物体信息的区域光场通过。此时,像面本底光强度可表示为:To solve for the phase distribution It is also necessary to know the size of the background light intensity I 0 of the image plane when the sample and the phase plate are not placed. Considering that when imaging the actual sample, moving the phase plate multiple times will add a lot of unnecessary workload, so without moving the phase plate, directly remove the sample or let the light field pass through the area of the sample that does not contain object information. At this time, the background light intensity of the image plane can be expressed as:
I0=A2t2;I 0 =A 2 t 2 ;
由I(x,y)和I0可计算出被测样品的相位主值分布为:From I(x, y) and I 0 , the phase principal value distribution of the tested sample can be calculated as:
其中,根据上式可以唯一确定0~π范围内的相位值。因此,当被测物体相位变化较小时,即其相位分布变化范围在π以内时,的值能直接反映物体的真实相位分布;如果物体相位超过不,通过拍摄两幅相衬图像,即本底光强图I0及包裹相位干涉图I(x,y),由于相位被包裹,不能直接求解,就需要利用上述反余弦关系,通过解包裹才能重构被测相位物体的真实相位分布。in, According to the above formula, the phase value in the range of 0 to π can be uniquely determined. Therefore, when the phase change of the measured object is small, that is, when the change range of its phase distribution is within π, The value of can directly reflect the real phase distribution of the object; if the phase of the object exceeds no, by taking two phase-contrast images, that is, the background light intensity map I 0 and the wrapped phase interferogram I(x, y), since the phase is wrapped, If it cannot be solved directly, it is necessary to use the above arccosine relationship to reconstruct the real phase distribution of the measured phase object through unwrapping.
图1为本实施例的相位解包裹系统的光路图,该系统包括依次相连的半导体激光器101、可调衰减器102、扩束镜103、针孔滤波器104、第一准直透镜105、第二准直透镜106、相板107、第三准直透镜108、摄像机109和计算机110,可以对相衬法进行实验,摄像机109可以采用CCD摄像机,通过该摄像机109可以获取样品111的包裹相位干涉图,如果样品111的相位分布超过π,就需要解包裹算法处理,才能得到样品的真实相位分布或成像,实验中选取的样品111是微透镜阵列组,其中单个微透镜球面的实际标准最大厚度大约为3.52μm,用波长为635nm的激光光束照射该微透镜阵列时,其球面顶部到底部的最大相位差约为15.88rad(5.055π);相板107采用振幅透过率t为0.3及相移量为1.1π的自制相板,采用该相板107进行实验,通过微调支架严格放置于成像透镜的频谱面(焦平面)上。Fig. 1 is the optical path diagram of the phase unwrapping system of the present embodiment, and this system comprises semiconductor laser 101, adjustable attenuator 102, beam expander mirror 103, pinhole filter 104, the first collimating lens 105, the first connected successively. Two collimating lens 106, phase plate 107, the 3rd collimating lens 108, video camera 109 and computer 110 can carry out experiment to phase contrast method, video camera 109 can adopt CCD video camera, can obtain the parcel phase interference of sample 111 by this video camera 109 As shown in the figure, if the phase distribution of sample 111 exceeds π, unwrapping algorithm processing is required to obtain the real phase distribution or imaging of the sample. The sample 111 selected in the experiment is a microlens array group, and the actual standard maximum thickness of a single microlens spherical surface It is about 3.52 μm, and when the laser beam with a wavelength of 635nm irradiates the microlens array, the maximum phase difference from the top to the bottom of the spherical surface is about 15.88rad (5.055π); displacement A self-made phase plate with a value of 1.1π is used for experiments, and the phase plate 107 is strictly placed on the spectral plane (focal plane) of the imaging lens by fine-tuning the bracket.
利用相位解包裹系统获取本底光强图及包裹相位干涉图的实验包括以下步骤:The experiment of using the phase unwrapping system to obtain the background light intensity map and the wrapped phase interferogram includes the following steps:
1)使从半导体激光器101发出的激光光束依次通过可调衰减器102、扩束镜103、针孔滤波器104和第一准直透镜105后,形成平面光波,以照射样品111;其中,半导体激光器101发出的激光光束波长为635nm,第一准直透镜105的焦距为150mm。1) After the laser beam emitted from the semiconductor laser 101 passes through the adjustable attenuator 102, the beam expander 103, the pinhole filter 104 and the first collimating lens 105 in sequence, a plane light wave is formed to irradiate the sample 111; wherein, the semiconductor The wavelength of the laser beam emitted by the laser 101 is 635nm, and the focal length of the first collimating lens 105 is 150mm.
2)调节第二准直透镜106的位置,使样品111位于第二准直透镜106的前焦面处,在第二准直透镜106的后焦面上获得物光波的频谱;其中,第二准直透镜106的焦距为180mm。2) adjust the position of the second collimating lens 106 so that the sample 111 is positioned at the front focal plane of the second collimating lens 106, and obtain the spectrum of the object light wave on the back focal plane of the second collimating lens 106; wherein, the second The focal length of the collimator lens 106 is 180mm.
3)相板107位于第二准直透镜106的后焦面处,调节相板107的位置,使相板107的相位调制区域对准物光波频谱的零频区域,通过零频区域(零频分量)的光波与通过零频区域外的光波(高频分量)经历了不同的相位调制,在第三准直透镜108的后焦面上产生包裹相位干涉图;其中,第三准直透镜108的焦距为180mm。3) The phase plate 107 is located at the back focal plane of the second collimator lens 106, adjust the position of the phase plate 107, so that the phase modulation area of the phase plate 107 is aligned with the zero frequency area of the object light wave spectrum, and passes through the zero frequency area (zero frequency component) and the light wave (high-frequency component) passing through the zero-frequency region has undergone different phase modulations, and a wrapping phase interference pattern is generated on the back focal plane of the third collimating lens 108; wherein, the third collimating lens 108 The focal length is 180mm.
3)摄像机109位于第三准直透镜的后焦面处,由摄像机109对本底光强图及包裹相位干涉图进行采集,其可以通过数据线将采集的图像输入计算机110,也可以通过无线传输的方式将采集的图像输入计算机110,图2为含噪声的本底光强图,图3为含噪声的包裹相位干涉图。3) The camera 109 is located at the back focal plane of the third collimating lens, and the background light intensity map and the package phase interference map are collected by the camera 109, and the collected image can be input into the computer 110 through a data line, or can be transmitted wirelessly The acquired image is input into the computer 110 in a manner, FIG. 2 is a noise-containing background light intensity map, and FIG. 3 is a noise-containing wrapped phase interferogram.
如图4和图5所示,本实施例还提供了一种相位解包裹方法,该方法采用了自适应阈值翻转算法(SATR)进行解包裹,其应用于计算机110中,包括以下步骤:As shown in Fig. 4 and Fig. 5, the present embodiment also provides a kind of phase unwrapping method, and this method adopts the self-adaptive threshold flipping algorithm (SATR) to unwrap, and it is applied in the computer 110, comprises the following steps:
S501、获取包裹相位干涉图。S501. Obtain a package phase interferogram.
摄像机109采集本底光强图及包裹相位干涉图,并输入计算机110,计算机110获取包裹相位干涉图,通过后续步骤对包裹相位干涉图进行解包裹。The camera 109 collects the background light intensity map and the wrapped phase interferogram, and inputs them into the computer 110. The computer 110 obtains the wrapped phase interferogram, and unwraps the wrapped phase interferogram through subsequent steps.
S502、对包裹相位干涉图进行预处理。S502. Perform preprocessing on the wrapped phase interferogram.
对包裹相位干涉图进行预处理,实际过程中有需要时可将反余弦包裹相位干涉图转化为反正切包裹相位干涉图。The wrapping phase interferogram is preprocessed, and the arccosine wrapping phase interferogram can be converted into an arctangent wrapping phase interferogram when necessary in the actual process.
S503、确定阈值。S503. Determine a threshold.
具体地,将阈值记为W,0.9≤W≤1,本实施例第一次确定的阈值为0.9。Specifically, the threshold is recorded as W, 0.9≤W≤1, and the threshold determined for the first time in this embodiment is 0.9.
S504、通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线。S504. Determine a concave boundary wrapping the phase matrix by using a threshold to form a flipping critical line.
具体地,将阈值W作为获取包裹相位矩阵的凹陷边界的依据,提取包裹相位矩阵中相位值大于W*phi(max)的像素,并将该像素区域设置为1,其中phi(max)为输入相位矩阵的相位最大值,即设置为1的像素区域为凹陷部分,而其余像素设置为0,形成只有凹陷边界值为1的“墙壁”,该“墙壁”即为翻转临界线后续进行自动翻转的边界线,将包裹相位矩阵记为phi00,实现代码如下:Specifically, the threshold W is used as the basis for obtaining the concave boundary of the wrapped phase matrix, and the pixels with a phase value greater than W*phi(max) in the wrapped phase matrix are extracted, and the pixel area is set to 1, where phi(max) is the input The maximum value of the phase of the phase matrix, that is, the pixel area set to 1 is the concave part, while the rest of the pixels are set to 0, forming a "wall" with only the concave boundary value of 1, which is the flip critical line for subsequent automatic flip The boundary line of , and record the wrapped phase matrix as phi00, the implementation code is as follows:
S505、对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵。S505. Automatically flip and replace the concave part of the wrapped phase matrix to obtain a first unwrapped phase matrix.
该步骤S505的实现采用了自动翻转替换算法,如图6所示,具体包括:The realization of this step S505 adopts the automatic flip replacement algorithm, as shown in Figure 6, specifically includes:
S5051、对包裹相位矩阵的凹陷部分进行翻转,将翻转后得到的凹陷矩阵替换包裹相位矩阵中凹陷处的位置,得到新的相位矩阵。S5051. Flip the concave part of the wrapped phase matrix, and replace the position of the concave part in the wrapped phase matrix with the flipped concave matrix to obtain a new phase matrix.
S5052、对凹陷矩阵进行判断。S5052, judge the concave matrix.
若凹陷矩阵为非零矩阵,则进入步骤S5053,若凹陷矩阵为零矩阵,则进入步骤S5054。If the concave matrix is a non-zero matrix, go to step S5053, and if the concave matrix is a zero matrix, go to step S5054.
S5053、对该凹陷矩阵进行翻转,将翻转后得到的凹陷矩阵替换当前相位矩阵中凹陷处的位置,得到新的相位矩阵;S5053. Flip the concave matrix, and replace the concave position in the current phase matrix with the flipped concave matrix to obtain a new phase matrix;
在本步骤执行完成后,返回步骤S5052,直到在步骤S5052中判断凹陷矩阵为零矩阵时,才终止循环进入步骤S5054。After the execution of this step is completed, return to step S5052, until it is judged in step S5052 that the concave matrix is a zero matrix, then the loop is terminated and the process enters step S5054.
S5054、将当前相位矩阵作为第一解包裹相位矩阵,并进行输出。S5054. Use the current phase matrix as the first unwrapped phase matrix, and output it.
该步骤S505中的相位矩阵均记为phi00,翻转的对称轴在第一次为π,第二次为2π,第三次为4π,以此类推;实现第一次翻转的代码如下:The phase matrix in the step S505 is all recorded as phi00, the symmetric axis of the flip is π for the first time, 2π for the second time, 4π for the third time, and so on; the code to realize the first flip is as follows:
S506、对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵,记为phi00T。S506. Perform filtering and smoothing processing on the first unwrapped phase matrix to obtain a second unwrapped phase matrix, denoted as phi00T.
S507、计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差。S507. Calculate and save the relative error between the first unwrapped phase matrix and the second unwrapped phase matrix.
S508、对阈值进行判断。S508, judging the threshold.
若阈值W未达到预设值,即阈值W小于预设值,则返回步骤S503重新确定阈值W,若阈值W达到预设值,即等于预设值,则进入步骤S509。If the threshold W does not reach the preset value, that is, the threshold W is smaller than the preset value, then return to step S503 to re-determine the threshold W; if the threshold W reaches the preset value, that is, equal to the preset value, then go to step S509.
本实施例的预设值为1,重新确定阈值W是指将当前阈值W加上0.01,即第二次确定的阈值W为0.91,第三次确定的阈值W为0.92、第四次确定的阈值W为0.93……依次类推,直到判断阈值W为1时,才终止循环,即最后一次确定的阈值W为1,共要计算11个阈值W,即进行了11次自动翻转替换。The default value of this embodiment is 1, and re-determining the threshold W refers to adding 0.01 to the current threshold W, that is, the threshold W determined for the second time is 0.91, the threshold W determined for the third time is 0.92, and the threshold W determined for the fourth time is 0.91. The threshold W is 0.93...and so on, until the judgment threshold W is 1, the loop is terminated, that is, the last determined threshold W is 1, and a total of 11 thresholds W have to be calculated, that is, 11 automatic flip replacements have been performed.
S509、输出最小相对误差对应的阈值和第二解包裹相位矩阵。S509. Output the threshold corresponding to the minimum relative error and the second unwrapped phase matrix.
通过比较每次确定阈值W保存的相对误差,得到最小相对误差,输出最小相对误差对应的阈值W和第二解包裹相位矩阵phi00T,该阈值W即为最佳阈值。The minimum relative error is obtained by comparing the relative error stored in the threshold W each time, and the threshold W corresponding to the minimum relative error and the second unwrapped phase matrix phi00T are output, and the threshold W is the optimal threshold.
上述步骤S502~S509利用了findSunken函数实现,其为自适应阈值翻转算法的核心函数,函数中设置阈值时定义了一个变量W,该值是实现后续自动翻转替换操作的关键,每一次阈值W对应一次自动翻转替换,保存每一次自动翻转替换后的第一解包裹相位矩阵phi00与进行滤波平滑处理后的第二解包裹相位矩阵phi00T的相对误差,找到最小相对误差对应的阈值W和第二解包裹相位矩阵phi00T并进行输出,使阈值W不断更新,保证了操作的准确性。The above steps S502-S509 are implemented by using the findSunken function, which is the core function of the adaptive threshold flipping algorithm. When setting the threshold in the function, a variable W is defined. This value is the key to realize the subsequent automatic flipping replacement operation. Each threshold W corresponds to An automatic flip replacement, save the relative error between the first unwrapped phase matrix phi00 after each automatic flip replacement and the second unwrapped phase matrix phi00T after filtering and smoothing, and find the threshold W corresponding to the minimum relative error and the second solution Wrap the phase matrix phi00T and output it, so that the threshold W is constantly updated to ensure the accuracy of the operation.
S510、根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。S510. Output a reconstructed true phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error.
采用本实施例的自适应阈值翻转算法(SATR)进行解包裹得到的真实相位分布图,如图7所示,采用现有的横向剪切最小二乘法算法(LSBLS)进行解包裹得到的真实相位分布图,如图8所示,其中用SATR反演得到的单个微透镜的相位最大值约为16.35rad,厚度约为3.62μm,与微透镜阵列参数对比,存在约为0.10μm的绝对误差,相对误差为2.84%;用LSBLS反演得到的单个微透镜的相位最大值约为15.22rad,厚度约为3.37μm,与微透镜阵列参数对比,存在约为0.15μm的绝对误差,相对误差为4.16%。说明本实施例的方法反演得到的重构相位与真实相位的误差较小,精度较高。The real phase distribution obtained by unwrapping using the Adaptive Threshold Reversal Algorithm (SATR) of this embodiment, as shown in FIG. The distribution diagram is shown in Figure 8. The phase maximum value of a single microlens obtained by SATR inversion is about 16.35rad, and the thickness is about 3.62μm. Compared with the parameters of the microlens array, there is an absolute error of about 0.10μm. The relative error is 2.84%; the phase maximum value of a single microlens obtained by LSBLS inversion is about 15.22rad, and the thickness is about 3.37μm. Compared with the parameters of the microlens array, there is an absolute error of about 0.15μm, and a relative error of 4.16 %. It shows that the error between the reconstructed phase obtained by inversion and the real phase by the method of this embodiment is small, and the precision is high.
本领域技术人员可以理解,实现上述实施例的方法中的全部或部分步骤可以通过程序来指令相关的硬件来完成,相应的程序可以存储于计算机可读存储介质中。Those skilled in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing related hardware through a program, and the corresponding program can be stored in a computer-readable storage medium.
应当注意,尽管在附图中以特定顺序描述了上述实施例的方法操作,但是这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。相反,描绘的步骤可以改变执行顺序。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。It should be noted that although method operations of the above-described embodiments are described in a particular order in the drawings, this does not require or imply that the operations must be performed in that particular order, or that all illustrated operations must be performed to achieve the desired results. . Rather, the depicted steps may be performed in an altered order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution.
实施例3:Example 3:
如图9所示,本实施例提供了一种相位解包裹装置,该装置可以应用于计算机中,其包括获取模块901、预处理模块902、第一确定模块903、第二确定模块904、翻转替换模块905、处理模块906、计算模块907、返回模块908、第一输出模块909和第二输出模块910,各个模块的具体功能如下:As shown in FIG. 9, this embodiment provides a phase unwrapping device, which can be applied to a computer, and includes an acquisition module 901, a preprocessing module 902, a first determination module 903, a second determination module 904, an inversion Replacement module 905, processing module 906, calculation module 907, return module 908, first output module 909 and second output module 910, the specific functions of each module are as follows:
所述获取模块901,用于获取包裹相位干涉图。The acquiring module 901 is configured to acquire the wrapping phase interferogram.
所述预处理模块902,用于对包裹相位干涉图进行预处理,实际过程中有需要时可将反余弦包裹相位干涉图转化为反正切包裹相位干涉图。The preprocessing module 902 is used to preprocess the wrapping phase interferogram, and convert the arccosine wrapping phase interferogram into an arctangent wrapping phase interferogram if necessary in the actual process.
所述第一确定模块903,用于确定阈值。The first determining module 903 is configured to determine a threshold.
所述第二确定模块904,用于通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线。The second determining module 904 is configured to determine a concave boundary wrapping the phase matrix through a threshold to form a flipping critical line.
所述翻转替换模块905,用于对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵。The flip replacement module 905 is configured to automatically flip and replace the concave part of the wrapped phase matrix to obtain the first unwrapped phase matrix.
所述处理模块906,用于对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵。The processing module 906 is configured to perform filtering and smoothing processing on the first unwrapped phase matrix to obtain a second unwrapped phase matrix.
所述计算模块907,用于计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差。The calculation module 907 is configured to calculate and save the relative error between the first unwrapped phase matrix and the second unwrapped phase matrix.
所述返回模块908,用于当阈值未达到预设值时,返回重新确定阈值,并执行后续操作。The return module 908 is configured to return to re-determine the threshold and perform subsequent operations when the threshold does not reach the preset value.
所述第一输出模块909,用于当阈值达到预设值时,输出最小相对误差对应的阈值和第二解包裹相位矩阵。The first output module 909 is configured to output the threshold corresponding to the minimum relative error and the second unwrapped phase matrix when the threshold reaches a preset value.
所述第二输出模块910,用于根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。The second output module 910 is configured to output the reconstructed true phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error.
进一步地,所述翻转替换模块905如图10所示,具体包括:Further, the flip replacement module 905 is shown in Figure 10, specifically including:
第一翻转替换单元9051,用于对包裹相位矩阵的凹陷部分进行翻转,将翻转后得到的凹陷矩阵替换包裹相位矩阵中凹陷处的位置,得到新的相位矩阵。The first inverting and replacing unit 9051 is configured to invert the concave part of the wrapped phase matrix, and replace the position of the depressed part in the wrapped phase matrix with the inverted concave matrix to obtain a new phase matrix.
第二翻转替换单元9052,用于当凹陷矩阵为非零矩阵时,对该凹陷矩阵进行翻转,将翻转后得到的凹陷矩阵替换当前相位矩阵中凹陷处的位置,得到新的相位矩阵。The second inverting and replacing unit 9052 is configured to invert the notched matrix when the notched matrix is a non-zero matrix, and replace the position of the notched place in the current phase matrix with the inverted notched matrix to obtain a new phase matrix.
输出单元9053,用于当凹陷矩阵为零矩阵时,将当前相位矩阵作为第一解包裹相位矩阵,并进行输出。The output unit 9053 is configured to use the current phase matrix as the first unwrapped phase matrix and output it when the notch matrix is a zero matrix.
本实施例中各个模块的具体实现可以参见上述实施例1的相位解包裹方法,在此不再一一赘述;需要说明的是,本实施例提供的装置仅以上述各功能模块的划分进行举例说明,在实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。For the specific implementation of each module in this embodiment, please refer to the phase unwrapping method in the above-mentioned embodiment 1, which will not be repeated here; it should be noted that the device provided in this embodiment only uses the division of the above-mentioned functional modules as an example It should be noted that in practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs, that is, the internal structure is divided into different functional modules, so as to complete all or part of the above-described functions.
可以理解,本实施例的装置中所使用的术语“第一”、“第二”等可用于描述各种单元,但这些单元不受这些术语限制。这些术语仅用于将第一个模块与另一个模块区分。举例来说,在不脱离本发明的范围的情况下,可以将第一输出模块称为第二输出模块,且类似地,可将第二输出模块称为第一输出模块,第一输出模块和第二输出模块两者都是输出模块,但其不是同一输出模块。It can be understood that the terms "first" and "second" used in the device of this embodiment can be used to describe various units, but these units are not limited by these terms. These terms are only used to distinguish the first module from another module. For example, without departing from the scope of the present invention, a first output module may be referred to as a second output module, and similarly, a second output module may be referred to as a first output module, the first output module and The second output modules are both output modules, but they are not the same output module.
实施例4:Example 4:
本实施例提供了一种计算机设备,该计算机设备可以是计算机,如图11所示,其包括通过系统总线1101连接的处理器902、存储器、输入装置1103、显示器1104和网络接口1105,该处理器用于提供计算和控制能力,该存储器包括非易失性存储介质1106和内存储器1107,该非易失性存储介质906存储有操作系统、计算机程序和数据库,该内存储器1107为非易失性存储介质中的操作系统和计算机程序的运行提供环境,处理器1102执行存储器存储的计算机程序时,实现上述实施例1的相位解包裹方法,如下:This embodiment provides a computer device, which may be a computer, as shown in FIG. The device is used to provide computing and control capabilities, the memory includes a non-volatile storage medium 1106 and an internal memory 1107, the non-volatile storage medium 906 stores an operating system, computer programs and databases, and the internal memory 1107 is non-volatile The operating system in the storage medium and the computer program provide an environment for running. When the processor 1102 executes the computer program stored in the memory, the phase unwrapping method of the above-mentioned embodiment 1 is implemented, as follows:
获取包裹相位干涉图;Obtain the package phase interferogram;
确定阈值;determine the threshold;
通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线;Determine the concave boundary wrapping the phase matrix through the threshold to form a flipping critical line;
对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵;automatically flipping and replacing the concave part of the wrapped phase matrix to obtain the first unwrapped phase matrix;
对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵;Filtering and smoothing the first unwrapped phase matrix to obtain a second unwrapped phase matrix;
计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差;calculating and saving the relative error between the first unwrapped phase matrix and the second unwrapped phase matrix;
当阈值未达到预设值时,返回重新确定阈值,并执行后续操作;When the threshold does not reach the preset value, return to re-determine the threshold and perform subsequent operations;
当阈值达到预设值时,输出最小相对误差对应的阈值和第二解包裹相位矩阵;When the threshold reaches a preset value, output the threshold corresponding to the minimum relative error and the second unwrapped phase matrix;
根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。Output the reconstructed real phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error.
进一步地,所述获取包裹相位干涉图之后,还包括:对包裹相位干涉图进行预处理,实际过程中有需要时可将反余弦包裹相位干涉图转化为反正切包裹相位干涉图。Further, after the acquisition of the wrapping phase interferogram, it also includes: preprocessing the wrapping phase interferogram, and converting the arccosine wrapping phase interferogram into an arctangent wrapping phase interferogram when necessary in the actual process.
实施例5:Example 5:
本实施例提供了一种存储介质,该存储介质为计算机可读存储介质,其存储有计算机程序,所述程序被处理器执行时,处理器执行存储器存储的计算机程序时,实现上述实施例1的相位解包裹方法,如下:This embodiment provides a storage medium, which is a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, when the processor executes the computer program stored in the memory, the first embodiment above is realized. The phase unwrapping method of is as follows:
获取包裹相位干涉图;Obtain the package phase interferogram;
确定阈值;determine the threshold;
通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线;Determine the concave boundary wrapping the phase matrix through the threshold to form a flipping critical line;
对包裹相位矩阵的凹陷部分进行自动翻转替换,得到第一解包裹相位矩阵;automatically flipping and replacing the concave part of the wrapped phase matrix to obtain the first unwrapped phase matrix;
对第一解包裹相位矩阵进行滤波平滑处理,得到第二解包裹相位矩阵;Filtering and smoothing the first unwrapped phase matrix to obtain a second unwrapped phase matrix;
计算并保存第一解包裹相位矩阵与第二解包裹相位矩阵的相对误差;calculating and saving the relative error between the first unwrapped phase matrix and the second unwrapped phase matrix;
当阈值未达到预设值时,返回重新确定阈值,并执行后续操作;When the threshold does not reach the preset value, return to re-determine the threshold and perform subsequent operations;
当阈值达到预设值时,输出最小相对误差对应的阈值和第二解包裹相位矩阵;When the threshold reaches a preset value, output the threshold corresponding to the minimum relative error and the second unwrapped phase matrix;
根据最小相对误差对应的第二解包裹相位矩阵,输出重构的真实相位分布。Output the reconstructed real phase distribution according to the second unwrapped phase matrix corresponding to the minimum relative error.
进一步地,所述获取包裹相位干涉图之后,还包括:对包裹相位干涉图进行预处理,实际过程中有需要时可将反余弦包裹相位干涉图转化为反正切包裹相位干涉图。Further, after the acquisition of the wrapping phase interferogram, it also includes: preprocessing the wrapping phase interferogram, and converting the arccosine wrapping phase interferogram into an arctangent wrapping phase interferogram when necessary in the actual process.
本实施例中所述的存储介质可以是磁盘、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、U盘、移动硬盘等介质。The storage medium described in this embodiment may be a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a U disk, a mobile hard disk, and the like.
综上所述,本发明在获取包裹相位干涉图后,确定阈值,通过阈值确定包裹相位矩阵的凹陷边界,形成翻转临界线,对包裹相位矩阵的凹陷部分进行自动翻转替换,将自动翻转替换后的相位矩阵进行滤波平滑处理,计算并保存滤波平滑处理前后两个相位矩阵的相对误差,重新确定阈值,执行确定阈值的后续操作,直到阈值达到预设值时,才终止循环,此时通过比较每次确定阈值保存的相对误差,得到最小相对误差,输出最小相对误差对应的阈值和滤波平滑处理后的相位矩阵,在相位解包裹中采用相位翻转恢复相位的方法,最大的优点是利用阈值确定翻转临界线,能够以最小的相对误差求解出完整的真实相位,从而提高了相位解包裹的精度,并且通过自动寻找阈值的方式,能有效避免手动设置阈值,提供正确阈值选择,提高了相位还原的效率及准确性。In summary, the present invention determines the threshold value after obtaining the wrapped phase interferogram, and determines the concave boundary of the wrapped phase matrix through the threshold to form a flipping critical line, automatically flips and replaces the concave part of the wrapped phase matrix, and automatically flips and replaces The phase matrix of the phase matrix is filtered and smoothed, and the relative error of the two phase matrices before and after the smoothing is calculated and saved. The threshold is re-determined, and the follow-up operation of determining the threshold is performed. The loop is not terminated until the threshold reaches the preset value. At this time, by comparing Each time the relative error saved by the threshold is determined, the minimum relative error is obtained, and the threshold corresponding to the minimum relative error and the phase matrix after filtering and smoothing are output. In the phase unwrapping, the method of phase inversion and recovery phase is adopted. The biggest advantage is to use the threshold to determine Flipping the critical line can solve the complete real phase with the smallest relative error, thereby improving the accuracy of phase unwrapping, and by automatically finding the threshold, it can effectively avoid setting the threshold manually, provide the correct threshold selection, and improve the phase restoration. efficiency and accuracy.
以上所述,仅为本发明专利较佳的实施例,但本发明专利的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明专利所公开的范围内,根据本发明专利的技术方案及其发明构思加以等同替换或改变,都属于本发明专利的保护范围。The above is only a preferred embodiment of the patent of the present invention, but the scope of protection of the patent of the present invention is not limited thereto. Equivalent replacements or changes to the technical solutions and their inventive concepts all fall within the scope of protection of the invention patent.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910633802.9A CN110514137B (en) | 2019-07-15 | 2019-07-15 | Phase unwrapping method, apparatus, system, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910633802.9A CN110514137B (en) | 2019-07-15 | 2019-07-15 | Phase unwrapping method, apparatus, system, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110514137A true CN110514137A (en) | 2019-11-29 |
CN110514137B CN110514137B (en) | 2021-01-08 |
Family
ID=68623209
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910633802.9A Expired - Fee Related CN110514137B (en) | 2019-07-15 | 2019-07-15 | Phase unwrapping method, apparatus, system, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110514137B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111461224A (en) * | 2020-04-01 | 2020-07-28 | 西安交通大学 | Phase data unwrapping method based on residual self-coding neural network |
CN114049363A (en) * | 2021-11-15 | 2022-02-15 | 深圳前海环融联易信息科技服务有限公司 | A stripe demodulation method, device and related medium based on image semantic segmentation |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000058686A3 (en) * | 1999-03-10 | 2001-01-04 | Veridian Erim International In | Minimum-gradient-path phase unwrapping |
CN1912541A (en) * | 2006-08-30 | 2007-02-14 | 天津大学 | Phase solution package method base on template in micro-nano structure 3-D contour measuring |
CN101276323A (en) * | 2008-05-05 | 2008-10-01 | 南京大学 | Minimum discontinuity two-dimensional phase unwrapping method based on detection of phase discontinuity region |
CN101691997A (en) * | 2009-09-08 | 2010-04-07 | 南昌航空大学 | Double-frequency grating projection three-dimensional profile measurement method based on rotary splicing |
CN107202550A (en) * | 2017-06-09 | 2017-09-26 | 北京工业大学 | A kind of method based on least square method Phase- un- wrapping figure |
CN108955575A (en) * | 2018-08-22 | 2018-12-07 | 江南大学 | A method of corrugated is accurately restored based on single width interference fringe |
-
2019
- 2019-07-15 CN CN201910633802.9A patent/CN110514137B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000058686A3 (en) * | 1999-03-10 | 2001-01-04 | Veridian Erim International In | Minimum-gradient-path phase unwrapping |
CN1912541A (en) * | 2006-08-30 | 2007-02-14 | 天津大学 | Phase solution package method base on template in micro-nano structure 3-D contour measuring |
CN101276323A (en) * | 2008-05-05 | 2008-10-01 | 南京大学 | Minimum discontinuity two-dimensional phase unwrapping method based on detection of phase discontinuity region |
CN101691997A (en) * | 2009-09-08 | 2010-04-07 | 南昌航空大学 | Double-frequency grating projection three-dimensional profile measurement method based on rotary splicing |
CN107202550A (en) * | 2017-06-09 | 2017-09-26 | 北京工业大学 | A kind of method based on least square method Phase- un- wrapping figure |
CN108955575A (en) * | 2018-08-22 | 2018-12-07 | 江南大学 | A method of corrugated is accurately restored based on single width interference fringe |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111461224A (en) * | 2020-04-01 | 2020-07-28 | 西安交通大学 | Phase data unwrapping method based on residual self-coding neural network |
CN114049363A (en) * | 2021-11-15 | 2022-02-15 | 深圳前海环融联易信息科技服务有限公司 | A stripe demodulation method, device and related medium based on image semantic segmentation |
Also Published As
Publication number | Publication date |
---|---|
CN110514137B (en) | 2021-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4772961B2 (en) | Method for simultaneously forming an amplitude contrast image and a quantitative phase contrast image by numerically reconstructing a digital hologram | |
WO2021097916A1 (en) | Method and system for reconstructing high-fidelity image, computer device, and storage medium | |
CN104006765B (en) | Single carrier frequency interference fringe phase extraction method and detection device | |
CN109916522B (en) | A kind of aberration compensation method based on hologram continuation and its realization device | |
CN104407507A (en) | Hilbert transform based high-precision digital holography phase reconstruction method | |
CN103063155B (en) | Rapid package removal method of digital microscopic holographic phase diagram | |
CN117031684B (en) | Digital holographic imaging automatic focusing method and device | |
CN110514137A (en) | Phase unwrapping method, device, system, computer equipment and storage medium | |
Liu et al. | Automatic and robust phase aberration compensation for digital holographic microscopy based on minimizing total standard deviation | |
CN109579747B (en) | Diffuse reflection type surface morphology measuring method based on two-dimensional optical dot matrix | |
Yu et al. | Phase coherent noise reduction in digital holographic microscopy based on adaptive total variation | |
Huang et al. | Wrapped phase aberration compensation using deep learning in digital holographic microscopy | |
Li et al. | Accurate phase aberration compensation with convolutional neural network PACUnet3+ in digital holographic microscopy | |
Bai et al. | Recent progress of full-field three-dimensional shape measurement based on phase information | |
CN111561877A (en) | A Variable Resolution Phase Unwrapping Method Based on Point Diffraction Interferometer | |
CN113393472B (en) | Zoning composite phase unwrapping method based on digital holographic microscopic imaging | |
CN112802154B (en) | Test method and test system for obtaining phase modulation curve of spatial light modulator | |
CN114965365A (en) | Interferometric quantitative phase microscopy imaging system for real-time detection of living cells | |
Liu et al. | A robust phase extraction method for overcoming spectrum overlapping in shearography | |
CN115131201B (en) | Far-field diffuse reflection synthetic aperture super-resolution imaging method based on stacked reconstruction | |
Jiang et al. | Optimization of single-beam multiple-intensity reconstruction technique: Select an appropriate diffraction distance | |
Wang et al. | Curvature measurement of optical surface using digital holography | |
CN116719147A (en) | An automatic focusing method, electronic device and medium for digital holographic imaging | |
CN111815544A (en) | A sub-pixel search method for the center of digital holographic spectrum | |
Huang et al. | Rapid and high-accuracy oblique-illuminated reflective ptychography without pre-correction |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20210108 |