Phase unwrapping method, computer equipment and readable storage medium
By introducing Gray code patterns and supplementary index values to calculate the quality map, the quality map guidance method was improved, which solved the problem of inaccurate pixel quality values in boundaries, low-texture and high-reflective areas, improved the accuracy of absolute phase, and thus improved the accuracy of structured light 3D reconstruction.
Patent Information
- Application Number
- CN202511211541.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-28
AI Technical Summary
The absolute phase obtained by solving the wrapped phase using the existing quality map guidance method is not accurate enough, resulting in inaccurate structured light 3D reconstruction results. This is mainly due to inaccurate calculation of pixel quality values in boundary areas, low-texture areas, and highly reflective areas.
The quality map is calculated by introducing the fringe order and supplementary index value of the Gray code pattern. The quality map guidance method is improved by combining the phase map with boundary confidence, phase derivative variance, modulation information and phase gradient consistency to ensure the continuity and accuracy of the phase unwrapping path.
The accuracy of the absolute phase is improved, thereby improving the accuracy of the reconstruction results of structured light 3D reconstruction, especially in the processing of boundaries, low texture and high reflective areas.
Smart Images

Figure CN120740499A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of structured light three-dimensional reconstruction, and in particular relates to a phase unwrapping method, a computer device and a readable storage medium. Background Art
[0002] Structured light 3D reconstruction is a non-contact measurement method for the three-dimensional shape of objects that has emerged in recent years. Due to its advantages such as non-contact, high reconstruction accuracy, dense point cloud and low cost, it has been widely used in industrial inspection, consumer electronics, virtual reality, augmented reality, cultural relics protection and medical equipment in recent years.
[0003] The content related to structured light three-dimensional reconstruction is based on the structured light vision measurement system, wherein the structured light vision measurement system is usually composed of a projector, a camera, a computer and an object to be measured. The basic reconstruction process includes: a set of sinusoidal grating patterns or some auxiliary patterns are generated by a computer, projected onto the surface of the object to be measured by a projector, the image of the object to be measured is collected by a camera, and then the camera uploads these images to the computer. The computer performs phase resolution and phase-height mapping on the collected images, and the three-dimensional morphology of the object to be measured can be reconstructed by combining the internal and external parameters of the camera and projector. Among them, the process of performing phase resolution on the image is specifically: calculating the phase map from the image, and then performing phase resolution based on the phase map. It should be noted that the phase directly obtained from the phase map will be in The phase between the two phases is called the wrapped phase and is determined by the phase calculation formula. The phase required for reconstruction is the absolute phase. Therefore, an unwrapping operation is required to expand the wrapped phase into a continuous phase, that is, the absolute phase.
[0004] Phase calculation based on a quality map has become a mainstream approach in phase unwrapping algorithms. This approach defines a quality map to assess the reliability or quality of the unwrapping path for each pixel in the phase image, and uses this map as a guide to determine the unwrapping process order. However, the absolute phase obtained by using the current quality map-guided method to calculate the wrapped phase 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 the embodiments of the present invention is to provide a phase unwrapping method, a computer device and a readable storage medium, which can solve the problem of how to improve the accuracy of the absolute phase obtained by solving the wrapped phase through the quality map guidance method, thereby improving the accuracy of the reconstruction result of structured light three-dimensional reconstruction through the absolute phase.
[0006] In order to solve the above-mentioned technical problems, the present invention is achieved as follows: In a first aspect, an embodiment of the present invention provides a phase unwrapping method, the method comprising: Determining fringe levels, basic indicators, and a phase map; the fringe levels are obtained by decoding a Gray code pattern, and the phase map is obtained by calculating a sinusoidal grating pattern; Determine a first index value of a 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; The first pixel value of the pixel point in the phase map is unwrapped based on the quality map to obtain the absolute phase; the first pixel value is the wrapped phase.
[0007] In a second aspect, an embodiment of the present invention provides a computer device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0008] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present invention further provides a computer program product, comprising a computer program, which implements the steps of the method described in the first aspect when executed by a processor.
[0010] In an embodiment of the present invention, a phase unwrapping method is proposed, which solves the above-mentioned problem through the following steps: determining a fringe order, a basic index and a phase map; the fringe order is obtained by decoding a Gray code pattern, and the phase map is obtained by calculating a sinusoidal grating pattern; determining a first index value of a supplementary index corresponding to the fringe order 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 a first pixel value of a pixel point in the phase map based on the quality map to obtain an absolute phase; the first pixel value is the wrapped phase. Among them, for the boundary area, since the decoding of the Gray code pattern only depends on the light and dark jumps of the stripes, even in the boundary area, the light and dark jumps will not be affected by the background interference, so it will have a clear integer jump in the boundary area (such as the stripe level jumps from k to k+1); for the low-texture area, since the Gray code is a binary stripe with only black and white colors, its contrast on the low-texture surface is much higher than that of the sinusoidal stripe, and a high signal-to-noise ratio can be maintained. At this time, the first index value can accurately guide the division of the quality area of the pixel points in this low-texture area; for the high-reflective area, since the decoding of the Gray code pattern only depends on the light and dark jumps of the stripes, it does not require the precise calculation of the grayscale value, that is, the calculation of the first index value is not affected by whether it is reflective, thereby avoiding the incorrect division of pixels in the high-reflective area into the low-quality area. In summary, by introducing the Gray code fringe level when calculating the quality value and calculating the quality value by the first indicator value of the supplementary indicator corresponding to the fringe level, the difficulty in selecting the phase unwrapping path or the interruption of the phase unwrapping path is avoided, and the phase unwrapping path is made continuous, thereby improving the accuracy of the absolute phase solved by the quality map guidance method, and further improving the accuracy of the reconstruction result of the structured light three-dimensional reconstruction using the absolute phase. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A Gray code pattern according to some embodiments of the present invention; Figure 2 A sinusoidal grating pattern according to some embodiments of the present invention; Figure 3 An original phase image provided for some embodiments of the present invention; Figure 4 A schematic flow chart of a phase unwrapping method provided in some embodiments of the present invention; Figure 5 A quality map is provided for some embodiments of the present invention; Figure 6 A quality histogram is provided for some embodiments of the present invention; Figure 7 An unwrapped phase diagram is provided for some embodiments of the present invention; Figure 8Another schematic flow chart of a phase unwrapping method provided in some embodiments of the present invention; Figure 9 A structural block diagram of a phase unwrapping device provided in some embodiments of the present invention; Figure 10 A diagram of the internal structure of a computer device provided for some embodiments of the present invention. DETAILED DESCRIPTION
[0012] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0013] The terms "first," "second," and the like in the specification and claims of the present invention are used to distinguish similar objects and are not intended to describe a particular order or precedence. It should be understood that such terms are interchangeable where appropriate, so that embodiments of the present invention can be implemented in sequences other than those illustrated or described herein. Furthermore, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the connected objects are in an "or" relationship.
[0014] To facilitate understanding of the technical solutions described in the present invention, the following technical terms that may be involved in the present invention are explained: Gray code: It is a binary encoding method. Its core feature is that any two adjacent codes differ by only one binary digit.
[0015] Gray code pattern: Figure 1 As shown, it is a binary stripe pattern based on Gray code. The binary stripe pattern has only two colors, black and white, that is, a pattern of alternating light and dark.
[0016] Sinusoidal grating: A grating whose transmittance or reflectance varies sinusoidally in one direction.
[0017] Sinusoidal grating pattern: such as Figure 2 As shown, an optical pattern with a sinusoidal wave intensity distribution is projected onto the surface of the object to be measured by a projector. After the camera captures the image of the object to be measured, the phase map is calculated from the sinusoidal grating pattern in the image through phase measurement technology.
[0018] Phase image: It is a two-dimensional phase data matrix obtained from the image through phase measurement technology, reflecting the surface height of the object being measured. Its core feature is to encode the morphology of the object being measured with phase values.
[0019] Jump: A phase discontinuity caused by a sudden change in the true height of the surface of the measured object (such as a step area or edge area), which is called a 2π jump.
[0020] Integer ambiguity: In structured light 3D reconstruction, phase resolution is usually based on phase encoding methods. However, since the phase of the image collected by the camera is in the range of The wrapped phase is therefore unwrapped to recover the true absolute phase. The integer ambiguity is used to resolve the wrapped phase using the following formula: (one) in, is the absolute phase, is the wrapping phase, is an integer ambiguity.
[0021] Among them, such as Figure 3 As shown, the phase image of the wrapped phase is the original phase image calculated based on the input phase-shifted image. Figure 3 The fringe pattern projected onto the object under test is composed of a gradient of blue → green → yellow → orange → red, representing the value of the wrapped phase from low to high (a periodic change from -π to π), that is, blue represents low phase and red represents high phase. Figure 3 The densely packed dots with no color variation are noise, which is usually caused by highly reflective surfaces or shadows.
[0022] High-quality areas: Areas with higher quality values in the quality map.
[0023] Low Quality Areas: Areas in the quality map with low quality values.
[0024] Errors: The main sources include noise interference, phase discontinuity and ambiguity of the wrapped phase, which mainly occur in low-quality regions.
[0025] Error propagation: When calculating the absolute phase of the current pixel, the integer ambiguity may be erroneous, causing the absolute phase to deviate from the true value and generate an error. When the wrapped phase of the adjacent pixel is subsequently calculated using the current pixel, the erroneous integer ambiguity will be used in the calculation. Therefore, the error will be transmitted from the current pixel to the adjacent pixel, and then continue from the adjacent pixel to other pixels whose absolute phase has not been solved.
[0026] Quality map-guided method: The pixels in the quality map are divided into high-quality areas and low-quality areas. The wrapped phase of the pixels in the high-quality area is solved first, and then the wrapped phase of the pixels in the low-quality area is solved, so as to avoid the error generated when solving the low-quality area from propagating to the high-quality area.
[0027] Phase unwrapping path: The path formed by connecting the pixels that are passed through when solving the wrapped phase using the quality map-guided method. Solving the wrapped phase is the phase unwrapping process.
[0028] As mentioned in the background of the structured light 3D reconstruction process, this invention solves the wrapped phase based on the quality map guidance method. This method has significant advantages in solving the unwrapping problem of complex phase maps. The advantages are as follows: First, the method can effectively suppress error propagation and improve unwrapping accuracy. This method prioritizes high-quality areas and expands them to adjacent high-quality areas, minimizing unwrapping errors in the early stages and preventing errors from spreading from the current solved pixel to subsequent pixels.
[0029] Secondly, this method enhances the robustness of the phase unwrapping algorithm. Specifically, camera-acquired images often suffer from severe noise, local undersampling, and phase discontinuities caused by geometric or material variations. This method is more stable in the face of local perturbations such as noise and shadows, making it less likely that these localized issues will cause the unwrapping process to crash.
[0030] Finally, the method has high computational efficiency, that is, prioritizing high-quality areas usually means prioritizing pixels that are least prone to unwrapping errors and require the least backtracking or correction, which can avoid invalid attempts or erroneous calculations in low-quality areas.
[0031] However, the absolute phase obtained by solving the phase using the current quality map guidance method is not accurate enough, resulting in inaccurate reconstruction results of structured light 3D reconstruction using the absolute phase.
[0032] To address this issue, the applicant discovered that the problem is primarily caused by inaccurately calculating the absolute phase of pixels in boundary, low-texture, and high-reflectivity regions of the image. Boundary regions refer to the transition between the object being measured and the background; low-texture regions are those containing the low-texture surface (i.e., a surface lacking texture features) of the object being measured; and high-reflectivity regions are those containing the high-reflectivity surface of the object being measured. High-reflectivity surfaces can cause overexposure or oversaturation in the image captured by the camera.
[0033] It should be noted that current methods for calculating quality maps typically use basic metrics as parameters when calculating the quality values of pixels in the boundary area. These metrics include, but are not limited to, phase derivative variance and modulation information. Phase derivative variance quantifies the smoothness of local phase variations and is positively correlated with noise intensity; modulation information reflects the signal-to-noise ratio.
[0034] It should reflect the jump, but due to noise, shadow, reflection and other reasons, it cannot reflect the jump through the phase derivative variance. The calculated variance is small and the quality value is high. Boundary regions often have low signal-to-noise ratios and high probability of jumps due to background interference. However, current methods for calculating quality maps fail to accurately reflect the low signal-to-noise ratio and jumps when calculating the quality values of pixels in these boundary regions. Consequently, due to inaccurate quality calculations, pixels in these boundary regions often cannot be accurately classified into quality regions, making phase unwrapping path selection difficult and prone to errors.
[0035] Among them, for low-texture areas, the fringe contrast is low, resulting in excessive phase calculation noise, the wrapped phase is submerged by the noise, the quality map cannot distinguish between real signals and noise signals, making the phase unwrapping path selection difficult and prone to errors.
[0036] Among them, for highly reflective areas, due to overexposure or oversaturation of pixels, the current method of calculating the quality map often obtains a quality value that is smaller than the true value when calculating the quality value of the pixel points in the highly reflective area, which will cause the pixel points in the highly reflective area to be mistakenly divided into a low-quality area, resulting in interruption of the phase unwrapping path or difficulty in selecting the phase unwrapping path, which is prone to introducing errors.
[0037] In summary, the quality values of pixels in boundary areas, low-texture areas, or high-reflection areas calculated using current methods for calculating quality maps often become unreliable due to noise, shadows, lack of texture features, or reflection issues in the image. That is, in boundary areas, low-texture areas, and high-reflection areas, the quality values calculated using basic indicators are often inaccurate, causing pixels to be incorrectly classified as high-quality areas or low-quality areas when using the quality map guidance method, resulting in difficulty in selecting a phase unwrapping path or interruption in the phase unwrapping path. Difficulty selecting a phase unwrapping path or interruption in the phase unwrapping path can lead to discontinuity in the phase unwrapping path, resulting in lower accuracy of the absolute phase calculated using the quality map guidance method, and further resulting in lower accuracy in the reconstruction results of structured light 3D reconstruction using the absolute phase.
[0038] Based on this, Figure 4As shown, in an exemplary embodiment, the present invention proposes a phase unwrapping method, which solves the above-mentioned problem through the following steps: determining a fringe order, a basic index and a phase map; the fringe order is obtained by decoding a Gray code pattern, and the phase map is obtained by calculating a sinusoidal grating pattern; determining a first index value of a supplementary index corresponding to the fringe order 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 a first pixel value of a pixel point in the phase map based on the quality map to obtain an absolute phase; wherein the quality map is obtained by replacing the pixel value of a pixel point in the phase map from a first pixel value to a second pixel value, the first pixel value is a wrapped phase, and the second pixel value is a quality value. Among them, for the boundary area, since the decoding of the Gray code pattern only depends on the light and dark jumps of the stripes, even in the boundary area, the light and dark jumps will not be affected by the background interference, so it will have a clear integer jump in the boundary area (such as the stripe level jumps from k to k+1); for the low-texture area, since the Gray code is a binary stripe with only black and white colors, its contrast on the low-texture surface is much higher than that of the sinusoidal stripe, and a high signal-to-noise ratio can be maintained. At this time, the first index value can accurately guide the division of the quality area of the pixel points in this low-texture area; for the high-reflective area, since the decoding of the Gray code pattern only depends on the light and dark jumps of the stripes, it does not require the precise calculation of the grayscale value, that is, the calculation of the first index value is not affected by whether it is reflective, thereby avoiding the incorrect division of pixels in the high-reflective area into the low-quality area. In summary, by introducing the Gray code fringe level when calculating the quality value and calculating the quality value by the first indicator value of the supplementary indicator corresponding to the fringe level, the difficulty in selecting the phase unwrapping path or the interruption of the phase unwrapping path is avoided, and the phase unwrapping path is made continuous, thereby improving the accuracy of the absolute phase solved by the quality map guidance method, and further improving the accuracy of the reconstruction result of the structured light three-dimensional reconstruction using the absolute phase.
[0039] The following describes the various steps of the method. Figure 4 The method includes steps 402 to 408. Step 402, determining the fringe order, basic index and phase diagram; the fringe order is obtained by decoding the Gray code pattern, and the phase diagram is obtained by calculating the sinusoidal grating pattern.
[0040] Step 404: Determine a first index value of the supplementary index corresponding to the stripe level and a second index value of the basic index.
[0041] Among them, the supplementary index corresponding to the fringe level is the boundary confidence, and the first index value is calculated by the following formula 2: (two) in, The gradient representing the fringe level; Indicates sharpness, which is a configurable constant and its value range is [0.5-1.5]; represents the natural exponential function, that is, the exponential function with e as the base; x Represents the horizontal coordinate of a pixel, y Indicates the vertical coordinate of the pixel.
[0042] The second index value corresponding to the phase derivative variance is calculated using the following formula 3: (three) in, Represents the first-order difference of the phase of a pixel in the x direction, Represents the first-order difference of phase in the y direction, which is the phase gradient; Represents the variance within a local window on the phase map.
[0043] in, and Calculated by the following formula 4: (Four) The second index value corresponding to the modulation index information is calculated using the following formula 5: (five) in, , , Indicates the signal value of a pixel.
[0044] Step 406: Obtain a quality map based on the first indicator value, the second indicator value, and the phase map, wherein there is a correspondence between the second pixel value of the pixel point in the quality map and the first pixel value of the pixel point in the phase map, the first pixel value is the wrapped phase, and the second pixel value is the quality value.
[0045] The corresponding relationship means that the second pixel value is calculated by the first pixel value, and the coordinates of the pixel point corresponding to the second pixel value in the quality map are the same as the coordinates of the pixel point corresponding to the first pixel value in the phase map.
[0046] The calculation of the quality value includes but is not limited to summation and weighted summation.
[0047] For example, the mass value is calculated by summing, and the mass value can be calculated by the following formula 6: (six) For example, the quality value is calculated as a weighted sum, and the quality value can be calculated using the following formula 7: (seven) in, They respectively represent the weights of the corresponding indicator values, and the specific values are not limited in this embodiment.
[0048] Step 408: Unwrap the first pixel value of the pixel point in the phase map based on the quality map to obtain the absolute phase.
[0049] Unwrapping is performed by a mass map guided method or other methods such as the improved mass map guided method.
[0050] The above completes the description of an embodiment of a phase unwrapping method provided by the present invention.
[0051] In addition, when the object being measured has a complex surface such as a stepped surface, the quality value calculated by the various current indicators cannot accurately distinguish whether some pixel points on the complex surface are real edges or abnormal jumps. In this regard, the applicant's research found that the inability to accurately distinguish is caused by noise or reflective surfaces. Because noise or reflective surfaces can cause gradient confusion, even if the basic indicators include phase derivative variance, the calculated quality value is inaccurate. Among them, the phase derivative variance only measures the degree of discreteness of the local gradient amplitude. Therefore, gradient confusion will cause the phase derivative variance to be unable to be used to accurately distinguish whether some pixel points on the complex surface are real edges or abnormal jumps.
[0052] The gradient direction corresponding to the complex surface, that is, the gradient direction of the pixel value of the pixel point in the phase image corresponding to the complex surface, can avoid the influence of noise or reflective surfaces, thereby accurately distinguishing whether some pixel points in the complex surface are real edges or abnormal jumps, thereby enhancing the edge protection capability.
[0053] Specifically, based on the above embodiments, some embodiments add an indicator used in calculating the quality value—phase gradient consistency—which can measure the continuity of the gradient direction 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 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 to obtain the quality map.
[0054] It should be noted that if the third indicator value reflects poor continuity, the pixel can be determined to be a true edge; if the third indicator value reflects good continuity, the pixel can be determined to be an abnormal transition. Furthermore, increasing phase gradient consistency can also broaden the information used to construct the quality map, thereby improving the accuracy of the quality map.
[0055] The third index value is calculated using the following formula 8: (eight) in, Represents the gradient direction angle of a pixel in the x direction; Indicates the gradient direction angle of the pixel in the y direction; Represents the variance of the gradient direction angle within the local window.
[0056] The calculation of the quality value includes but is not limited to summation and weighted summation.
[0057] Taking the calculation of the quality value as weighted sum as an example, the quality value can be calculated by the following formula 9: (Nine) in, They respectively represent the weights of the corresponding indicator values, and the specific values are not limited in this embodiment.
[0058] 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 point is calculated to obtain a quality map.
[0059] The first weight is , the second weight is and , the third weight is .
[0060] For example is 0.4, 、 and are all 0.2; is 0.5, 、 and They are 0.1, 0.2 and 0.2 respectively.
[0061] It should be emphasized that, according to the calculation formula of the boundary confidence, in the boundary area, because the boundary confidence accounts for a large weight when constructing the quality map, when the jump of the fringe level causes the boundary confidence to drop significantly, the information of the quality map will also drop, that is, the quality value will be smaller. Therefore, when solving the wrapped phase by the quality map guidance method, the boundary area will be divided into a low-quality area; it can be understood that if the first weight is less than the weights corresponding to other indicators, the boundary area may be mistakenly divided into a high-quality area. That is, because this embodiment avoids the mistaken classification of the boundary area as a high-quality area, the wrapped phase corresponding to the boundary area is solved prematurely, resulting in error accumulation. Therefore, the absolute phase solved based on the weight setting method of this embodiment can reduce the error caused by error propagation.
[0062] like Figure 5 As shown, Figure 5 The yellow color represents the high-quality area; the dark vertical line indicates the phase jump edge, which is the low-quality area; the purple background is the low-quality area, which can be regarded as the noise area.
[0063] It should be noted that after obtaining the quality map, it is necessary to filter and normalize the quality map to prepare for the subsequent threshold segmentation (ie, dividing the pixels into regions).
[0064] The above completes the description of the embodiments related to improving the process of obtaining the quality map in the phase unwrapping method provided by the present invention.
[0065] The following is a brief description of the process steps of the quality map guidance method in related technologies: Step 1: Initialize the priority queue.
[0066] Step 2: Determine the pixel with the largest quality value in the quality map as the seed point.
[0067] Step 3: Use the seed point as the current pixel point and execute steps 4 to 6.
[0068] Step 4: Find the integer vector z of the current pixel point through integer least squares estimation, that is, minimize the objective function, thereby obtaining the integer ambiguity.
[0069] Step 5: Unwrap the wrapped phase corresponding to the current pixel using the integer ambiguity to obtain the absolute phase.
[0070] Step 6: Mark the current pixel as expanded and add it to the priority queue, where expanded means that phase expansion has been performed.
[0071] Step 7: Check whether the priority queue is empty.
[0072] Step 8: If the priority queue is empty, end the loop and output the absolute phases of all pixels.
[0073] Step 9: If the priority queue is not empty, the pixel with the highest quality value in the priority queue is taken out without being put back.
[0074] Step 10: Based on the pixel with the highest quality value, perform neighborhood expansion in the quality map to obtain neighborhood points corresponding to the pixel with the highest quality value, wherein the neighborhood points are 4 or 8 neighborhood points.
[0075] Step 11: Determine whether the neighborhood point has been expanded.
[0076] Step 12: If all the neighborhood points have been expanded, return to step 7.
[0077] Step 13: If there is an unexpanded pixel in the neighborhood, the unexpanded pixel is used as the current pixel and the process returns to step 4.
[0078] In some embodiments, with respect to the above step 4, i.e., the step of calculating the integer ambiguity using a fixed calculation strategy, the present invention proposes an improved solution for calculating the integer ambiguity using a dynamically changing calculation strategy.
[0079] The calculation of integer ambiguity through dynamically changing calculation strategies includes two stages: Phase 1: Establish integer ambiguity constraints and obtain candidate integer ambiguities based on the integer ambiguity constraints.
[0080] Phase 2: Establish a dual-constraint decision model and obtain the target integer ambiguity based on the candidate integer ambiguity and the dual-constraint decision model.
[0081] It should be noted that stage 1 and stage 2 can be implemented separately or in combination. For example, if stage 1 is implemented alone, there is a solution in which the candidate integer ambiguity obtained in stage 1 is used as the integer ambiguity obtained in step 4.
[0082] For Phase One: Among them, the integer ambiguity constraint means that the phase difference between two adjacent pixels is less than π, thereby ensuring phase continuity.
[0083] Specifically, 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 map, the method further includes: determining a pixel point with the largest quality value in the quality map as a seed point; performing neighborhood expansion in the quality map based on the seed point to obtain a neighborhood point corresponding to the seed point; calculating a phase difference between the neighborhood point and the seed point based on the first pixel value; and calculating a candidate integer ambiguity based on the phase difference; The phase difference between the neighborhood point q and the seed point p is calculated using the following formula: (ten) in, Represents the wrapping operator, which is used to ensure The value of between, and are the wrapping phases of the neighborhood point q and the seed point p, respectively.
[0084] The candidate integer ambiguity is calculated using the following formula: (eleven) in, represents the absolute phase, represents the cumulative phase offset of the seed point p; Indicates the value of the independent variable that minimizes the objective function.
[0085] In this embodiment, the phase difference is limited to Then, by using formula 11, the phase difference is subtracted from the accumulated phase offset, and finally the appropriate integer is selected. To compensate for the absolute phase, a suitable integer That is the candidate integer ambiguity of the neighborhood point q.
[0086] It can be understood from Formula 11 and Formula 1 that, assuming that the wrapped phase of the seed point p has been correctly unwrapped (that is, the phase difference is equal to the cumulative phase offset plus ),but The solution becomes , so that the phase value of the neighborhood point q is also close to the true value.
[0087] Among them, for , which comes from the following calculation process: According to formula 1, its deformation can be obtained, that is, , for the seed point p, then , substituting into formula 11, we can get: That is: in, is a known quantity, so Depend on Decide.
[0088] It should be noted that by establishing integer ambiguity constraints, the actual phase difference is guaranteed to be The linear combination of should approach the true value, then The integer that minimizes the difference between the theoretical value and the observed value should be selected. That is, the candidate integer ambiguity of each neighborhood point q can be determined And the basic value for achieving local phase smooth transition. Among them, local phase smooth transition refers to the absolute phase difference between adjacent pixels It should reflect real physical changes (such as gradual height changes) rather than pseudo-jumps caused by wrapping operations.
[0089] It should be noted that after stage one, i.e., after obtaining the candidate integer ambiguities, since the quality map-guided method can be used to divide all pixels into different quality regions based on their quality values, the candidate integer ambiguities can be used for unwrapping operations in appropriate quality regions rather than globally. Specifically, unwrapping the first pixel value of a pixel in the phase map based on the quality map to obtain the absolute phase includes: determining a target calculation strategy corresponding to a target integer ambiguity based on the second pixel value of the pixel in the quality map; the second pixel value is a quality value; calculating a 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.
[0090] That is, for pixels classified into different quality regions, the integer ambiguities used when unwrapping their phases may have different calculation strategies. This means that the target integer ambiguities corresponding to high-quality regions and low-quality regions have different target calculation strategies. For example, in low-quality regions, the fringe level is used as the target integer ambiguity; in high-quality regions, to ensure phase continuity, the candidate integer ambiguity is used as the target integer ambiguity.
[0091] For Phase 2: Among them, the dual constraint means dividing the quality area by two quality thresholds rather than dividing the quality area by one quality threshold. That is, based on the second pixel value of the pixel point in the quality map, the target calculation strategy corresponding to the target integer ambiguity is determined, including: determining the first quality threshold and the second quality threshold; the first quality threshold is less than the second quality threshold; based on the second pixel value of the pixel point in the quality map, the pixel point is divided into corresponding areas by the first quality threshold and the second quality threshold; the calculation strategy corresponding to the corresponding area is used as the target calculation strategy corresponding to the target integer ambiguity; wherein the corresponding area includes the first area, the second area and the third area; the value range of the quality value corresponding to the first area is , the value range of the quality value corresponding to the second area is The quality value corresponding to the third region ranges from ; is the first quality threshold, is the second quality threshold.
[0092] Among them, the first region is a low-quality region, the second region is a transition region, and the third region is a high-quality region; and It can be set as needed and is not specifically limited in this embodiment.
[0093] For example, the 37 principle is used to establish a double constraint, that is, , .
[0094] like Figure 6 As shown, Figure 6 is a quality histogram. , .
[0095] It should be noted that the division in this embodiment is based on experience, as follows: First, set a rough range, such as a low-quality threshold of 0.4 and a high-quality threshold of 0.75. The purpose of setting this range is to ensure that the subsequent calculation process does not deviate from common sense.
[0096] Secondly, according to the actual quality value distribution in the quality map, the optimal threshold is dynamically calculated to ensure that the pixel ratios of different quality areas are roughly balanced.
[0097] It should be noted that the dynamic adjustment mechanism makes the algorithm more adaptable and can automatically find the appropriate threshold according to the reflective characteristics of different scenes and object surfaces, without the need to manually set it for each set of images.
[0098] The adaptive calculation process of the dynamic adjustment mechanism is as follows: First, the histogram of the quality map is calculated, and the frequency of the quality value of each pixel is counted. The overall quality distribution of the entire image can be obtained through the quality histogram.
[0099] Next, the cumulative distribution function (CDF) is calculated. This function represents the percentage of pixels with a quality value less than or equal to a certain value. For example, if the CDF value is 20% and the calculated quality value is 0.28, it means that 20% of the pixels in the image have a quality value less than or equal to 0.28.
[0100] Finally, the dynamic threshold is determined based on the percentile, or cumulative distribution function value. This is the most critical step. The algorithm uses percentiles to reverse-search the dynamic threshold, rather than using a set value to divide the quality map. Specifically, a percentage is first determined, and then the corresponding quality value is found based on this percentage as the threshold. For low-quality threshold division, a target percentage for the low-quality area is first set (for example, the 20% of pixels with the worst quality are classified as low-quality). The calculated cumulative distribution function value is then queried to find the critical value that just satisfies the requirement that 20% of the pixel quality scores be below this value. For high-quality area threshold division, a target percentage is also set, and then the cumulative distribution function value is found, using this quality value as its critical value.
[0101] The target percentage established enables the pixels in the divided areas to be more evenly distributed in the image, making the algorithm for solving the wrapped phase more stable and reliable when faced with different lighting and object surfaces.
[0102] In one embodiment, the target percentage for the low-quality region is 20%, the target percentage for the high-quality region is 20%, and the target percentage for the transition region is 60%.
[0103] The decision model is calculated by the following formula: (twelve) in, Indicates the mass value calculated by any of the above embodiments ; represents the weight factor, which is calculated by the following formula: (Thirteen) in, is the boundary confidence of the neighborhood point q.
[0104] In summary, for this decision model, in low-quality areas, phase unwrapping will rely on the global information of the Gray code; in high-quality areas, phase unwrapping will ensure local phase continuity; and in transition areas, phase unwrapping will be performed using an adaptive weighted approach.
[0105] It should be noted that by setting dual constraints, the division accuracy of the mass region is higher, which can improve the accuracy of absolute phase calculation when facing complex surfaces.
[0106] In some embodiments, each time a certain amount of pixel unpacking operations are completed, that is, when the number of pixels that have been unpacked reaches a preset number, the density of the boundary pixels can be determined, and the density is used to determine whether to correct the absolute phase of the pixels that have been unpacked; or, when the boundary sampling density is greater than a preset density threshold, the density of the boundary pixels is determined, and the density is used to determine whether to correct the absolute phase of the pixels that have been unpacked.
[0107] The preset number is based on the total number of pixels in the phase image. This means that when the number of unwrapped pixels reaches the preset number, it can be understood that the proportion of unwrapped pixels to all pixels reaches the preset ratio. For example, if the preset ratio is 10%, the density of boundary pixels is determined every time 10% of the pixels are unwrapped.
[0108] The boundary sampling density can be calculated using fringe levels or phase derivatives, and reflects the distribution of pixels at the edge of an object or at transition edges. The boundary sampling density is positively correlated with the number of boundary pixels.
[0109] Boundary pixels refer to pixels in areas with high noise, reflections, etc. Therefore, if the density is greater than the preset density threshold, it means that the boundary pixels are too dense, and the phase difference of the currently unwrapped pixel is likely to be calculated incorrectly, resulting in absolute phase errors.
[0110] If the density is greater than or equal to a preset density threshold, the absolute phase of the unwrapped pixel is corrected; if the density is less than the preset density threshold, the absolute phase of the unwrapped pixel is not corrected. The preset density threshold is an empirical value.
[0111] The correction may be to smooth the area where the currently unwrapped pixel points are located by using a filtering algorithm.
[0112] like Figure 7 As shown, it is the unwrapped phase diagram, that is, the absolute phase diagram. Figure 7 The continuous transition of the middle color indicates that the phase unwrapping is correct and there is no period confusion. And in the high phase area, it depends on the fringe level provided by the Gray code, and in the Figure 7 The obvious edge between the object being measured and the background also shows that the boundary confidence effectively suppresses boundary blur.
[0113] In an exemplary embodiment, Figure 8 As shown, the present invention also provides a phase unwrapping method. The implementation of each process step can refer to the implementation of the above embodiments and will not be repeated here. The regional consistency check refers to the above correction process.
[0114] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0115] Based on the same inventive concept, embodiments of the present invention further provide a phase unwrapping device for implementing the aforementioned phase unwrapping method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more phase unwrapping device embodiments provided below can be found in the aforementioned limitations of the phase unwrapping method and are not further elaborated here.
[0116] In an exemplary embodiment, Figure 9 As shown, a phase unwrapping device is provided, comprising: a first determination module 100, a second determination module 200, a calculation module 300 and an unwrapping module 400, wherein: The first determination 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 obtained by calculating the sinusoidal grating pattern.
[0117] The second determining module 200 is configured to determine a first indicator value of a supplementary indicator corresponding to the stripe level and a second indicator value of the basic indicator.
[0118] The calculation module 300 is configured to obtain a quality map based on the first indicator value, the second indicator value, and the phase map.
[0119] The unwrapping module 400 is configured to unwrap a first pixel value of a pixel point in the phase map based on the quality map to obtain an absolute phase; the first pixel value is the wrapped phase.
[0120] Optionally, the calculation module 300 is specifically configured to: Determine a third index value of phase gradient consistency; the phase gradient consistency is used to measure the continuity of the gradient direction between pixels in the phase image.
[0121] Determine calculation parameters carried by the phase map, and calculate quality values corresponding to the pixel points based on the calculation parameters, the first index value, the second index value, and the third index value to obtain a quality map.
[0122] Optionally, the calculation module 300 is further configured to: 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.
[0123] Based on the calculation parameters, the first index value, the second index value, the third index value and the weight, a quality value corresponding to the pixel point is calculated to obtain a quality map.
[0124] Optionally, the unpacking module 400 is specifically configured to: A target calculation strategy corresponding to a target integer ambiguity is determined based on a second pixel value of a pixel point in the quality map; the second pixel value is a quality value.
[0125] The target integer ambiguity corresponding to the pixel point is calculated based on the target calculation strategy.
[0126] The first pixel value is unwrapped based on the target integer ambiguity to obtain an absolute phase.
[0127] Optionally, the unpacking module 400 is further configured to: A first quality threshold and a second quality threshold are determined; the first quality threshold is less than the second quality threshold.
[0128] The pixel points are divided into corresponding areas based on the second pixel values of the pixel points in the quality map by using the first quality threshold and the second quality threshold.
[0129] The calculation strategy corresponding to the corresponding area is used as the target calculation strategy corresponding to the target integer ambiguity.
[0130] The corresponding areas include the first area, the second area and the third area; the value range of the quality value corresponding to the first area is , the value range of the quality value corresponding to the second area is The quality value corresponding to the third region ranges from ; is the first quality threshold, is the second quality threshold.
[0131] Optionally, the unpacking module 400 is further configured to: When the target computing strategy is the computing strategy corresponding to the first region: The fringe level is used as the target integer blurriness corresponding to the pixel point.
[0132] Optionally, the unpacking module 400 is further configured to: The pixel point with the largest quality value in the quality map is determined as the seed point.
[0133] Based on the seed point, neighborhood expansion is performed in the quality map to obtain neighborhood points corresponding to the seed point.
[0134] Based on the first pixel value, a phase difference between the neighborhood point and the seed point is calculated; the phase difference is less than π.
[0135] Candidate integer ambiguities are calculated based on the phase differences.
[0136] When the target computing strategy is the computing strategy corresponding to the third region: The candidate integer ambiguity is used as the target integer ambiguity corresponding to the pixel point.
[0137] Alternatively, when the target computing strategy is the computing strategy corresponding to the second region: Determine the weighting factor.
[0138] A target integer ambiguity corresponding to the pixel point is calculated based on the candidate integer ambiguity, the fringe level and the weight factor.
[0139] Optionally, the phase unwrapping device further includes: The third determining module is configured 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.
[0140] The correction module is configured to correct the absolute phase of the unwrapped pixel if the density is greater than or equal to a preset density threshold.
[0141] Each module in the phase unwrapping apparatus described above may be implemented in whole or in part via software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0142] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 10As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, a mobile cellular network, near field communication (NFC), or other technologies. When executed by the processor, the computer program implements a phase unwrapping method. The display unit of the computer device 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 a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0143] Those skilled in the art will understand that Figure 10 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: Determining fringe levels, basic indicators, and a phase map; the fringe levels are obtained by decoding a Gray code pattern, and the phase map is obtained by calculating a sinusoidal grating pattern; Determine a first index value of a 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; The first pixel value of the pixel point in the phase map is unwrapped based on the quality map to obtain the absolute phase; the first pixel value is the wrapped phase.
[0145] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: Determining a third index value of phase gradient consistency; the phase gradient consistency is used to measure the continuity of the gradient direction between pixels in the phase image; Determine calculation parameters carried by the phase map, and calculate quality values corresponding to the pixel points based on the calculation parameters, the first index value, the second index value, and the third index value to obtain a quality map.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: Determining weights corresponding to the first indicator value, the second indicator value, and the third indicator value 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, a quality value corresponding to the pixel point is calculated to obtain a quality map.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a target calculation strategy corresponding to a target integer ambiguity based on a second pixel value of a pixel point in the quality map, wherein the second pixel value is a quality value; Calculate the target integer ambiguity corresponding to the pixel point based on the target calculation strategy; The first pixel value is unwrapped based on the target integer ambiguity to obtain an absolute phase.
[0148] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a first quality threshold and a second quality threshold; wherein the first quality threshold is less than the second quality threshold; Dividing the pixel points into corresponding areas based on the second pixel values of the pixel points in the quality map by using the first quality threshold and the second quality threshold; Using the calculation strategy corresponding to the corresponding area as the target calculation strategy corresponding to the target integer ambiguity; The corresponding areas include the first area, the second area and the third area; the value range of the quality value corresponding to the first area is , the value range of the quality value corresponding to the second area is The quality value corresponding to the third region ranges from ; is the first quality threshold, is the second quality threshold.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: When the target computing strategy is the computing strategy corresponding to the first region: The fringe level is used as the target integer blurriness corresponding to the pixel point.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: Determine the pixel with the largest quality value in the quality map as the seed point; Based on the seed point, performing neighborhood expansion in the quality map to obtain neighborhood points corresponding to the seed point; Based on the first pixel value, calculating a phase difference between the neighborhood point and the seed point; the phase difference is less than π; Calculating candidate integer ambiguities based on the phase difference; The calculating the target integer ambiguity corresponding to the pixel point based on the target calculation strategy includes: When the target computing strategy is the computing strategy corresponding to the third region: Using the candidate integer ambiguity as the target integer ambiguity corresponding to the pixel; or When the target computing strategy is the computing strategy corresponding to the second region: Determine the weighting factors; A target integer ambiguity corresponding to the pixel point is calculated based on the candidate integer ambiguity, the fringe level and the weight factor.
[0151] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: When the number of pixels that have been unpacked reaches a preset number, or when the boundary sampling density is greater than a preset density threshold, determining the density of boundary pixels; If the density is greater than or equal to a preset density threshold, the absolute phase of the unwrapped pixel is corrected.
[0152] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps: Determining fringe levels, basic indicators, and a phase map; the fringe levels are obtained by decoding a Gray code pattern, and the phase map is obtained by calculating a sinusoidal grating pattern; Determine a first index value of a 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; The first pixel value of the pixel point in the phase map is unwrapped based on the quality map to obtain the absolute phase; the first pixel value is the wrapped phase.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: Determining a third index value of phase gradient consistency; the phase gradient consistency is used to measure the continuity of the gradient direction between pixels in the phase image; Determine calculation parameters carried by the phase map, and calculate quality values corresponding to the pixel points based on the calculation parameters, the first index value, the second index value, and the third index value to obtain a quality map.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: Determining weights corresponding to the first indicator value, the second indicator value, and the third indicator value 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, a quality value corresponding to the pixel point is calculated to obtain a quality map.
[0155] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a target calculation strategy corresponding to a target integer ambiguity based on a second pixel value of a pixel point in the quality map, wherein the second pixel value is a quality value; Calculate the target integer ambiguity corresponding to the pixel point based on the target calculation strategy; The first pixel value is unwrapped based on the target integer ambiguity to obtain an absolute phase.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a first quality threshold and a second quality threshold; wherein the first quality threshold is less than the second quality threshold; Dividing the pixel points into corresponding areas based on the second pixel values of the pixel points in the quality map by using the first quality threshold and the second quality threshold; Using the calculation strategy corresponding to the corresponding area as the target calculation strategy corresponding to the target integer ambiguity; The corresponding areas include the first area, the second area and the third area; the value range of the quality value corresponding to the first area is , the value range of the quality value corresponding to the second area is The quality value corresponding to the third region ranges from ; is the first quality threshold, is the second quality threshold.
[0157] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: When the target computing strategy is the computing strategy corresponding to the first region: The fringe level is used as the target integer blurriness corresponding to the pixel point.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: Determine the pixel with the largest quality value in the quality map as the seed point; Based on the seed point, performing neighborhood expansion in the quality map to obtain neighborhood points corresponding to the seed point; Based on the first pixel value, calculating a phase difference between the neighborhood point and the seed point; the phase difference is less than π; Calculating candidate integer ambiguities based on the phase difference; The calculating the target integer ambiguity corresponding to the pixel point based on the target calculation strategy includes: When the target computing strategy is the computing strategy corresponding to the third region: Using the candidate integer ambiguity as the target integer ambiguity corresponding to the pixel; or When the target computing strategy is the computing strategy corresponding to the second region: Determine the weighting factors; A target integer ambiguity corresponding to the pixel point is calculated based on the candidate integer ambiguity, the fringe level and the weight factor.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: When the number of pixels that have been unpacked reaches a preset number, or when the boundary sampling density is greater than a preset density threshold, determining the density of boundary pixels; If the density is greater than or equal to a preset density threshold, the absolute phase of the unwrapped pixel is corrected.
[0160] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to a memory, database, or other medium used in the embodiments provided herein can include at least one of a non-volatile memory and a 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, and the like. Volatile memory can include random access memory (RAM) or external cache memory, and the like. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic based on quantum computing, artificial intelligence (AI) processors, and the like.
[0161] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, 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 the present invention.
[0162] The above-described embodiments merely represent several implementation methods of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A phase unwrapping method, characterized in that: The phase unwrapping method comprises: Determining fringe levels, basic indicators, and a phase map; the fringe levels are obtained by decoding a Gray code pattern, and the phase map is obtained by calculating a sinusoidal grating pattern; Determine a first index value of a 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; The first pixel value of the pixel point in the phase map is unwrapped based on the quality map to obtain the absolute phase; the first pixel value is the wrapped phase.
2. The phase unwrapping method according to claim 1, characterized in that The obtaining of a quality map based on the first index value, the second index value, and the phase map includes: Determining a third index value of phase gradient consistency; the phase gradient consistency is used to measure the continuity of the gradient direction between pixels in the phase image; Determine calculation parameters carried by the phase map, and calculate quality values corresponding to the pixel points based on the calculation parameters, the first index value, the second index value, and the third index value to obtain a quality map.
3. The phase unwrapping method according to claim 2, characterized in that: The calculating the quality value corresponding to the pixel point based on the calculation parameter, the first index value, the second index value, and the third index value to obtain a quality map includes: Determining weights corresponding to the first indicator value, the second indicator value, and the third indicator value 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, a quality value corresponding to the pixel point is calculated to obtain a quality map.
4. The phase unwrapping method according to any one of claims 1 to 3, characterized in that: The unwrapping of the first pixel value of the pixel point in the phase map based on the quality map 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 point in the quality map, wherein the second pixel value is a quality value; Calculate the target integer ambiguity corresponding to the pixel point based on the target calculation strategy; The first pixel value is unwrapped based on the target integer ambiguity to obtain an absolute phase.
5. The phase unwrapping method according to claim 4, characterized in that: Determining a target calculation strategy corresponding to a target integer ambiguity based on a second pixel value of a pixel point in the quality map includes: determining a first quality threshold and a second quality threshold; wherein the first quality threshold is less than the second quality threshold; Dividing the pixel points into corresponding areas based on the second pixel values of the pixel points in the quality map by using the first quality threshold and the second quality threshold; Using the calculation strategy corresponding to the corresponding area as the target calculation strategy corresponding to the target integer ambiguity; The corresponding areas include the first area, the second area and the third area; the value range of the quality value corresponding to the first area is , the value range of the quality value corresponding to the second area is The quality value corresponding to the third region ranges from ; is the first quality threshold, is the second quality threshold.
6. The phase unwrapping method according to claim 5, characterized in that: The calculating the target integer ambiguity corresponding to the pixel point based on the target calculation strategy includes: When the target computing strategy is the computing strategy corresponding to the first region: The fringe level is used as the target integer blurriness corresponding to the pixel point.
7. The phase unwrapping method according to claim 5, 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 map, the method further includes: Determine the pixel with the largest quality value in the quality map as the seed point; Based on the seed point, performing neighborhood expansion in the quality map to obtain neighborhood points corresponding to the seed point; Based on the first pixel value, calculating a phase difference between the neighborhood point and the seed point; the phase difference is less than π; Calculating candidate integer ambiguities based on the phase difference; The calculating the target integer ambiguity corresponding to the pixel point based on the target calculation strategy includes: When the target computing strategy is the computing strategy corresponding to the third region: Using the candidate integer ambiguity as the target integer ambiguity corresponding to the pixel; or When the target computing strategy is the computing strategy corresponding to the second region: Determine the weighting factors; A target integer ambiguity corresponding to the pixel point is calculated based on the candidate integer ambiguity, the fringe level and the weight factor.
8. The phase unwrapping method according to claim 1, wherein: The method further comprises: When the number of pixels that have been unpacked reaches a preset number, or when the boundary sampling density is greater than a preset density threshold, determining the density of boundary pixels; If the density is greater than or equal to a preset density threshold, the absolute phase of the unwrapped pixel is corrected.
9. A computer device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the phase unwrapping method according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the phase unwrapping method according to any one of claims 1 to 8 are implemented.
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
Quaternary Gray code three-dimensional imaging method and device, electronic equipment and storage medium
CN118729990A
Three-dimensional reconstruction method based on structured light image enhancement
CN119941982A
Super-rapid three-dimensional topography measurement method and system based on improved fourier transform contour technique
US20210102801A1