Image phase unwrapping method and device
By using an image phase unwrapping method, and through the calculation of the phase average value and the determination of the true zero point, the problem of insufficient computational efficiency and accuracy in the existing technology is solved, enabling real-time processing and error elimination on embedded devices and reducing computational costs.
Patent Information
- Application Number
- CN202511503390.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-21
AI Technical Summary
Existing image phase unwrapping methods are insufficient in terms of computational efficiency and accuracy, making it difficult to meet the real-time requirements of industrial online inspection, and their deployment in embedded devices is costly.
An image phase unwrapping method is adopted, which involves acquiring the phase image to be unwrapped, normalizing it, calculating the average phase value, judging the phase change trend, determining the true zero point and phase jump boundary, dividing the region and performing phase compensation, thereby reducing computational complexity and improving accuracy.
It improves computational efficiency, reduces computational costs, makes it possible to process algorithms in real time on embedded devices, suppresses the influence of noise, eliminates errors in traditional methods, and is suitable for resource-constrained scenarios.
Smart Images

Figure CN120970533A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image phase unwrapping method and apparatus. Background Technology
[0002] In the field of optical 3D measurement, phase unwrapping technology is a core component of systems such as fringe projection and interferometry. Its core task is to restore the truncated phase wrapped in the interval [-π, π] to a continuous absolute phase, providing basic data for 3D topography reconstruction. Traditional mainstream methods include path tracking and least squares methods. The path tracking method proposed by Goldstein et al. in 1988 (Goldstein RM, et al. Appl. Opt. 1988, 27(5): 734-749) guides the integration path by constructing a quality map. Although it can suppress noise propagation, it requires calculating residual points pixel by pixel and planning the integration path, resulting in a computational time complexity as high as O(N²), which is difficult to meet the real-time requirements of industrial online inspection. More seriously, this method is extremely sensitive to isolated noise, and misjudgment of local residual points will cause the error to spread along the integration path.
[0003] To improve efficiency, Flynn proposed a fast unwrapping method based on fringe modulation in 1997 (Flynn T J. Opt. Eng. 1997, 36(3): 787-799), which directly applies phase compensation by identifying 2π jump boundaries. Although this method reduces the computational cost to O(N), it relies on a fixed threshold (such as a phase gradient threshold) to determine the jump position. When the surface reflectivity changes abruptly, the local phase gradient increases abnormally, leading to misjudgment of the jump boundary and causing a step error of ±2π integer multiples.
[0004] In recent years, phase unwrapping methods based on deep learning have emerged. For example, patent text CN120219205A proposes a method, system, computer device, and storage medium for real-time holographic phase unwrapping and phase distortion elimination. The method includes the following steps: acquiring and recording a hologram of the object under test; preprocessing the hologram to obtain a wrapped phase map; inputting the wrapped phase map into an HS-TransUNet neural network for wrapped count segmentation to obtain a wrapped quantity map; multiplying the wrapped quantity map by 2π and superimposing it with the wrapped phase map to obtain an unwrapped phase map; inputting the unwrapped phase map into an HS-TransUNet neural network for background segmentation to obtain a background map; inputting the background map into an HS-ResNet50 neural network to obtain the first six Zenick coefficients; using the first six Zenick coefficients to predict background distortion data; and subtracting the unwrapped phase map from the background distortion data to obtain the true phase of the target object. While such methods can improve noise resistance, they require training on tens of thousands of samples and rely on GPU hardware, making deployment in embedded devices costly. Summary of the Invention
[0005] This invention provides an image phase unwrapping method and apparatus that can reduce the computational cost of image phase unwrapping and improve computational efficiency.
[0006] An image phase unwrapping method, comprising: Obtain the phase image to be unwrapped and perform normalization processing; The phase average value is calculated on the normalized phase image to be unwrapped to obtain a column mean array of phase average values for each column of pixels; The phase change trend is determined based on the column mean array to obtain the phase change trend determination result of the phase image to be unwrapped; Zero point detection and verification are performed based on the column mean array to determine the true zero point in the phase image to be unwrapped; Based on the phase change trend judgment result and the true zero point, determine the phase jump boundary in the normalized unwrapped phase image; The normalized phase image to be unwrapped is divided into regions based on the phase transition boundary and the true zero point, and phase compensation is performed on each region to obtain the unwrapped image.
[0007] An image phase unwrapping device, comprising: The image acquisition module is used to acquire the phase image to be unwrapped and perform normalization processing; The phase calculation module is used to calculate the average phase value of the normalized phase image to be unwrapped, and obtain a column mean array of the average phase value of each column of pixels. The trend judgment module is used to judge the phase change trend based on the column mean array and obtain the phase change trend judgment result of the phase image to be untangled. The zero-point determination module is used to perform zero-point detection and verification based on the column mean array to determine the true zero point in the phase image to be unwrapped. The boundary determination module is used to determine the phase jump boundary in the normalized phase image to be unwrapped based on the phase change trend judgment result and the true zero point. The compensation module is used to divide the normalized phase image to be unwrapped into regions based on the phase jump boundary and the true zero point, and to perform phase compensation on each region to obtain the unwrapped image.
[0008] The image phase unwrapping method and apparatus provided by this invention have at least the following beneficial effects: (1) In terms of computational efficiency, by reducing the traditional two-dimensional pixel processing to column statistical feature analysis and performing unified rather than traversal processing on the stable region, the operation paradigm of the untangling algorithm is reconstructed, and the efficiency is improved. In addition, the traversal processing involved in the method provided by this invention can be computed in parallel, which can also save running time at this level, making it possible for the algorithm to be processed in real time on embedded devices, thereby saving computational costs. (2) Regarding measurement accuracy, the inherent errors of traditional methods are addressed through a triple innovative mechanism. First, the introduction of column mean statistics is equivalent to low-pass filtering in the vertical direction, effectively suppressing the influence of isolated noise points. Second, the dynamic dual threshold design accurately identifies real jump events, successfully eliminating the ±2π step error caused by sudden changes in local reflectivity in traditional methods. Finally, the synergistic effect of sliding window verification and minimum spacing constraints overcomes the problem of missed detection in low-texture areas.
[0009] (3) It is simple to operate and easy to reproduce. It adopts a fully deterministic algorithm design. All operation modules (including column mean calculation, zero-crossing detection, boundary positioning and phase compensation) are implemented based on integer operations, avoiding the platform dependence caused by floating-point operations and ensuring the efficient deployment of the algorithm on embedded hardware such as FPGA. This "algorithm-hardware" co-optimization characteristic makes the technology directly integrated into the lower-level machine system, providing a reliable solution for the popularization of phase unwrapping technology in resource-constrained scenarios, thereby reducing production costs. Attached Figure Description
[0010] Figure 1(a) is a schematic diagram of one embodiment of an untangled phase diagram of an upward trend.
[0011] Figure 1(b) is a schematic diagram of one embodiment of the unwrapped phase map of the descending region.
[0012] Figure 2 This is a schematic diagram of one embodiment of the phase change of a row of pixels in an unwrapped phase map.
[0013] Figure 3(a) is a schematic diagram of one embodiment of the phase change of the phase diagram after untangling.
[0014] Figure 3(b) is a schematic diagram of one embodiment of the phase diagram after untangling and normalization.
[0015] Figure 4 This is a schematic diagram of one embodiment of the column phase mean in an unwrapped phase diagram.
[0016] Figure 5(a) is a schematic diagram of one embodiment of the zero point of the column phase mean.
[0017] Figure 5(b) is a schematic diagram of one embodiment of the pseudo-zero point of the column phase mean.
[0018] Figure 5(c) is a schematic diagram of one embodiment of the true zero point of the column phase mean.
[0019] Figures 6(a) to 6(c) This is a schematic diagram showing the different positions of the first true zero point of the image.
[0020] Figure 7 This is a flowchart of one embodiment of the image phase unwrapping method provided by the present invention.
[0021] Figures 8(a) to 8(c) This is a schematic diagram of the image to be unwrapped, the unwrapped image, and the normalized unwrapped image in one application scenario of the image phase unwrapping method provided by the present invention.
[0022] Figure 9 A flowchart of one embodiment of the image phase unwrapping device provided by the present invention. Detailed Implementation
[0023] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0024] The unwrapped phase diagrams are shown in Figure 1(a) and Figure 1(b). In Figure 1(a), after unwrapping, the phase should gradually increase from left to right because the unwrapped phase gradually increases from -π to π within a complete cycle. In Figure 1(b), after unwrapping, the phase should gradually decrease from left to right because the unwrapped phase gradually decreases from π to -π within a complete cycle.
[0025] Ignoring phase changes caused by unevenness or defects on the object under test, taking a gradually rising phase map as an example, for a row of unwrapped phase maps, with the phase value as the vertical axis and the number of columns of pixels as the horizontal axis, we can obtain the following: Figure 2 The diagram shown illustrates this. It can be seen that within one cycle, the phase gradually rises from a value close to -π but slightly larger than -π (denoted as -π+ε) to a value close to π but slightly smaller than π (denoted as π-ε), where ε is a very small positive number. Then, due to the abrupt change in the tangent function at angles of -π or π, the phase at (π-ε) will randomly take values between (-π+ε) and (π-ε). After this brief jump, the phase stabilizes at -π+ε, and then enters the next cycle. Ultimately, it is desired that after unwrapping the unwrapped phase diagram, the diagram shown in Figure 3(a) can be obtained. Then, normalizing the unwrapped phase diagram yields the diagram shown in Figure 3(b), which is the desired final result.
[0026] Although for a particular row of untangled phase charts, the phase values may not necessarily meet the requirements due to unevenness or imperfections. Figure 2 The pattern is shown, but the unevenness is often a relatively small area relative to the phase map. Therefore, if the phase mean is calculated column by column on the phase map, the column phase mean of the phase map is basically as follows. Figure 4 As shown. The region where the average column phase value changes from (-π+ε) to (π-ε) is called the stable region. Within this region, for each row of the unwrapped phase diagram, without any uneven defects, the phase rises steadily without any jumps. The region where the average column phase value changes from (π-ε) to (-π+ε) is called the jump region. Within this region, for each row of the unwrapped phase diagram, without any uneven defects, the phase may jump between the two values of (-π+ε) and (π-ε).
[0027] Furthermore, in this embodiment, a combination of a stable region and a transition region is referred to as one period. Since the phase of the phase map does not necessarily start from (-π+ε) or end at (-π+ε), the leftmost and rightmost periods of the image may be incomplete. This incompleteness may not only be due to partial missing parts of the stable or transition regions, but also... Figure 4 As shown, the leftmost period is missing a portion of the stable region, and the rightmost period is missing a portion of the stable region. This could also be a complete absence of a stable region or a transition region, as shown below. Figure 4 As shown, the rightmost cycle is missing the entire transition region. In this case, the number of columns occupied by the rightmost cycle transition region can be considered to be 0.
[0028] For the stable region of the i-th period, when unwrapping the phase diagram, it is only necessary to add i*2π to the phase value in that period; for the transition region of the i-th period, when unwrapping the phase diagram, it is necessary to traverse the phase value in that period. If the phase value is in the (π-ε) neighborhood, add i*2π to the phase value. If the phase value is in the (-π+ε) neighborhood, add (i+1)*2π to the phase value.
[0029] This approach not only avoids the influence of defects and obtains an accurate unwrapped phase diagram, but also greatly saves computation time because the larger stable region does not require traversing phase values.
[0030] The trend of the phase diagram is determined by the column phase mean. A change from (-π+ε) to (π-ε) in the stable region is considered a positive trend (upward trend), while a change from (π-ε) to (-π+ε) is considered a negative trend (downward trend). To accurately distinguish between stable and transition regions, the boundaries of each region need to be found. First, the zeros on the column phase mean are located, as shown in Figure 5(a). Then, the trend of change within the neighborhood of each zero is compared with the trend of change in the phase diagram. False zeros are identified where the trend in the neighborhood is opposite to that of the phase diagram, as shown in Figure 5(b). False zeros are eliminated, and true zeros are retained, as shown in Figure 5(c). Compared to finding (π-ε) or (-π+ε) to determine the boundaries, finding true zeros has the advantage that true zeros are often located in the center of the stable region, are very stable, and are not affected by phase transitions.
[0031] Between every two adjacent true zeros, there exists a transition zone. Therefore, for each pair of adjacent true zeros, we find the column index (i.e., column number) to the right of the left true zero and the column index to the left of the transition zone. Similarly, we find the column index to the left of the right true zero. Thus, if there are *a* true zeros, we will find *a-1* transition zones. The region between the *i*th true zero and the left boundary of the *i*th transition zone is called the right region (including the column index of the *i*th true zero, but excluding the column index of the left boundary of the *i*th transition zone). The region between the left and right boundaries of the *i*th transition zone is called the transition region (including the column index of the left boundary of the *i*th transition zone, but excluding the column index of the right boundary of the *i*th transition zone). The region between the right boundary of the *i*th transition zone and the (i+1)th true zero is called the left region (including the column index of the right boundary of the *i*th transition zone, but excluding the column index of the (i+1)th true zero).
[0032] However, the location of the first true zero of the image can be one of three cases, such as... Figures 6(a) to 6(c)As shown in Figure 6(a), if we directly find each true zero point, as well as the left and right boundaries of the transition regions, and the left boundary column index of the leftmost true zero point is not 0, it is impossible to determine whether the columns between column 0 and the leftmost true zero point column index belong only to the "left region" (as shown in Figure 6(a)), or to the "transition region" and "left region" (as shown in Figure 6(b)), or to the "right region," "transition region," and "left region" (as shown in Figure 6(c)). To solve this problem, we first default the leftmost zero point column index to 0, and then find the true zero points. Similarly, to determine whether the columns between the left boundary column index of the rightmost true zero point and the last column of the image belong only to the "right region," or to the "right region" and "transition region," or to the "right region," "transition region," and "left region," we default the rightmost zero point column index to the last column index of the image + 1. Assuming the image has M rows and N columns, with column indices 0, 1, ..., N-1, and the true zero-point column indices we find are a1, a2, a3, and a4, then the final zero-point column indices used to determine the "left region," "right region," and "jump region" are: 0, a1, a2, a3, a4, N. This ensures that all regions are correctly distinguished.
[0033] The above method also applies to situations where the trend is negative (downward trend).
[0034] Specifically, refer to Figure 7 In some embodiments, an image phase unwrapping method is provided, comprising: S1. Obtain the phase image to be unwrapped and perform normalization processing; S2. Calculate the phase average value of the normalized phase image to be unwrapped to obtain a column mean array of phase average values for each column of pixels. S3. Based on the column mean array, determine the phase change trend to obtain the phase change trend determination result of the phase image to be unwrapped; S4. Zero point detection and verification are performed based on the column mean array to determine the true zero points in the phase image to be unwrapped; S5. Based on the phase change trend judgment result and the true zero point, determine the phase jump boundary in the normalized phase image to be unwrapped. S6. Divide the normalized phase image to be unwrapped into regions according to the phase transition boundary and the true zero point, and perform phase compensation on each region to obtain the unwrapped image.
[0035] Specifically, in step S1, to facilitate implementation on the lower-level machine, the phase image to be unwrapped, phase_unwrapped, with a phase value range of (-π, π), is first normalized to the range (-2048, 2048), resulting in the normalized phase image to be unwrapped, phase_unwrapped2048. In subsequent processing, 2048 is used instead of π for all calculations, i.e.: (1) Where phase_unwrapped2048 represents the normalized phase image to be unwrapped, and phase_unwrapped represents the original phase image to be unwrapped.
[0036] Further, in step S2, the phase average value is calculated on the normalized phase image to be unwrapped to obtain a column mean array for the phase average value of each column of pixels, including: S21. Initialize the column mean array; S22. Calculate the average phase value of each column of pixels in the normalized phase image to be unwrapped, and store it in the column mean array.
[0037] Specifically, the normalized phase image to be unwrapped, `phase_unwrapped2048`, undergoes dimensionality reduction processing, compressing the two-dimensional phase data into one-dimensional statistical features. The column mean array `meanOfColArray` is initialized to empty. Assuming the normalized phase image `phase_unwrapped2048` has a size of M rows and N columns, for each column of pixels in the image, the arithmetic mean of all phases in that column is calculated and stored in the column mean array `meanOfColArray`, i.e.: (2) Where x = 0, 1, ... N-1, phase_unwrapped2048[y][x] represents the phase value of the y-th pixel in the x-th column, and meanOfColArray[x] represents the average phase value of the x-th column.
[0038] In some embodiments, the phase value of each column of pixels in the normalized phase image phase_unwrapped2048 can be converted into the average phase value of that column. This operation is essentially a low-pass filter applied in the vertical direction, which effectively suppresses the influence of isolated noise points.
[0039] The normalized phase image to be unwrapped comprises M rows and N columns of pixels, where M and N are both integers greater than 1; the column mean array includes the phase average values from column 0 to column (N-1).
[0040] Further, in step S3, the phase change trend is determined based on the column mean array to obtain the phase change trend determination result of the phase image to be unwrapped, including: S31. Traverse the first phase average value to the (N-2)th phase average value in the column mean array, and calculate the local trend value of the pixels in each column based on the phase average value of the adjacent columns of each pixel. S32. Calculate the cumulative value of all local trend values and normalize them to obtain the normalized cumulative value; S33. If the normalized cumulative value is 1, then the phase change trend in the phase image to be unwrapped is determined to be an upward trend within the period; if the normalized cumulative value is -1, then the phase change trend in the phase image to be unwrapped is determined to be a downward trend within the period.
[0041] Specifically, initialize the normalized cumulative value. fuhaoFinal =0, initialize the local trend value array to empty, iterate through the first to N-2 elements of the column mean array meanOfColArray, and calculate the local trend value of each column of pixels based on the phase average of the adjacent columns. diff ,Right now: (3) Where x = 1, 2, ..., N-2, and diff[x] is the local trend value corresponding to the x-th element in the column mean array meanOfColArray.
[0042] Calculate the cumulative value of all local trend values. fuhao ,Right now: (4) The final cumulative value of all local trend values fuhao Normalized to 1 (upward trend) or -1 (downward trend), that is: (5) in, huhaoFinal This represents the normalized cumulative value.
[0043] If the normalized cumulative value huhaoFinal =1 indicates that within a complete cycle, the trend of the unwrapped phase image phase_unwrapped is a gradual increase from -π to π, then abruptly back to -π, i.e., an upward trend, and so on; if the normalized cumulative value huhaoFinal =-1 indicates that within a complete cycle, the trend of the phase image to be unwrapped, phase_unwrapped, is to gradually decrease from π to -π, and then suddenly change back to π, i.e., a downward trend, and so on.
[0044] This global trend determination provides a key guidance for subsequent processing. At this stage, millions of pixels originally required for calculating the boundary between the stable region and the jump region are compressed into thousands of feature points (number of columns), laying a foundation for real-time processing.
[0045] Further, in step S4, zero-point detection and verification are performed according to the column mean array to determine the true zero points in the phase image to be unwrapped, including: S41. Initialize the first zero-point set, the second zero-point set, and the third zero-point set, and add column index 0 to the third zero-point set. S42. Traverse each phase average value in the column mean array, compare the phase average value with a preset zero-point neighborhood threshold. If the absolute value of the phase average value is less than the preset zero-point neighborhood threshold, store the column index corresponding to the phase average value in the first zero-point set. S43. Traverse the column indices in the first zero-point set, determine the neighborhood range according to the column indices in the first zero-point set and the preset left and right neighborhood values, calculate the sum of the local trend values of all column pixels within the neighborhood range corresponding to the column index. If the ratio of the sum of the local trend values to the normalized cumulative value is greater than 0, store the corresponding column index in the second zero-point set. S44. Store the 0th column index in the second zero-point set into the third zero-point set. Traverse the column indices in the second zero-point set, and calculate the absolute value of the difference between the current column index and the previous column index. If the absolute value is greater than the preset minimum threshold, store the current column index in the third zero-point set. S45. Add 1 to the column index corresponding to the last column pixel in the phase image to be unwrapped and store it in the third zero-point set. The column indices in the obtained third zero-point set are the column indices of the true zero points.
[0046] Specifically, in step S41, initialize the first zero-point set set1, the second zero-point set set2, and the third zero-point set set3 to be empty, and add column index 0 to the third zero-point set set. Set a preset zero-point neighborhood threshold nearZero, a preset left and right neighborhood value rad, and a preset minimum threshold minDis.
[0047] In step S42, traverse each phase average value in the column mean array meanOfColArray, and initially select candidate points in the region where the phase average value is close to zero. That is, if the absolute value of the phase average value is less than the preset zero-point neighborhood threshold nearZero, i.e., abs(meanOfColArray[i]) < nearZero, then store the column index i corresponding to the phase average value in the first zero-point set set1. Then introduce a double dynamic verification mechanism: In step S43, the first layer uses a sliding window verification. It iterates through the column indices of the first zero-point set set1, and takes the column corresponding to the column index of set1 in the first zero-point set as the center. It takes the column pixels within the preset left and right neighbor value range as its neighborhood range, and checks the consistency of the difference sign within the neighborhood. That is, it iterates through the column index set1[j] of the first zero-point set1, and lets: (6) Where, diff[] represents the local trend value of the calculated column index. fuhao Now represents the sum of the local trend values of all column pixels within the neighborhood range corresponding to column index set1[j].
[0048] Taking column index set1[j] of set1 in the first zero-point set as the center, the column indices within the left and right rad neighborhood of column index set1[j] are: set1[j]-rad, set1[j]-rad+1, ... ,set1[j], ..., set1[j]+rad-1,set1[j]+rad. Based on the phase average of adjacent columns of each column of pixels, the local trend value of each column of pixels is calculated, and then the local trend values of each column are added together to obtain the sum of the local trend values. fuhao Now.
[0049] If the ratio of the sum of local trend values to the normalized cumulative value is greater than 0, that is: fuhao Now / fuhao If Final>0, it means that the trend symbol in this area is consistent with the global trend. Then, the corresponding column index set1[j] is stored in the second zero point set set2.
[0050] In step S44, the second minimum spacing constraint is applied to avoid over-detection of dense transition areas. That is, the 0th element set2[0] in the second zero point set is stored in the third zero point set set3. Then, the column index set2[k] in the second zero point set set2 is traversed, k starts from 1. If abs(set2[k]-set2[k-1])>minDis, that is, the absolute value of the difference between the current column index and the previous column index is greater than the preset minimum threshold minDis, then the kth element set2[k] in the second zero point set, that is, the corresponding column index, is stored in the third zero point set3.
[0051] In step S45, the column index (col) corresponding to the last column of pixels in the phase image to be unwrapped is incremented by 1 and stored in the third zero-point set set3, where col = N. This forms a region partitioning framework covering the entire image. This stage innovatively introduces the sliding window concept from signal processing into phase analysis, solving the problem of missed detections in low-texture regions using traditional methods.
[0052] The column indices in the obtained third set of zero points are the column indices of the true zero points.
[0053] Furthermore, in step S5, the phase change trend judgment result includes the upward trend within the period and the downward trend within the period; Based on the phase change trend judgment result and the true zero point, the phase jump boundary in the normalized unwrapped phase image is determined, including: S51. For an upward trend within a period, perform the following operations for each true zero point: Based on the column index of the true zero point, search column by column to the right from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the first preset condition, then determine the current column as the right boundary of the stable region and stop searching to the right; Starting from the next true zero point, search column by column to the left from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the second preset condition, then determine the current column as the left boundary of the stable region and stop searching to the left. S52. For a downward trend within a period, perform the following operations for each true zero point: Based on the column index of the true zero point, search column by column to the right from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the third preset condition, then determine the current column as the right boundary of the stable region and stop searching to the right; Starting from the next true zero point, search column by column to the left from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the fourth preset condition, then determine the current column as the left boundary of the stable region and stop searching to the left.
[0054] The first preset condition is: the index of the currently searched column is equal to the number of columns of the phase image to be unwrapped, or the average value of the phase corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold. The second preset condition is: the index of the currently searched column is equal to 0, or the average phase value corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold. The third preset condition is: the index of the currently searched column is equal to the number of columns of the phase image to be unwrapped, or the average value of the phase corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold. The fourth preset condition is: the index of the currently searched column is equal to 0, or the average phase value corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold.
[0055] Specifically, a differentiated search strategy is adopted based on the global trend: a preset boundary threshold boundary_th is set, and a preset two-dimensional left and right boundary array boundaryArray is set. Assuming that a true zero points are found in total, that is, the size of the third zero point set set3 is a+2, then the size of the two-dimensional left and right boundary array boundaryArray is a+1.
[0056] For an upward trend ( fuhaoFinal =1), in the third zero-point set set3, starting from the column index set3[i] (i=0, 1, 2, ..., a) of the 0th true zero point, search column by column to the right. The column index found is equal to the number of columns in the phase image to be unwrapped, or the average phase value corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold, that is: (7) Or, (8) Where set3[i] is the column index of the i-th true zero in the third zero set set3, y[i] is the i-th column index of the right search, set3[i]+y[i] is the current column index found to the right, col represents the number of columns of the phase image to be unwrapped; meanOfColArray[set3[i]+y[i]] is the average phase value corresponding to the current column [set3[i]+y[i]] found to the right, 2048 is the normalized maximum range value, and boundary_th is the preset boundary threshold; Then, the current column set3[i]+y[i] found by searching to the right is considered to be the right boundary of the stable region, and the search to the right is stopped.
[0057] Then, starting from the next true zero column index set3[i+1], search column by column to the left. If the searched column index is equal to 0, or if the average phase value corresponding to the searched column is less than the sum of the normalized minimum range value and the preset boundary threshold, that is: (9) or (10) Where set3[i+1] is the column index of the (i+1)th true zero in the third zero set set3, x[i+1] is the (i+1)th column index searched to the left, set3[i+1]-x[i+1] is the current column index searched to the left, meanOfColArray[set3[i+1]-x[i+1]] is the average phase value corresponding to the current column [set3[i+1]-x[i+1]] searched to the left, and -2048 is the normalized minimum range value; If the current column set3[i+1]-x[i+1] found by searching to the left is considered to be the left boundary of the stable region, then stop searching to the left.
[0058] Finally, the right boundary and left boundary of the stable region (set3[i]+y[i], set3[i+1]-x[i+1]) are stored in the two-dimensional left and right boundary array boundaryArray.
[0059] The downward trend is determined using a symmetric condition: starting from the true zero-point column index set3[i] (i=0, 1, 2, ..., a) in the third zero-point set, the search proceeds column by column to the right. If the currently searched column index is equal to the number of columns in the phase image to be unwrapped, or if the average phase value corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold, then... ; (11) or (12) Where set3[i] is the column index of the i-th true zero in the third zero set set3, y[i] is the i-th column index of the right search, set3[i]+y[i] is the current column index found to the right, col represents the number of columns of the phase image to be unwrapped; meanOfColArray[set3[i]+y[i]] is the average phase value corresponding to the current column [set3[i]+y[i]] found to the right, -2048 is the normalized minimum range value, and boundary_th is the preset boundary threshold; Then, the current column set3[i]+y[i] found by searching to the right is considered to be the right boundary of the stable region, and the search to the right is stopped.
[0060] Then, starting from the next zero-point column index set3[i+1], search column by column to the left. If the searched column index is equal to 0, or if the average phase value corresponding to the searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold, that is: (13) or (14) Where set3[i+1] is the column index of the (i+1)th true zero in the third zero set set3, x[i+1] is the (i+1)th column index when searching to the left, set3[i+1]-x[i+1] is the current column index when searching to the left, meanOfColArray[set3[i+1]-x[i+1]] is the average phase value corresponding to the current column [set3[i+1]-x[i+1]] when searching to the left, and 2048 is the normalized maximum range value.
[0061] If the current column set3[i+1]-x[i+1] found by searching to the left is considered to be the left boundary of the stable region, then stop searching to the left.
[0062] Finally, store (set3[i]+y[i], set3[i+1]-x[i+1]) in boundaryArray.
[0063] Suppose that a true zeros are found in total, that is, the size of the third zero set set3 is a+2, then the size of the two-dimensional left and right boundary array boundaryArray is a+1.
[0064] Further, in step S6, the normalized phase image to be unwrapped is divided into regions based on the phase transition boundary and the true zero point, including: Within one cycle, the region between the true zero and the right boundary of its nearest stable region is defined as the right region of the stable region, and the region between the true zero and the left boundary of its nearest stable region is defined as the left region of the stable region. The left region and the right region together constitute the stable region. The region between the nearest left boundary and right boundary of the stable region is defined as the transition region.
[0065] Furthermore, in step S6, phase compensation is performed on each region, including: S61. Traverse each row of pixels in the normalized phase image to be unwrapped. If the current pixel is located in the right region of the i-th true zero, for an upward trend, if the current pixel satisfies the fifth preset condition, apply i+1 times the periodic phase compensation to the phase of the current pixel; if the current pixel does not satisfy the fifth preset condition, apply i times the periodic phase compensation to the phase of the current pixel. For a downward trend, if the current pixel satisfies the sixth preset condition, apply -(i+1) times the periodic phase compensation to the phase of the current pixel; if the current pixel does not satisfy the sixth preset condition, apply -i times the periodic phase compensation to the phase of the current pixel. S62. If the current pixel is located in the transition region between the i-th true zero and the (i+1)-th true zero, for an upward trend, if the current pixel meets the seventh preset condition, then apply i times the periodic phase compensation to the current pixel; if the current pixel does not meet the seventh preset condition, then apply i+1 times the periodic phase compensation to the current pixel. For a downward trend, if the current pixel meets the seventh preset condition, then apply -(i+1) times the periodic phase compensation to the current pixel; if the current pixel does not meet the seventh preset condition, then apply -i times the periodic phase compensation to the current pixel. S63. If the current pixel is in the left region of the (i + 1)-th true zero point, for the rising trend, if the current pixel meets the sixth preset condition, apply i times of the periodic phase compensation to the current pixel; if the current pixel does not meet the sixth preset condition, apply (i + 1) times of the 2π periodic phase compensation to the current pixel; for the falling trend, if the current pixel meets the fifth preset condition, apply -i times of the periodic phase compensation to the current pixel; if the current pixel does not meet the fifth preset condition, apply -(i + 1) times of the periodic phase compensation to the current pixel; where i = 0, 1, 2... a - 1; a is the number of true zero points.
[0066] The fifth preset condition is that the phase value of the current pixel is less than the negative preset jump threshold, and the phase average value of the column where the current pixel is located is greater than the difference between the normalized maximum range value and the preset jump threshold; The sixth preset condition is that the phase value of the current pixel is greater than the preset jump threshold, and the phase average value of the column where the current pixel is located is less than the sum value of the normalized minimum range value and the preset jump threshold; The seventh preset condition is that the phase value of the current pixel is greater than 0; The periodic phase compensation is the absolute value of the difference between the normalized maximum range value and the normalized minimum range value.
[0067] Specifically, assume that the unwrapped image is phase_wrapped, set the preset jump threshold thes, traverse each row image rowImg of the unwrapped phase image phase_unwrapped2048 after normalization. Assume the row number of rowImg is r, and perform the following operations: Traverse each pixel pixel of each row image rowImg, initialize the compensation coefficient i = 0, and assume the column index of pixel is c; If c ≠ 0 and c = set3[i + 1], then let i = i + 1, otherwise do not make any changes; If the current pixel pixel is in the right region of the i-th true zero point, that is, c ≥ set3[i] and c < boundaryArray[i][0], adopt the local phase + column mean dual-condition determination strategy. For the rising trend ( fuhao Final = 1), if the current pixel meets that its phase value is less than the negative preset jump threshold, and the phase average value of the column where the current pixel is located is greater than the difference between the normalized maximum range value and the preset jump threshold, that is: ;(15) Among them, phase_unwrapped2048[r][c] represents the phase value corresponding to the pixel at the r-th row and c-th column in the unwrapped image to be processed after normalization, thes represents the preset jump threshold, and meanOfColArray[c] represents the phase average value of the c-th column; Let ; (16) Among them, phase_wrapped[r][c] represents the phase value after compensation of the pixel at the r-th row and c-th column, 4096 corresponds to the difference between the normalized maximum range value and the normalized minimum range value, that is, periodic phase compensation, and (i + 1) times of periodic phase compensation is applied.
[0068] If the phase value of the current pixel is greater than or equal to the negative preset jump threshold, or the phase average value of the column where the current pixel is located is less than or equal to the difference between the normalized maximum range value and the preset jump threshold, then let: ; (17) That is, i times of periodic phase compensation is applied.
[0069] Furthermore, for the descending trend ( fuhao Final = -1), if the phase value of the current pixel is greater than the preset jump threshold, and the phase average value of the column where the current pixel is located is less than the sum of the normalized minimum range value and the preset jump threshold, that is: ; (18) Then, -(i + 1) times of periodic phase compensation is applied to the phase of the current pixel, and let: ; (19) That is, -(i + 1) times of periodic phase compensation is applied.
[0070] If the phase value of the current pixel is less than or equal to the preset jump threshold, or the phase average value of the column where the current pixel is located is greater than or equal to the sum of the normalized minimum range value and the preset jump threshold, then -i times of periodic phase compensation is applied to the phase of the current pixel: ; (20) That is, -i times of periodic phase compensation is applied.
[0071] If the current pixel pixels is in the jump region between the i-th true zero point and the (i + 1)-th true zero point, that is, c ≥ boundaryArray[i][0] and c < boundaryArray[i][1], directly judge according to the phase sign.
[0072] For the ascending trend ( fuhaoFinal = 1), if the phase value of the current pixel is greater than 0, that is: ; (21) Then apply i times the periodic phase compensation to the current pixel: ; (22) That is, apply i times the periodic phase compensation.
[0073] If the phase value of the current pixel is less than or equal to 0, then apply (i + 1) times the periodic phase compensation to the current pixel: ; (23) That is, apply (i + 1) times the periodic phase compensation.
[0074] For the downward trend (fuhaoFinal = -1), if the phase value of the current pixel is greater than 0, then apply -(i + 1) times the periodic phase compensation to the current pixel: ; (24) That is, apply -(i + 1) times the periodic phase compensation.
[0075] If the phase value of the current pixel is less than or equal to 0, then apply -i times the periodic phase compensation to the current pixel: ; (25) That is, apply -i times the periodic phase compensation.
[0076] If the current pixel is located in the left region of the (i + 1)-th true zero point, that is, c ≥ boundaryArray[i][1] and c < set3[i + 1], the same dual-condition determination is also adopted.
[0077] For the upward trend (fuhaoFinal = 1), if the phase value of the current pixel is greater than the preset jump threshold, and the phase average value of the column where the current pixel is located is less than the sum value of the normalized minimum range value and the preset jump threshold, that is: ; (26) Then apply i times the periodic phase compensation to the current pixel: ; (27) That is, apply i times the periodic phase compensation.
[0078] If the phase value of the current pixel is less than or equal to the preset jump threshold, or the phase average value of the column where the current pixel is located is greater than or equal to the sum value of the normalized minimum range value and the preset jump threshold, then apply (i + 1) times the periodic phase compensation to the current pixel: ; (28) That is, apply a periodic phase compensation of (i+1) times.
[0079] For a downward trend ( fuhao If the phase value of the current pixel is less than a negative preset transition threshold, and the average phase value of the column containing the current pixel is greater than the difference between the normalized maximum range value and the preset transition threshold, that is: (29) Then apply a periodic phase compensation of -i times to the current pixel: (30) That is, apply a periodic phase compensation of -i times.
[0080] If the phase value of the current pixel is greater than or equal to a negative preset transition threshold, or if the average phase value of the column containing the current pixel is less than or equal to the difference between the normalized maximum range value and the preset transition threshold, then apply a periodic phase compensation of -(i+1) times to the current pixel: (31) That is, apply a periodic phase compensation of -(i+1) times.
[0081] i is dynamically generated by the zero-crossing index, enabling fully automated period counting across the entire image. The entire processing flow requires only a single image traversal, significantly reducing processing time.
[0082] Furthermore, in some embodiments, after obtaining the unwrapped image, the process further includes: The untangled image is normalized to obtain a normalized untangled image.
[0083] Specifically, assuming the normalized unwrapped image is phase_normalized, calculate the mean phase value of the 0th column of the unwrapped image phase_wrapped, mean_first, and the mean phase value of the (N-1)th column of the unwrapped image phase_wrapped, mean_last. Then, iterate through each pixel point phase_wrapped[r][c] of the unwrapped image phase_wrapped, and let phase_normalized[r][c] = phase_wrapped[r][c] - c * (mean_last - mean_first) / (N-1) - mean_first to achieve global normalization of the phase of the unwrapped image.
[0084] The methods provided in the above embodiments will be further explained below through specific implementation methods.
[0085] A set of unwrapped phase maps (phase_unwrapped) is selected, as shown in Figure 8(a). The zero-neighborhood threshold (nearZero=10), sliding window radius (rad=5), minimum spacing constraint (minDis=20), left and right boundary thresholds (boundary_th=256), and transition threshold (thes=512) are set to obtain unwrapped phase maps (phase_wrapped), as shown in Figure 8(b). Finally, the normalized phase map (phase_normalized) is obtained, as shown in Figure 8(c). The examples demonstrate that the method provided in this embodiment can correctly achieve phase unwrapping processing under different trends and when there are phase abrupt changes in the image.
[0086] refer to Figure 9 In some embodiments, an image phase unwrapping apparatus is also provided, comprising: Image acquisition module 201 is used to acquire the phase image to be unwrapped and perform normalization processing; The phase calculation module 202 is used to calculate the average phase value of the normalized phase image to be unwrapped, and obtain a column mean array of the average phase values of each column of pixels. The trend judgment module 203 is used to judge the phase change trend based on the column mean array and obtain the phase change trend judgment result of the phase image to be untangled. Zero point determination module 204 is used to perform zero point detection and verification based on the column mean array to determine the true zero point in the phase image to be unwrapped; Boundary determination module 205 is used to determine the phase jump boundary in the normalized phase image to be unwrapped based on the phase change trend judgment result and the true zero point; The compensation module 206 is used to divide the normalized phase image to be unwrapped into regions according to the phase jump boundary and the true zero point, and to perform phase compensation on each region to obtain the unwrapped image.
[0087] Furthermore, it also includes a normalization module 207, which is used to normalize the untangled image after obtaining the untangled image to obtain a normalized untangled image.
[0088] Furthermore, the normalized phase image to be unwrapped comprises M rows and N columns of pixels, where M and N are both integers greater than 1; the column mean array includes the phase average values from column 0 to column (N-1). The trend judgment module 203 performs phase change trend judgment based on the column mean array to obtain the phase change trend judgment result of the phase image to be untangled, including: Iterate through the first phase average value to the (N-2)th phase average value in the column mean array, and calculate the local trend value of the pixels in each column based on the phase average value of the adjacent columns of each pixel. Calculate the cumulative value of all local trend values and normalize it to obtain the normalized cumulative value; If the normalized cumulative value is 1, the phase change trend in the phase image to be unwrapped is determined to be an upward trend within the period; if the normalized cumulative value is -1, the phase change trend in the phase image to be unwrapped is determined to be a downward trend within the period.
[0089] Further, the zero-point determination module 204 performs zero-point detection and verification based on the column mean array to determine the true zeros in the phase image to be unwrapped, including: Initialize the first zero-point set, the second zero-point set, and the third zero-point set, and add column index 0 to the third zero-point set; Traverse each phase average value in the column mean array, compare the phase average value with a preset zero-point neighborhood threshold, and if the absolute value of the phase average value is less than the preset zero-point neighborhood threshold, store the column index of the corresponding phase average value in the first zero-point set. Traverse the column indices in the first zero-point set, determine the neighborhood range based on the column indices in the first zero-point set and the preset left and right neighbor values, calculate the sum of the local trend values of all column pixels in the neighborhood range corresponding to the column index, and if the ratio of the sum of the local trend values to the normalized cumulative value is greater than 0, store the corresponding column index in the second zero-point set. Store the 0th column index in the second zero-point set into the third zero-point set. Iterate through the column indices in the second zero-point set and calculate the absolute value of the difference between the current column index and the previous column index. If the absolute value is greater than a preset minimum threshold, store the current column index into the third zero-point set. The column index corresponding to the last column of pixels in the phase image to be unwrapped is incremented by 1 and stored in the third zero-point set. The column index in the obtained third zero-point set is the column index of the true zero point.
[0090] Further, the boundary determination module 205 determines the phase transition boundary in the normalized unwrapped phase image based on the phase change trend judgment result and the true zero point, including: For the upward trend within the cycle, the following operation is performed for each true zero point: Based on the column index of the true zero point, search column by column to the right from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the first preset condition, then the current column is determined to be the right boundary of the stable region, and the search to the right is stopped; Starting from the next true zero point, search column by column to the left from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the second preset condition, then the current column is determined to be the left boundary of the stable region, and the search to the left is stopped. For the downward trend within the period, the following operation is performed for each true zero point: Based on the column index of the true zero point, search column by column to the right from the normalized phase image to be unwrapped. If the current column index and the phase average value corresponding to the current column satisfy the third preset condition, then the current column is determined to be the right boundary of the stable region, and the search to the right is stopped. Starting from the next true zero point, search column by column to the left from the normalized phase image to be unwrapped. If the current column index and the phase average value corresponding to the current column satisfy the fourth preset condition, then the current column is determined to be the left boundary of the stable region, and the search to the left is stopped.
[0091] Further, the first preset condition is: the currently searched column index is equal to the number of columns of the phase image to be unwrapped, or the average phase value corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold. The second preset condition is: the index of the currently searched column is equal to 0, or the average phase value corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold. The third preset condition is: the index of the currently searched column is equal to the number of columns of the phase image to be unwrapped, or the average value of the phase corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold. The fourth preset condition is: the index of the currently searched column is equal to 0, or the average phase value corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold.
[0092] Furthermore, a cycle includes a stable region and a first transition region; The compensation module 206 divides the normalized phase image to be unwrapped into regions based on the phase transition boundary and the true zero point, including: Within one cycle, the region between the true zero and the right boundary of its nearest stable region is defined as the right region of the stable region, and the region between the true zero and the left boundary of its nearest stable region is defined as the left region of the stable region. The left region and the right region together constitute the stable region. The region between the nearest left boundary and right boundary of the stable region is defined as the transition region.
[0093] Furthermore, the compensation module 206 performs phase compensation for each region, including: Traverse each row of pixels in the normalized phase image to be unwrapped. If the current pixel is located in the right region of the i-th true zero, for an upward trend, if the current pixel satisfies the fifth preset condition, apply i+1 times the periodic phase compensation to the phase of the current pixel; if the current pixel does not satisfy the fifth preset condition, apply i times the periodic phase compensation to the phase of the current pixel. For a downward trend, if the current pixel satisfies the sixth preset condition, apply -(i+1) times the periodic phase compensation to the phase of the current pixel; if the current pixel does not satisfy the sixth preset condition, apply -i times the periodic phase compensation to the phase of the current pixel. If the current pixel is located in the transition region between the i-th true zero and the (i+1)-th true zero, for an upward trend, if the current pixel meets the seventh preset condition, then apply i times the periodic phase compensation to the current pixel; if the current pixel does not meet the seventh preset condition, then apply i+1 times the periodic phase compensation to the current pixel. For a downward trend, if the current pixel meets the seventh preset condition, then apply -(i+1) times the periodic phase compensation to the current pixel; if the current pixel does not meet the seventh preset condition, then apply -i times the periodic phase compensation to the current pixel. If the current pixel is located in the region to the left of the (i+1)th true zero, for an upward trend, if the current pixel meets the sixth preset condition, then apply i times the periodic phase compensation to the current pixel; if the current pixel does not meet the sixth preset condition, then apply i+1 times the periodic phase compensation to the current pixel. For a downward trend, if the current pixel meets the fifth preset condition, then apply -i times the periodic phase compensation to the current pixel; if the current pixel does not meet the fifth preset condition, then apply -(i+1) times the periodic phase compensation to the current pixel. Where i = 0, 1, 2, ..., a-1; a is the number of true zeros.
[0094] Furthermore, the fifth preset condition is that the phase value of the current pixel is less than a negative preset transition threshold, and the average phase value of the column where the current pixel is located is greater than the difference between the normalized maximum range value and the preset transition threshold. The sixth preset condition is that the phase value of the current pixel is greater than the preset jump threshold, and the average phase value of the column where the current pixel is located is less than the sum of the normalized minimum range value and the preset jump threshold. The seventh preset condition is that the phase value of the current pixel is greater than 0; The periodic phase compensation is the absolute value of the difference between the normalized maximum range value and the normalized minimum range value.
[0095] The image phase unwrapping method and apparatus provided in the above embodiments have at least the following beneficial effects: (1) In terms of computational efficiency, by reducing the traditional two-dimensional pixel processing to column statistical feature analysis and performing unified rather than traversal processing on the stable region, the operation paradigm of the untangling algorithm is reconstructed, and the efficiency is improved. In addition, the traversal processing involved in the method provided by this invention can be computed in parallel, which can also save running time at this level, making it possible for the algorithm to be processed in real time on embedded devices, thereby saving computational costs. (2) Regarding measurement accuracy, the inherent errors of traditional methods are addressed through a triple innovative mechanism. First, the introduction of column mean statistics is equivalent to low-pass filtering in the vertical direction, effectively suppressing the influence of isolated noise points. Second, the dynamic dual threshold design accurately identifies real jump events, successfully eliminating the ±2π step error caused by sudden changes in local reflectivity in traditional methods. Finally, the synergistic effect of sliding window verification and minimum spacing constraints overcomes the problem of missed detection in low-texture areas.
[0096] (3) It is simple to operate and easy to reproduce. It adopts a fully deterministic algorithm design. All operation modules (including column mean calculation, zero-crossing detection, boundary positioning and phase compensation) are implemented based on integer operations, avoiding the platform dependence caused by floating-point operations and ensuring the efficient deployment of the algorithm on embedded hardware such as FPGA. This "algorithm-hardware" co-optimization characteristic makes the technology directly integrated into the lower-level machine system, providing a reliable solution for the popularization of phase unwrapping technology in resource-constrained scenarios, thereby reducing production costs.
[0097] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. An image phase unwrapping method, characterized in that, include: Obtain the phase image to be unwrapped and perform normalization processing; The phase average value is calculated on the normalized phase image to be unwrapped to obtain a column mean array of phase average values for each column of pixels; The phase change trend is determined based on the column mean array to obtain the phase change trend determination result of the phase image to be unwrapped; Zero point detection and verification are performed based on the column mean array to determine the true zero point in the phase image to be unwrapped; Based on the phase change trend judgment result and the true zero point, determine the phase jump boundary in the normalized unwrapped phase image; The normalized phase image to be unwrapped is divided into regions based on the phase transition boundary and the true zero point, and phase compensation is performed on each region to obtain the unwrapped image.
2. The method according to claim 1, characterized in that, After obtaining the untangled image, the following steps are also included: The untangled image is normalized to obtain a normalized untangled image.
3. The method according to claim 1, characterized in that, The normalized phase image to be unwrapped comprises M rows and N columns of pixels, where M and N are both integers greater than 1; the column mean array includes the phase average values from column 0 to column (N-1). Based on the column mean array, the phase change trend is determined to obtain the phase change trend determination result of the phase image to be unwrapped, including: Iterate through the first phase average value to the (N-2)th phase average value in the column mean array, and calculate the local trend value of the pixels in each column based on the phase average value of the adjacent columns of each pixel. Calculate the cumulative value of all local trend values and normalize it to obtain the normalized cumulative value; If the normalized cumulative value is 1, the phase change trend in the phase image to be unwrapped is determined to be an upward trend within the period; if the normalized cumulative value is -1, the phase change trend in the phase image to be unwrapped is determined to be a downward trend within the period.
4. The method according to claim 3, characterized in that, Zero-point detection and verification are performed based on the column mean array to determine the true zeros in the phase image to be unwrapped, including: Initialize the first zero-point set, the second zero-point set, and the third zero-point set, and add column index 0 to the third zero-point set; Iterate through each phase average value in the column mean array, compare the phase average value with a preset zero-point neighborhood threshold, and store the column index of the corresponding phase average value into the first zero-point set according to the comparison result; Traverse the column indices in the first zero-point set, determine the neighborhood range of the column index in the first zero-point set, calculate the ratio of the sum of the local trend values of all column pixels in the neighborhood range corresponding to the column index to the normalized cumulative value, and store the corresponding column index into the second zero-point set according to the calculation result. Store the 0th column index in the second zero-point set into the third zero-point set. Iterate through the other column indices in the second zero-point set, calculate the absolute value of the difference between the current column index and the previous column index, and compare it with a preset minimum threshold. Store the current column index into the third zero-point set according to the comparison result. The column index corresponding to the last column of pixels in the phase image to be unwrapped is incremented by 1 and stored in the third zero-point set. The column index in the obtained third zero-point set is the column index of the true zero point.
5. The method according to claim 1, characterized in that, Based on the phase change trend judgment result and the true zero point, the phase jump boundary in the normalized unwrapped phase image is determined, including: For the upward trend within the cycle, the following operation is performed for each true zero point: Based on the column index of the true zero point, search column by column to the right from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the first preset condition, then the current column is determined to be the right boundary of the stable region, and the search to the right is stopped; Starting from the next true zero point, search column by column to the left from the normalized phase image to be unwrapped. If the current column index and the average phase value corresponding to the current column satisfy the second preset condition, then the current column is determined to be the left boundary of the stable region, and the search to the left is stopped. For the downward trend within the period, the following operation is performed for each true zero point: Based on the column index of the true zero point, search column by column to the right from the normalized phase image to be unwrapped. If the current column index and the phase average value corresponding to the current column satisfy the third preset condition, then the current column is determined to be the right boundary of the stable region, and the search to the right is stopped. Starting from the next true zero point, search column by column to the left from the normalized phase image to be unwrapped. If the current column index and the phase average value corresponding to the current column satisfy the fourth preset condition, then the current column is determined to be the left boundary of the stable region, and the search to the left is stopped.
6. The method according to claim 5, characterized in that, The first preset condition is: the index of the currently searched column is equal to the number of columns of the phase image to be unwrapped, or the average value of the phase corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold. The second preset condition is: the index of the currently searched column is equal to 0, or the average phase value corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold. The third preset condition is: the index of the currently searched column is equal to the number of columns of the phase image to be unwrapped, or the average value of the phase corresponding to the currently searched column is less than the sum of the normalized minimum range value and the preset boundary threshold. The fourth preset condition is: the index of the currently searched column is equal to 0, or the average phase value corresponding to the currently searched column is greater than the difference between the normalized maximum range value and the preset boundary threshold.
7. The method according to claim 6, characterized in that, A period includes a stable region and a transition region, and a stable region contains a true zero. The normalized phase image to be unwrapped is divided into regions based on the phase transition boundary and the true zero point, including: Within one cycle, the region between the true zero and the right boundary of its nearest stable region is defined as the right region of the stable region, and the region between the true zero and the left boundary of its nearest stable region is defined as the left region of the stable region. The left region and the right region together constitute the stable region. The region between the nearest left boundary and right boundary of the stable region is defined as the transition region.
8. The method according to claim 7, characterized in that, Phase compensation is performed for each region, including: Iterate through each row of pixels in the normalized phase image to be unwrapped; For the current pixel located in the region to the right of the i-th true zero, if the current pixel is in an upward trend and meets the fifth preset condition, apply i+1 times the periodic phase compensation; if it does not meet the fifth preset condition, apply i times the periodic phase compensation. If the current pixel is in a downward trend and meets the sixth preset condition, apply -(i+1) times the periodic phase compensation; if it does not meet the sixth preset condition, apply -i times the periodic phase compensation. For the current pixel located in the transition region between the i-th true zero and the (i+1)-th true zero, apply i times the periodic phase compensation to the phase of the current pixel that is in an upward trend and meets the seventh preset condition, and apply i+1 times the periodic phase compensation if it does not meet the seventh preset condition; apply -(i+1) times the periodic phase compensation to the phase of the current pixel that is in a downward trend and meets the seventh preset condition, and apply -i times the periodic phase compensation if it does not meet the seventh preset condition. For the current pixel located in the region to the left of the (i+1)th true zero, apply i times the periodic phase compensation to the phase of the current pixel that is in an upward trend and meets the sixth preset condition, and apply i+1 times the periodic phase compensation if it does not meet the sixth preset condition; apply -i times the periodic phase compensation to the phase of the current pixel that is in a downward trend and meets the fifth preset condition, and apply -(i+1) times the periodic phase compensation if it does not meet the fifth preset condition. Where i = 0, 1, 2, ..., a-1; a is the number of true zeros.
9. The method according to claim 8, characterized in that, The fifth preset condition is that the phase value of the current pixel is less than a negative preset jump threshold, and the average phase value of the column where the current pixel is located is greater than the difference between the normalized maximum range value and the preset jump threshold. The sixth preset condition is that the phase value of the current pixel is greater than the preset jump threshold, and the average phase value of the column where the current pixel is located is less than the sum of the normalized minimum range value and the preset jump threshold. The seventh preset condition is that the phase value of the current pixel is greater than 0; The periodic phase compensation is the absolute value of the difference between the normalized maximum range value and the normalized minimum range value.
10. An image phase unwrapping device, characterized in that, include: The image acquisition module is used to acquire the phase image to be unwrapped and perform normalization processing; The phase calculation module is used to calculate the average phase value of the normalized phase image to be unwrapped, and obtain a column mean array of the average phase value of each column of pixels. The trend judgment module is used to judge the phase change trend based on the column mean array and obtain the phase change trend judgment result of the phase image to be untangled. The zero-point determination module is used to perform zero-point detection and verification based on the column mean array to determine the true zero point in the phase image to be unwrapped. The boundary determination module is used to determine the phase jump boundary in the normalized phase image to be unwrapped based on the phase change trend judgment result and the true zero point. The compensation module is used to divide the normalized phase image to be unwrapped into regions based on the phase jump boundary and the true zero point, and to perform phase compensation on each region to obtain the unwrapped image.
Citation Information
Patent Citations
Real-time holographic phase unwrapping and phase distortion elimination method and system, computer equipment and storage medium
CN120219205A
InSAR (Interferometric Synthetic Aperture Radar) image phase unwrapping method based on phase difference statistic model
CN106093939A
SAR landslide early warning method based on landslide deformation information and meteorological data
CN113281742A
Method for phase unwrapping
WO2013091078A1
Cited By
A method and apparatus for calculating the median of data based on heap iterative computation
CN122412753A