Phase unfolding method, computer equipment and readable storage medium
By using Gray code pattern decoding and supplementary index calculation to calculate the quality map, the problem of inaccurate pixel quality values in boundary, low texture and high reflectivity areas of the quality map-guided method is solved, and more accurate phase unfolding and 3D reconstruction results are achieved.
Patent Information
- Application Number
- CN202511211541.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-28
AI Technical Summary
The existing quality map-guided method for solving the wrapper phase is not accurate enough in terms of absolute phase, which leads to inaccurate results in structured light 3D reconstruction. This is mainly due to the inaccurate calculation of pixel quality values in boundary regions, low-texture regions, and high-reflectivity regions.
Gray code pattern decoding is used to determine the stripe level. The quality map is calculated by combining basic and supplementary indicators. The brightness transition of the Gray code stripe level and the supplementary indicator values guide the unwrapping of phase map pixels, avoiding incorrect division of boundaries and low-texture areas, and improving the continuity of the phase unfolding path.
This improves the accuracy of absolute phase, thereby improving the accuracy of the reconstruction results of structured light 3D reconstruction, enhancing the robustness and computational efficiency of the phase unrolling algorithm, and reducing error propagation.
Smart Images

Figure CN120740499B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of structured light three-dimensional reconstruction, specifically relating to a phase unfolding method, computer equipment, and readable storage medium. Background Technology
[0002] Structured light 3D reconstruction is a non-contact measurement method for measuring the 3D shape of objects that has emerged in recent years. With its advantages such as non-contact operation, high reconstruction accuracy, dense point cloud, and low cost, it has been widely used in industrial inspection, consumer electronics, virtual reality, augmented reality, cultural relic protection, and medical devices in recent years.
[0003] The content related to structured light 3D reconstruction is based on a structured light vision measurement system, which typically consists of a projector, camera, computer, and the object to be measured. The basic reconstruction process includes: the computer generates a set of sinusoidal grating patterns or some auxiliary patterns, which are projected onto the surface of the object to be measured via a projector; the camera captures images of the object after projection; these images are then uploaded to the computer; the computer performs phase calculation and phase-height mapping on the acquired images; and by combining the intrinsic and extrinsic parameters of the camera and projector, the 3D shape of the object to be measured can be reconstructed. Specifically, the phase calculation process involves: calculating a phase map from the image, and then performing phase calculation based on the phase map. It should be noted that the phase obtained directly from the phase map will... The phase between these points, meaning the range is discontinuous, is called the wrapped phase, and is determined by the phase calculation formula. The phase required for reconstruction is the absolute phase; therefore, it needs to be unwrapped to unfold the wrapped phase into a continuous phase, i.e., the absolute phase.
[0004] Phase unwrapping based on quality map guidance has become the mainstream method in phase unwrapping algorithms. This method defines a quality map to evaluate the reliability or quality of the unwrapping path for each pixel in the phase map, and uses this as a guide to determine the unwrapping processing order. However, the absolute phase obtained by current quality map guidance methods is not accurate enough, resulting in inaccurate reconstruction results for structured light 3D reconstruction using this absolute phase. Summary of the Invention
[0005] The purpose of this invention is to provide a phase unfolding method, a computer device, and a readable storage medium that can solve the problem of how to improve the accuracy of the absolute phase obtained by solving the wrapped phase using the quality map-guided method, thereby improving the accuracy of the reconstruction results of structured light 3D reconstruction using the absolute phase.
[0006] To solve the above-mentioned technical problems, the present invention is implemented as follows:
[0007] In a first aspect, embodiments of the present invention provide a phase unfolding method, the method comprising:
[0008] Determine the fringe order, basic indicators, and phase diagram; the fringe order is obtained by decoding the Gray code pattern, and the phase diagram is calculated by a sinusoidal grating pattern.
[0009] Determine the first index value of the supplementary index corresponding to the stripe level and the second index value of the basic index;
[0010] A quality map is obtained based on the first index value, the second index value, and the phase map;
[0011] Based on the quality map, the first pixel value of the pixel in the phase map is unwrapped to obtain the absolute phase; the first pixel value is the wrapped phase.
[0012] In a second aspect, embodiments of the present invention provide a computer device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0013] Thirdly, embodiments of the present invention provide a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0014] Fourthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0015] In this embodiment of the invention, a phase unfolding method is proposed, which solves the above-mentioned problems through the following steps: determining the fringe level, the basic index, and the phase map; the fringe level is obtained by decoding the Gray code pattern, and the phase map is calculated by the sinusoidal grating pattern; determining the first index value of the supplementary index corresponding to the fringe level and the second index value of the basic index; obtaining a quality map based on the first index value, the second index value, and the phase map; unwrapping the first pixel value of the pixel in the phase map based on the quality map to obtain the absolute phase; the first pixel value is the wrapped phase. Specifically, for boundary regions, since the decoding of Gray code patterns only depends on the brightness transitions of the stripes, even in boundary regions, these brightness transitions are not affected by the background. Therefore, there will be clear integer transitions in boundary regions (such as the stripe level changing from k to k+1). For low-texture regions, since Gray code is a binary stripe with only black and white colors, its contrast on low-texture surfaces is much higher than that of sinusoidal stripes, maintaining a high signal-to-noise ratio. In this case, the first index value can accurately guide the classification of the quality regions of pixels in this low-texture region. For highly reflective regions, since the decoding of Gray code patterns only depends on the brightness transitions of the stripes and does not require precise calculation of grayscale values, the calculation of the first index value is not affected by whether or not there is reflection, thus avoiding the incorrect classification of pixels in highly reflective regions into low-quality regions. In summary, by introducing the fringe level of Gray code when calculating the quality value, and calculating the quality value using the first index value of the supplementary index corresponding to the fringe level, the difficulty in selecting the phase unfolding path or the interruption of the phase unfolding path is avoided, making the phase unfolding path continuous. This improves the accuracy of the absolute phase obtained by the quality map-guided method, and further improves the accuracy of the reconstruction results of structured light 3D reconstruction using this absolute phase. Attached Figure Description
[0016] Figure 1 This is a Gray code pattern according to some embodiments of the present invention;
[0017] Figure 2 This is a sinusoidal grating pattern according to some embodiments of the present invention;
[0018] Figure 3 A raw phase image provided for some embodiments of the present invention;
[0019] Figure 4 A schematic flowchart of a phase unwrapping method provided for some embodiments of the present invention;
[0020] Figure 5 A mass diagram provided for some embodiments of the present invention;
[0021] Figure 6 A quality histogram provided for some embodiments of the present invention;
[0022] Figure 7 An unwrapping phase map is provided for some embodiments of the present invention;
[0023] Figure 8 Another schematic flowchart of the phase unrolling method provided for some embodiments of the present invention;
[0024] Figure 9 Structural block diagram of a phase unfolding apparatus provided for some embodiments of the present invention;
[0025] Figure 10 Internal structural diagrams of a computer device provided for some embodiments of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0028] To facilitate understanding of the technical solutions described in this invention, the following explanations are provided for the technical terms that may be involved in this invention:
[0029] Gray code is a binary encoding method whose core characteristic is that any two adjacent codes differ by only one bit.
[0030] Gray code patterns: such as Figure 1 The image shows a binary stripe pattern based on Gray code, which uses only black and white, i.e., an alternating pattern of light and dark.
[0031] A sinusoidal grating is a type of grating whose transmittance or reflectance varies sinusoidally in one direction.
[0032] Sine grating pattern: such as Figure 2As shown, an optical pattern with a sinusoidal intensity distribution is projected onto the surface of the object being measured by a projector. After the camera captures an image of the object being measured, a phase map is calculated from the sinusoidal grating pattern in the image using phase measurement technology.
[0033] A phase map is a two-dimensional phase data matrix obtained from an image using phase measurement technology, reflecting the surface height of the object being measured. Its core feature is that it encodes the shape of the object being measured with phase values.
[0034] Jump: A phase discontinuity caused by a sudden change in the true height of the surface of the measured object (such as a stepped area or an edge area), i.e., a 2π jump.
[0035] Integer ambiguity: In structured light 3D reconstruction, phase resolution is typically based on phase encoding methods. However, since the phase of the image acquired by the camera is in the range of... The wrapped phase is therefore needed to recover the true absolute phase through unwrapping (i.e., unwrapping the phase). Integer ambiguity is used in the calculation of the wrapped phase using the following formula:
[0036] (one)
[0037] in, For absolute phase, To wrap the phase, The ambiguity is an integer.
[0038] Among them, such as Figure 3 As shown, the phase map encapsulating the phase is the original phase image calculated from the input phase-shifted image. Figure 3 The stripe pattern projected onto the object being measured consists of a gradient of colors from blue to green to yellow to orange to red, representing the phase values from low to high (a periodic change from -π to π), i.e., blue represents low phase and red represents high phase. Figure 3 The densely packed dots with no regular color variation are noise, which are generally caused by distortion due to highly reflective surfaces or shadows.
[0039] High-quality area: The area with a high quality value in the quality map.
[0040] Low-quality areas: Areas with lower quality values in the quality map.
[0041] Errors: The main sources include noise interference, phase discontinuities, and ambiguities in the wrapped phase, which mainly occur in low-quality regions.
[0042] Error propagation: When calculating the absolute phase of the current pixel, the integer ambiguity may be incorrect, causing the absolute phase to deviate from the true value and produce an error. When calculating the wrapper phase of adjacent pixels using the current pixel, the incorrect integer ambiguity will be used in the calculation. Therefore, the error will be propagated from the current pixel to the adjacent pixel, and then from the adjacent pixel to other pixels whose absolute phase has not been calculated.
[0043] Quality map guided method: Divide the pixels in the quality map into high-quality regions and low-quality regions, and solve the wrap phase of pixels in the high-quality regions first, and then solve the wrap phase of pixels in the low-quality regions, thereby avoiding the propagation of errors generated when solving in the low-quality regions to the high-quality regions.
[0044] Phase unwrapping path: The path formed by connecting the pixels traversed sequentially when solving the wrapped phase using the quality map-guided method. Solving the wrapped phase is the process of phase unwrapping.
[0045] As mentioned in the background section regarding the structured light 3D reconstruction process, this invention uses a quality map-guided method to solve the wrapped phase, which has significant advantages in solving the unwrapping problem of complex phase maps. These advantages are as follows:
[0046] First, this method can effectively suppress error propagation and improve unwrapping accuracy. It prioritizes high-quality regions and extends them to neighboring high-quality regions, minimizing unwrapping errors in the early stages and preventing errors from spreading from the currently solved pixel to subsequent pixels.
[0047] Secondly, this method enhances the robustness of the phase unwrapping algorithm. Specifically, images acquired by cameras often suffer from severe noise, local undersampling, and phase breakage caused by abrupt geometric or material changes. This method is more stable in the face of local perturbations such as noise and shadows, and is less likely to cause the entire unwrapping process to collapse due to local problems.
[0048] Finally, this method has high computational efficiency, meaning that prioritizing high-quality regions usually means prioritizing the pixels that are least likely to be unwrapped and least require backtracking or correction, thus avoiding invalid attempts or erroneous calculations in low-quality regions.
[0049] However, the absolute phase obtained by the current quality map-guided method is not accurate enough, resulting in inaccurate reconstruction results of structured light 3D reconstruction based on this absolute phase.
[0050] To address the aforementioned issues, the applicant discovered that the problem is primarily caused by inaccurate absolute phase of pixels in boundary regions, low-texture regions, and high-reflectivity regions of the image. Boundary regions refer to the transition areas between the object being measured and the background in the image; low-texture regions refer to the areas of the object's low-texture surface (i.e., surfaces lacking texture features) in the image; and high-reflectivity regions refer to the areas of the object's highly reflective surface in the image. High-reflectivity surfaces can cause pixel overexposure or oversaturation in the image captured by the camera.
[0051] It should be noted that current methods for calculating quality maps typically use the values of basic metrics as parameters when calculating the quality values of pixels in the boundary region. These basic metrics include, but are not limited to, phase derivative variance and modulation information. Specifically, the phase derivative variance quantifies the smoothness of local phase changes and is positively correlated with noise levels; modulation information reflects the signal-to-noise ratio.
[0052] It should ideally reflect abrupt changes, but due to noise, shadows, reflections, etc., the variance of the phase derivative fails to reflect these changes. Therefore, the calculated variance is small, resulting in a high-quality value.
[0053] In particular, boundary regions are typically characterized by low signal-to-noise ratios (SNR) and high probability of abrupt changes due to background interference. However, current methods for calculating quality maps fail to accurately reflect these low SNR and abrupt changes when calculating the quality values of pixels in these boundary regions. Consequently, the inaccurate calculation of quality values often prevents accurate segmentation of quality regions for pixels in these boundary areas, making phase unfolding path selection difficult and prone to errors.
[0054] In particular, for low-texture areas, the stripe contrast is low, resulting in excessive noise in phase calculation. The wrapped phase is submerged by noise, and the quality map cannot distinguish between real and noise signals, making it difficult to select the phase unwrapping path and easily introducing errors.
[0055] In particular, for highly reflective areas, due to pixel overexposure or oversaturation, the current method for calculating the quality map often obtains quality values that are lower than the true values when calculating the quality values of pixels in these highly reflective areas. This can lead to the incorrect classification of pixels in these highly reflective areas into low-quality areas, resulting in interruption of the phase unwrapping path or difficulty in selecting the phase unwrapping path, which can easily introduce errors.
[0056] In summary, the quality values of pixels in boundary regions, low-texture regions, or high-reflectivity regions calculated using current methods are often unreliable due to noise, shadows, lack of texture features, or reflections present in the image. Specifically, the quality values calculated from basic metrics in boundary regions, low-texture regions, and high-reflectivity regions are often inaccurate. This leads to the incorrect classification of pixels as high-quality or low-quality regions when using the quality map-guided method, resulting in difficulties in phase unwrapping path selection or interruption of the phase unwrapping path. Difficulties in phase unwrapping path selection or interruption of the phase unwrapping path cause discontinuities in the phase unwrapping path, leading to lower accuracy of the absolute phase calculated by the quality map-guided method, and consequently, lower accuracy of the reconstruction results of structured light 3D reconstruction based on this absolute phase.
[0057] Based on this, such as Figure 4 As shown in an exemplary embodiment, the present invention proposes a phase unfolding method, which solves the above-mentioned problems through the following steps: determining a fringe level, a basic index, and a phase map; the fringe level is obtained by decoding a Gray code pattern, and the phase map is calculated by a sinusoidal grating pattern; determining a first index value of the supplementary index corresponding to the fringe level and a second index value of the basic index; obtaining a quality map based on the first index value, the second index value, and the phase map; unwrapping the first pixel value of the pixel point in the phase map based on the quality map to obtain the absolute phase; wherein, the quality map is obtained by replacing the pixel value of the pixel point in the phase map with the second pixel value, where the first pixel value is the wrapped phase and the second pixel value is the quality value. Specifically, for boundary regions, since the decoding of Gray code patterns only depends on the brightness transitions of the stripes, even in boundary regions, these brightness transitions are not affected by the background. Therefore, there will be clear integer transitions in boundary regions (such as the stripe level changing from k to k+1). For low-texture regions, since Gray code is a binary stripe with only black and white colors, its contrast on low-texture surfaces is much higher than that of sinusoidal stripes, maintaining a high signal-to-noise ratio. In this case, the first index value can accurately guide the classification of the quality regions of pixels in this low-texture region. For highly reflective regions, since the decoding of Gray code patterns only depends on the brightness transitions of the stripes and does not require precise calculation of grayscale values, the calculation of the first index value is not affected by whether or not there is reflection, thus avoiding the incorrect classification of pixels in highly reflective regions into low-quality regions. In summary, by introducing the fringe level of Gray code when calculating the quality value, and calculating the quality value using the first index value of the supplementary index corresponding to the fringe level, the difficulty in selecting the phase unfolding path or the interruption of the phase unfolding path is avoided, making the phase unfolding path continuous. This improves the accuracy of the absolute phase obtained by the quality map-guided method, and further improves the accuracy of the reconstruction results of structured light 3D reconstruction using this absolute phase.
[0058] The following describes each step of the method, referring to... Figure 4 The method includes steps 402-408. Wherein:
[0059] Step 402: Determine the fringe level, basic index, and phase diagram; the fringe level is obtained by decoding the Gray code pattern, and the phase diagram is calculated by the sinusoidal grating pattern.
[0060] Step 404: Determine the first indicator value of the supplementary indicator corresponding to the stripe level and the second indicator value of the basic indicator.
[0061] Among them, the supplementary index corresponding to the stripe level is the boundary confidence level, and the first index value is calculated by the following formula:
[0062] (two)
[0063] in, The gradient represents the fringe order; This represents sharpness and is a settable constant with a value range of [0.5-1.5]. This represents the natural exponential function, that is, an exponential function with base e; x This represents the x-coordinate of a pixel. y This represents the ordinate of the pixel.
[0064] The second index value corresponding to the variance of the phase derivative is calculated using the following formula:
[0065] (three)
[0066] in, This represents the first-order phase difference of a pixel in the x-direction. This represents the first-order phase difference in the y-direction, which is also known as the phase gradient. This represents the variance within a local window on the phase diagram.
[0067] in, and The result is obtained through the following formula four:
[0068] (Four)
[0069] The second indicator value corresponding to the adjustment system information is calculated using the following formula five:
[0070] (five)
[0071] in, , , This represents the signal value of a pixel.
[0072] Step 406: A quality map is obtained based on the first index value, the second index value, and the phase map, wherein there is a correspondence between the second pixel value of a pixel in the quality map and the first pixel value of a pixel in the phase map, the first pixel value is the wrapping phase, and the second pixel value is the quality value.
[0073] The correspondence means that the second pixel value is calculated from the first pixel value, and the coordinates of the pixel corresponding to the second pixel value in the quality map are the same as the coordinates of the pixel corresponding to the first pixel value in the phase map.
[0074] The calculation of quality values includes, but is not limited to, summation and weighted summation.
[0075] For example, the mass value is calculated by summation, and the mass value can be obtained using the following formula six:
[0076] (six)
[0077] For example, the mass value is calculated using a weighted summation, and the mass value can be obtained using the following formula:
[0078] (seven)
[0079] in, These represent the weights of the corresponding indicator values, and the specific values are not limited in this embodiment.
[0080] Step 408: Based on the quality map, unwrap the first pixel value of the pixel point in the phase map to obtain the absolute phase.
[0081] Unwrap using quality map-guided methods or other methods (such as improved quality map-guided methods).
[0082] The above completes the description of an embodiment of the phase unrolling method provided by the present invention.
[0083] Furthermore, when the object being measured has a complex surface, such as a stepped surface, the quality values calculated using current metrics cannot accurately distinguish between genuine edges and anomalous transitions in some pixels on such a complex surface. The applicant's research found that this inaccuracy is caused by noisy or reflective surfaces. Noisy or reflective surfaces lead to gradient distortion, so even if the basic metrics include phase derivative variance, the calculated quality values are inaccurate. Specifically, phase derivative variance only measures the dispersion of local gradient magnitudes; therefore, gradient distortion prevents phase derivative variance from accurately distinguishing between genuine edges and anomalous transitions in some pixels on a complex surface.
[0084] By using the gradient direction corresponding to the complex surface, that is, the gradient direction of the pixel value of the pixel point in the phase map corresponding to the complex surface, the influence of noise or reflective surfaces can be avoided, thereby accurately distinguishing whether some pixels in the complex surface are real edges or abnormal jumps, thus enhancing the edge protection capability.
[0085] Specifically, based on the above embodiments, in some embodiments, an indicator used in calculating the quality value—phase gradient consistency—is added, which can measure the continuity of gradient directions between pixels in the phase map. Specifically, when calculating the quality map, a third indicator value for phase gradient consistency is first determined, as well as the calculation parameters carried by the phase map. Then, based on the calculation parameters, the first indicator value, the second indicator value, and the third indicator value, the quality value corresponding to the pixel is calculated, thereby obtaining the quality map.
[0086] It should be noted that if the third indicator value reflects poor continuity, then the pixel can be identified as a true edge; if the third indicator value reflects good continuity, then the pixel can be identified as an anomalous transition. Furthermore, increasing phase gradient consistency can broaden the information surface used to construct the quality map, thereby improving the accuracy of the quality map.
[0087] The third indicator value is calculated using the following formula:
[0088] (eight)
[0089] in, This represents the gradient direction angle of a pixel in the x-direction; This indicates the gradient direction angle of the pixel in the y-direction; This represents the variance of the gradient direction angle within the local window.
[0090] The calculation of quality values includes, but is not limited to, summation and weighted summation.
[0091] Taking the weighted summation of the mass value as an example, the mass value can be calculated using the following formula nine:
[0092] (Nine)
[0093] in, These represent the weights of the corresponding indicator values, and the specific values are not limited in this embodiment.
[0094] In some embodiments, the weights corresponding to the first indicator value, the second indicator value, and the third indicator value are determined respectively to obtain a first weight, a second weight, and a third weight; the first weight is greater than the second weight and the third weight; based on the calculation parameters, the first indicator value, the second indicator value, the third indicator value, and the weights, the quality value corresponding to the pixel is calculated to obtain a quality map.
[0095] The first weight refers to The second weight refers to and The third weight refers to .
[0096] For example It is 0.4. , and Both are 0.2; for example... It is 0.5. , and The values are 0.1, 0.2, and 0.2 respectively.
[0097] It is important to emphasize that, according to the formula for calculating boundary confidence, in the boundary region, because boundary confidence carries a large weight when constructing the quality map, a significant drop in boundary confidence due to a jump in fringe level will lead to a decrease in the information of the quality map, i.e., a lower quality value. Therefore, when solving the wrapped phase using the quality map-guided method, the boundary region will be classified as a low-quality region. It can be understood that if the first weight is less than the weights of other indicators, the boundary region may be mistakenly classified as a high-quality region. That is, this embodiment avoids misclassifying the boundary region as a high-quality region, thus preventing premature calculation of the wrapped phase corresponding to the boundary region and resulting in error accumulation. Therefore, the absolute phase calculated based on the weighting method in this embodiment can reduce the error caused by error propagation.
[0098] like Figure 5 As shown, Figure 5 This is a quality map, where yellow represents high-quality areas; dark vertical lines indicate phase transition edges, which are low-quality areas; and the purple background represents low-quality areas, which can be considered noise areas.
[0099] It should be noted that after obtaining the quality image, it needs to be filtered and normalized to prepare for subsequent threshold segmentation (i.e., dividing pixels into regions).
[0100] The above describes an improved embodiment of the phase unrolling method provided by the present invention for obtaining a quality map.
[0101] The following is a brief explanation of the process steps of the quality map-guided method in related technologies:
[0102] Step 1: Initialize the priority queue.
[0103] Step 2: Determine the pixel with the highest quality value in the quality map as the seed point.
[0104] Step 3: Use the seed point as the current pixel point and execute steps 4-6.
[0105] Step 4: Find the integer vector z of the current pixel point through integer least squares estimation, that is, minimize the objective function, and thus obtain the integer ambiguity.
[0106] Step 5: Using the integer ambiguity, unwrap the wrapped phase corresponding to the current pixel to obtain the absolute phase.
[0107] Step 6: Mark the current pixel as expanded and add it to the priority queue. "Expanded" means that phase unrolling has already been performed.
[0108] Step 7: Confirm whether the priority queue is empty.
[0109] Step 8: If the priority queue is empty, end the loop and output the absolute phase of all pixels.
[0110] Step 9: If the priority queue is not empty, retrieve the pixel with the highest quality value from the priority queue without replacement.
[0111] Step 10: Based on the pixel with the highest quality value, expand the neighborhood in the quality map to obtain the neighborhood points corresponding to the pixel with the highest quality value. The neighborhood points can be 4 or 8.
[0112] Step 11: Determine whether the neighborhood point has been expanded.
[0113] Step 12: If all neighboring points are already expanded, return to step 7.
[0114] Step 13: If there are unexpanded pixels in the neighborhood, then take the unexpanded pixels as the current pixel and return to step 4.
[0115] In some embodiments, for step 4 above, i.e. the step of calculating integer ambiguity using a fixed calculation strategy, the present invention proposes an improved scheme for calculating integer ambiguity using a dynamically changing calculation strategy.
[0116] The calculation of integer ambiguity using a dynamically changing calculation strategy involves two stages:
[0117] Phase 1: Establish integer fuzziness constraints and obtain candidate integer fuzzinesses based on the integer fuzziness constraints.
[0118] Phase 2: Establish a dual-constraint decision model and obtain the target integer fuzziness based on the candidate integer fuzziness and the dual-constraint decision model.
[0119] It should be noted that Phase 1 and Phase 2 can be implemented separately or in combination. For example, if Phase 1 is implemented separately, there is a scheme where the candidate integer ambiguities obtained through Phase 1 are used as the integer ambiguities obtained in Step 4.
[0120] For Phase One:
[0121] Among them, the integer fuzziness constraint means that the phase difference between two adjacent pixels is less than π, thereby ensuring the continuity of the phase.
[0122] Specifically, before determining the target calculation strategy corresponding to the target integer ambiguity based on the second pixel value of the pixel in the quality image, the method further includes: determining the pixel with the largest quality value in the quality image as the seed point; performing neighborhood expansion in the quality image based on the seed point to obtain the neighboring points corresponding to the seed point; calculating the phase difference between the neighboring points and the seed point based on the first pixel value; and calculating the candidate integer ambiguity based on the phase difference.
[0123] The phase difference between the neighboring point q and the seed point p is calculated using the following formula:
[0124] (ten)
[0125] in, This represents the package operator, used to ensure... The value in between, and These are the wrapping phases of the neighboring point q and the seed point p, respectively.
[0126] The ambiguity of the candidate integer is calculated using the following formula eleven:
[0127] (eleven)
[0128] in, Indicates absolute phase. This represents the cumulative phase offset of the seed point p; This represents the value of the independent variable that minimizes the objective function.
[0129] In this embodiment, the phase difference is limited to a certain value using Formula 10. Between these, then using Formula 11, subtract the cumulative phase offset from the phase difference, and finally select an appropriate integer. To compensate for the absolute phase, an appropriate integer This is the candidate integer ambiguity of the neighborhood point q.
[0130] It is understandable that, according to Formula 11 and Formula 1, assuming the wrapping phase of the seed point p has been correctly unwrapped (i.e., the phase difference equals the cumulative phase offset plus...), ),but The solution became This ensures that the phase value of the neighboring point q is also close to the true value.
[0131] Among them, for It comes from the following calculation process:
[0132] According to Formula 1, its transformation can be obtained, that is... For the seed point p, then we have Substituting into Formula 11, we get:
[0133]
[0134] That is:
[0135]
[0136] in, Since it is a known quantity, therefore, Depend on Decide.
[0137] It should be noted that by establishing integer ambiguity constraints, the actual phase difference is guaranteed to be consistent with... A linear combination should approximate the true value, at which point... The integer that minimizes the difference between the theoretical and observed values should be chosen. This means determining the candidate integer ambiguity for each neighborhood point q. And the fundamental values for achieving smooth local phase transition. Here, smooth local phase transition refers to the difference in absolute phase between adjacent pixels. It should reflect real physical changes (such as gradual height changes), rather than pseudo-jumps caused by wrapping operations.
[0138] It should be noted that after stage one, i.e., after obtaining the candidate integer ambiguity, since all pixels can be divided into different quality regions based on their quality values using the quality map-guided method, the candidate integer ambiguity can be used for unwrapping operations in appropriate quality regions, rather than globally. That is, the above-mentioned unwrapping of the first pixel value of a pixel in the phase map based on the quality map to obtain the absolute phase includes: determining the target calculation strategy corresponding to the target integer ambiguity based on the second pixel value of the pixel in the quality map; the second pixel value is the quality value; calculating the target integer ambiguity corresponding to the pixel based on the target calculation strategy; and unwrapping the first pixel value based on the target integer ambiguity to obtain the absolute phase.
[0139] That is, for pixels divided into different quality regions, the integer ambiguity used when unwrapping the phase may have different calculation strategies. In other words, the target integer ambiguity corresponding to the high-quality region and the target integer ambiguity corresponding to the low-quality region have different target calculation strategies. For example, in the low-quality region, the stripe level is used as the target integer ambiguity; while in the high-quality region, in order to ensure phase continuity, the candidate integer ambiguity is used as the target integer ambiguity.
[0140] For Phase Two:
[0141] The dual constraint refers to dividing the quality region using two quality thresholds, rather than using a single quality threshold. Specifically, based on the second pixel value of a pixel in the quality image, the target calculation strategy corresponding to the target integer ambiguity is determined, including: determining a first quality threshold and a second quality threshold; the first quality threshold being less than the second quality threshold; dividing the pixel into corresponding regions based on the second pixel value of the pixel in the quality image using the first and second quality thresholds; and using the calculation strategy corresponding to the corresponding region as the target calculation strategy for the target integer ambiguity; wherein the corresponding region includes a first region, a second region, and a third region; and the quality value range corresponding to the first region is... The range of quality values corresponding to the second region is: The range of the quality value corresponding to the third region is: The As the first quality threshold, the This is the second quality threshold.
[0142] The first region is a low-quality region, the second region is a transitional region, and the third region is a high-quality region. and The settings can be adjusted as needed; this embodiment does not impose specific limitations.
[0143] For example, the 30 / 70 rule can be used to establish dual constraints, i.e. , .
[0144] like Figure 6 As shown, Figure 6 This is a quality histogram. , .
[0145] It should be noted that the division in this embodiment is based on experience, as detailed below:
[0146] First, establish a general range, such as a low-quality threshold of 0.4 and a high-quality threshold of 0.75. The purpose of establishing this range is to ensure that the subsequent calculation process does not deviate from common sense.
[0147] Secondly, based on the actual quality value distribution in the quality map, the optimal threshold is dynamically calculated to ensure that the pixel ratio of different quality areas is roughly balanced.
[0148] It should be noted that the dynamic adjustment mechanism makes the algorithm more adaptive, and can automatically find a suitable threshold according to the reflection characteristics of different scenes and object surfaces, without having to manually set it for each group of images.
[0149] The adaptive calculation process of the dynamic adjustment mechanism is as follows:
[0150] First, calculate the histogram of the quality map and count the frequency of the quality value of each pixel. The overall quality distribution of the entire image can be obtained through the quality histogram.
[0151] Secondly, calculate the cumulative distribution function, which represents the percentage of pixels with a quality value less than or equal to a certain quality value out of the total number of pixels. For example, if the cumulative distribution function value is 20%, the calculated quality value is 0.28, which means that 20% of the pixels in the image have a quality value less than or equal to 0.28.
[0152] Next, the most crucial step is determining a dynamic threshold based on percentile values, i.e., the cumulative distribution function (CDF). The algorithm uses percentiles to find the dynamic threshold in reverse, rather than using a pre-defined value to classify the quality map. Specifically, a percentage is first determined, and then the corresponding quality value is found as the threshold based on this percentage. For low-quality thresholding, a target percentage for low-quality regions is first set (e.g., classifying the worst 20% of pixels as low-quality regions). Then, the calculated CDF value is looked up to find the critical value where exactly 20% of pixels have a quality score below this. For high-quality region thresholding, a target percentage is similarly set, and then the CDF value is used as the critical value.
[0153] The set target percentage enables pixels in the divided region to be distributed more evenly in the image, making the algorithm for calculating the wrapping phase more stable and reliable when facing different lighting and object surfaces.
[0154] In one embodiment, the target percentage for low-quality regions is 20%, the target percentage for high-quality regions is 20%, and the target percentage for transition regions is 60%.
[0155] The decision model is calculated using the following formula:
[0156] (twelve)
[0157] in, This represents the mass value calculated using any of the methods described in the above embodiments. ; The weighting factor is calculated using the following formula (xiii):
[0158] (Thirteen)
[0159] in, Let q be the boundary confidence of the neighboring point q.
[0160] In summary, for this decision model, in low-quality regions, phase unfolding will rely on global information from Gray code; in high-quality regions, phase unfolding will ensure local phase continuity; and in transitional regions, phase unfolding will be performed using an adaptive weighted approach.
[0161] It should be noted that by setting dual constraints, the precision of the mass region division is improved, which can enhance the accuracy of absolute phase calculation when dealing with complex surfaces.
[0162] In some embodiments, after a certain number of unwrapping operations are completed, i.e., when the number of unwrapped pixels reaches a preset number, the density of the boundary pixels can be determined, and the absolute phase of the unwrapped pixels can be corrected based on the density; or, when the boundary sampling density is greater than a preset density threshold, the density of the boundary pixels can be determined, and the absolute phase of the unwrapped pixels can be corrected based on the density.
[0163] The preset number is based on the total number of pixels in the phase map. Reaching the preset number means that the proportion of pixels that have completed unwrapping reaches a preset percentage. For example, if the preset percentage is 10%, then the density of boundary pixels is determined every time 10% of the pixels have completed the unwrapping operation.
[0164] Boundary sampling density can be calculated using fringe series or phase derivatives, reflecting the concentrated distribution of pixels at object edges or transition edges. Boundary sampling density is positively correlated with the number of boundary pixels.
[0165] Boundary pixels refer to pixels in areas with more noise, reflection, etc. Therefore, if the density exceeds the preset density threshold, it indicates that the boundary pixels are too dense, and the phase difference of the currently unwrapped pixels is likely to be calculated incorrectly, resulting in an absolute phase error.
[0166] Specifically, if the density is greater than or equal to a preset density threshold, the absolute phase of the unwrapped pixels is corrected; if the density is less than the preset density threshold, the absolute phase of the unwrapped pixels is not corrected. The preset density threshold is an empirical value.
[0167] The correction can be achieved by smoothing the area containing the currently unwrapped pixels using a filtering algorithm.
[0168] like Figure 7 As shown, it is an unwrapped phase diagram, i.e., an absolute phase diagram. Figure 7 The continuous color transition in the middle indicates correct phase unfolding and no period confusion. Furthermore, the fringe order in the high-phase region relies on the Gray code, and in... Figure 7 The presence of a clear edge between the tested object and the background also indicates that the boundary confidence effectively suppressed boundary blurring.
[0169] In one exemplary embodiment, such as Figure 8 As shown, the present invention also provides a phase unfolding method. The implementation methods for each process step can be referred to the implementation methods of the above embodiments, and will not be repeated here. The regional consistency check refers to the above-mentioned correction process.
[0170] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0171] Based on the same inventive concept, embodiments of the present invention also provide a phase unfolding apparatus for implementing the phase unfolding method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more phase unfolding apparatus embodiments provided below can be found in the limitations of the phase unfolding method described above, and will not be repeated here.
[0172] In one exemplary embodiment, such as Figure 9 As shown, a phase unfolding device is provided, comprising: a first determining module 100, a second determining module 200, a calculation module 300, and an unwrapping module 400, wherein:
[0173] The first determining module 100 is used to determine the fringe level, basic index and phase map; the fringe level is obtained by decoding the Gray code pattern and the phase map is calculated by the sinusoidal grating pattern.
[0174] The second determining module 200 is used to determine the first indicator value of the supplementary indicator corresponding to the stripe level and the second indicator value of the basic indicator.
[0175] The calculation module 300 is used to obtain a quality map based on the first index value, the second index value and the phase map.
[0176] The unwrapping module 400 is used to unwrap the first pixel value of the pixel point in the phase map based on the quality map to obtain the absolute phase; the first pixel value is the wrapped phase.
[0177] Optionally, the computing module 300 is specifically used for:
[0178] A third index value for phase gradient consistency is determined; the phase gradient consistency is used to measure the continuity of gradient directions between pixels in the phase map.
[0179] The calculation parameters carried by the phase map are determined, and the quality value corresponding to the pixel is calculated based on the calculation parameters, the first index value, the second index value and the third index value to obtain the quality map.
[0180] Optionally, the computing module 300 is also used for:
[0181] The weights corresponding to the first indicator value, the second indicator value, and the third indicator value are determined respectively to obtain the first weight, the second weight, and the third weight; the first weight is greater than the second weight and the third weight.
[0182] Based on the calculation parameters, the first index value, the second index value, the third index value, and the weight, the quality value corresponding to the pixel is calculated to obtain a quality map.
[0183] Optionally, the unpacking module 400 is specifically used for:
[0184] Based on the second pixel value of the pixel in the quality image, the target calculation strategy corresponding to the target integer ambiguity is determined; the second pixel value is the quality value.
[0185] The target integer ambiguity corresponding to the pixel is calculated based on the target calculation strategy.
[0186] The first pixel value is unwrapped based on the target integer ambiguity to obtain the absolute phase.
[0187] Optionally, the unpacking module 400 is also used for:
[0188] A first quality threshold and a second quality threshold are determined; the first quality threshold is less than the second quality threshold.
[0189] Using the first quality threshold and the second quality threshold, the pixel is divided into a corresponding region based on the second pixel value of the pixel in the quality image.
[0190] The calculation strategy corresponding to the corresponding region is used as the target calculation strategy corresponding to the target integer ambiguity.
[0191] The corresponding regions include a first region, a second region, and a third region; the range of the quality value corresponding to the first region is as follows: The range of quality values corresponding to the second region is: The range of the quality value corresponding to the third region is: The As the first quality threshold, the This is the second quality threshold.
[0192] Optionally, the unpacking module 400 is also used for:
[0193] When the target calculation strategy is the calculation strategy corresponding to the first region:
[0194] The stripe level is used as the target integer blur level corresponding to the pixel.
[0195] Optionally, the unpacking module 400 is also used for:
[0196] The pixel with the highest quality value in the quality map is identified as the seed point.
[0197] Based on the seed point, a neighborhood expansion is performed on the quality map to obtain the neighboring points corresponding to the seed point.
[0198] Based on the first pixel value, the phase difference between the neighboring point and the seed point is calculated; the phase difference is less than π.
[0199] Candidate integer ambiguities are calculated based on the phase difference.
[0200] When the target calculation strategy is the calculation strategy corresponding to the third region:
[0201] The candidate integer ambiguity is used as the target integer ambiguity corresponding to the pixel.
[0202] Alternatively, if the target computation strategy is the computation strategy corresponding to the second region:
[0203] Determine the weighting factors.
[0204] The target integer ambiguity corresponding to the pixel is calculated based on the candidate integer ambiguity, the stripe level, and the weighting factor.
[0205] Optionally, the phase unfolding device further includes:
[0206] The third determining module is used to determine the density of boundary pixels when the number of unwrapped pixels reaches a preset number, or when the boundary sampling density is greater than a preset density threshold.
[0207] The correction module is used to correct the absolute phase of the unwrapped pixels if the density is greater than or equal to a preset density threshold.
[0208] Each module in the aforementioned phase unfolding device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0209] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a phase unfolding method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0210] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0211] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0212] Determine the fringe order, basic indicators, and phase diagram; the fringe order is obtained by decoding the Gray code pattern, and the phase diagram is calculated by a sinusoidal grating pattern.
[0213] Determine the first index value of the supplementary index corresponding to the stripe level and the second index value of the basic index;
[0214] A quality map is obtained based on the first index value, the second index value, and the phase map;
[0215] Based on the quality map, the first pixel value of the pixel in the phase map is unwrapped to obtain the absolute phase; the first pixel value is the wrapped phase.
[0216] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0217] A third metric value for phase gradient consistency is determined; the phase gradient consistency is used to measure the continuity of gradient directions between pixels in the phase image.
[0218] The calculation parameters carried by the phase map are determined, and the quality value corresponding to the pixel is calculated based on the calculation parameters, the first index value, the second index value and the third index value to obtain the quality map.
[0219] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0220] The weights corresponding to the first indicator value, the second indicator value, and the third indicator value are determined respectively to obtain a first weight, a second weight, and a third weight; the first weight is greater than the second weight and the third weight.
[0221] Based on the calculation parameters, the first index value, the second index value, the third index value, and the weight, the quality value corresponding to the pixel is calculated to obtain a quality map.
[0222] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0223] Based on the second pixel value of the pixel in the quality image, the target calculation strategy corresponding to the target integer ambiguity is determined; the second pixel value is the quality value.
[0224] The target integer ambiguity corresponding to the pixel is calculated based on the target calculation strategy.
[0225] The first pixel value is unwrapped based on the target integer ambiguity to obtain the absolute phase.
[0226] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0227] Determine a first mass threshold and a second mass threshold; the first mass threshold is less than the second mass threshold.
[0228] Using the first quality threshold and the second quality threshold, the pixel is divided into a corresponding region based on the second pixel value of the pixel in the quality image;
[0229] The calculation strategy corresponding to the corresponding region is taken as the target calculation strategy corresponding to the target integer ambiguity;
[0230] The corresponding regions include a first region, a second region, and a third region; the range of the quality value corresponding to the first region is as follows: The range of quality values corresponding to the second region is: The range of the quality value corresponding to the third region is: The As the first quality threshold, the This is the second quality threshold.
[0231] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0232] When the target calculation strategy is the calculation strategy corresponding to the first region:
[0233] The stripe level is used as the target integer blur level corresponding to the pixel.
[0234] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0235] The pixel with the highest quality value in the quality image is identified as the seed point.
[0236] Based on the seed point, a neighborhood expansion is performed on the quality map to obtain the neighboring points corresponding to the seed point.
[0237] Based on the first pixel value, the phase difference between the neighboring point and the seed point is calculated; the phase difference is less than π.
[0238] Candidate integer ambiguities are calculated based on the phase difference;
[0239] The calculation of the target integer blur degree corresponding to the pixel based on the target calculation strategy includes:
[0240] When the target calculation strategy is the calculation strategy corresponding to the third region:
[0241] Use the candidate integer ambiguity as the target integer ambiguity corresponding to the pixel; or...
[0242] When the target calculation strategy is the calculation strategy corresponding to the second region:
[0243] Determine the weighting factors;
[0244] The target integer ambiguity corresponding to the pixel is calculated based on the candidate integer ambiguity, the stripe level, and the weighting factor.
[0245] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0246] If the number of unwrapped pixels reaches a preset number, or if the boundary sampling density is greater than a preset density threshold, determine the density of the boundary pixels.
[0247] If the density is greater than or equal to a preset density threshold, then the absolute phase of the unwrapped pixels is corrected.
[0248] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0249] Determine the fringe order, basic indicators, and phase diagram; the fringe order is obtained by decoding the Gray code pattern, and the phase diagram is calculated by a sinusoidal grating pattern.
[0250] Determine the first index value of the supplementary index corresponding to the stripe level and the second index value of the basic index;
[0251] A quality map is obtained based on the first index value, the second index value, and the phase map;
[0252] Based on the quality map, the first pixel value of the pixel in the phase map is unwrapped to obtain the absolute phase; the first pixel value is the wrapped phase.
[0253] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0254] A third metric value for phase gradient consistency is determined; the phase gradient consistency is used to measure the continuity of gradient directions between pixels in the phase image.
[0255] The calculation parameters carried by the phase map are determined, and the quality value corresponding to the pixel is calculated based on the calculation parameters, the first index value, the second index value and the third index value to obtain the quality map.
[0256] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0257] The weights corresponding to the first indicator value, the second indicator value, and the third indicator value are determined respectively to obtain a first weight, a second weight, and a third weight; the first weight is greater than the second weight and the third weight.
[0258] Based on the calculation parameters, the first index value, the second index value, the third index value, and the weight, the quality value corresponding to the pixel is calculated to obtain a quality map.
[0259] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0260] Based on the second pixel value of the pixel in the quality image, the target calculation strategy corresponding to the target integer ambiguity is determined; the second pixel value is the quality value.
[0261] The target integer ambiguity corresponding to the pixel is calculated based on the target calculation strategy.
[0262] The first pixel value is unwrapped based on the target integer ambiguity to obtain the absolute phase.
[0263] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0264] Determine a first mass threshold and a second mass threshold; the first mass threshold is less than the second mass threshold.
[0265] Using the first quality threshold and the second quality threshold, the pixel is divided into a corresponding region based on the second pixel value of the pixel in the quality image;
[0266] The calculation strategy corresponding to the corresponding region is taken as the target calculation strategy corresponding to the target integer ambiguity;
[0267] The corresponding regions include a first region, a second region, and a third region; the range of the quality value corresponding to the first region is as follows: The range of quality values corresponding to the second region is: The range of the quality value corresponding to the third region is: The As the first quality threshold, the This is the second quality threshold.
[0268] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0269] When the target calculation strategy is the calculation strategy corresponding to the first region:
[0270] The stripe level is used as the target integer blur level corresponding to the pixel.
[0271] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0272] The pixel with the highest quality value in the quality image is identified as the seed point.
[0273] Based on the seed point, a neighborhood expansion is performed on the quality map to obtain the neighboring points corresponding to the seed point.
[0274] Based on the first pixel value, the phase difference between the neighboring point and the seed point is calculated; the phase difference is less than π.
[0275] Candidate integer ambiguities are calculated based on the phase difference;
[0276] The calculation of the target integer blur degree corresponding to the pixel based on the target calculation strategy includes:
[0277] When the target calculation strategy is the calculation strategy corresponding to the third region:
[0278] Use the candidate integer ambiguity as the target integer ambiguity corresponding to the pixel; or...
[0279] When the target calculation strategy is the calculation strategy corresponding to the second region:
[0280] Determine the weighting factors;
[0281] The target integer ambiguity corresponding to the pixel is calculated based on the candidate integer ambiguity, the stripe level, and the weighting factor.
[0282] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0283] If the number of unwrapped pixels reaches a preset number, or if the boundary sampling density is greater than a preset density threshold, determine the density of the boundary pixels.
[0284] If the density is greater than or equal to a preset density threshold, then the absolute phase of the unwrapped pixels is corrected.
[0285] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided by this invention can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided by this invention may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided by this invention may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0286] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this invention.
[0287] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A phase unrolling method, characterized in that, The phase unrolling method includes: Determine the fringe order, basic indicators, and phase diagram; the fringe order is obtained by decoding the Gray code pattern, and the phase diagram is calculated by a sinusoidal grating pattern. Determine the first index value of the supplementary index corresponding to the stripe level and the second index value of the basic index; A quality map is obtained based on the first index value, the second index value, and the phase map; Based on the quality map, the first pixel value of the pixel in the phase map is unwrapped to obtain the absolute phase; the first pixel value is the wrapped phase. The step of unwrapping the first pixel value of a pixel in the phase image based on the quality image to obtain the absolute phase includes: determining a target calculation strategy corresponding to a target integer ambiguity based on a second pixel value of a pixel in the quality image; the second pixel value is a quality value; calculating the target integer ambiguity corresponding to the pixel based on the target calculation strategy; and unwrapping the first pixel value based on the target integer ambiguity to obtain the absolute phase. The step of determining the target calculation strategy corresponding to the target integer ambiguity based on the second pixel value of the pixel in the quality image includes: determining a first quality threshold and a second quality threshold; the first quality threshold is less than the second quality threshold; dividing the pixel into corresponding regions based on the second pixel value of the pixel in the quality image using the first quality threshold and the second quality threshold; and using the calculation strategy corresponding to the corresponding region as the target calculation strategy corresponding to the target integer ambiguity; wherein the corresponding region includes a first region, a second region, and a third region; and the range of the quality value corresponding to the first region is... The range of quality values corresponding to the second region is: The range of the quality value corresponding to the third region is: The As the first quality threshold, the This is the second quality threshold.
2. The phase unwrapping method according to claim 1, characterized in that, The process of obtaining the quality map based on the first index value, the second index value, and the phase map includes: A third metric value for phase gradient consistency is determined; the phase gradient consistency is used to measure the continuity of gradient directions between pixels in the phase image. The calculation parameters carried by the phase map are determined, and the quality value corresponding to the pixel is calculated based on the calculation parameters, the first index value, the second index value and the third index value to obtain the quality map.
3. The phase unwrapping method according to claim 2, characterized in that, The step of calculating the quality value corresponding to the pixel based on the calculation parameters, the first index value, the second index value, and the third index value to obtain a quality map includes: The weights corresponding to the first indicator value, the second indicator value, and the third indicator value are determined respectively to obtain a first weight, a second weight, and a third weight; the first weight is greater than the second weight and the third weight. Based on the calculation parameters, the first index value, the second index value, the third index value, and the weight, the quality value corresponding to the pixel is calculated to obtain a quality map.
4. The phase unwrapping method according to claim 1, characterized in that, The calculation of the target integer blur degree corresponding to the pixel based on the target calculation strategy includes: When the target calculation strategy is the calculation strategy corresponding to the first region: The stripe level is used as the target integer blur level corresponding to the pixel.
5. The phase unwrapping method according to claim 1, characterized in that, Before determining the target calculation strategy corresponding to the target integer ambiguity based on the second pixel value of the pixel point in the quality image, the method further includes: The pixel with the highest quality value in the quality image is identified as the seed point. Based on the seed point, a neighborhood expansion is performed on the quality map to obtain the neighboring points corresponding to the seed point. Based on the first pixel value, the phase difference between the neighboring point and the seed point is calculated; the phase difference is less than π. Candidate integer ambiguities are calculated based on the phase difference; The calculation of the target integer blur degree corresponding to the pixel based on the target calculation strategy includes: When the target calculation strategy is the calculation strategy corresponding to the third region: Use the candidate integer ambiguity as the target integer ambiguity corresponding to the pixel; or... When the target calculation strategy is the calculation strategy corresponding to the second region: Determine the weighting factors; The target integer ambiguity corresponding to the pixel is calculated based on the candidate integer ambiguity, the stripe level, and the weighting factor.
6. The phase unwrapping method according to claim 1, characterized in that, The method further includes: If the number of unwrapped pixels reaches a preset number, or if the boundary sampling density is greater than a preset density threshold, determine the density of the boundary pixels. If the density is greater than or equal to a preset density threshold, then the absolute phase of the unwrapped pixels is corrected.
7. A computer device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the phase unfolding method as described in any one of claims 1-6.
8. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the phase unrolling method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method for detecting and correcting unpacking phase error based on phase distribution
CN110793463A
Quick large-range phase unwrapping method based on double reference planes
CN111524173A