A phase denoising method based on noise feature classification
Through noise feature classification and mask processing, the problem of poor noise removal in complex surface areas by traditional methods is solved, and higher phase measurement accuracy and denoising precision are achieved.
Patent Information
- Application Number
- CN202310418985.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-04-19
AI Technical Summary
Traditional phase denoising methods are ineffective when processing highlight areas, mirror reflection areas and out-of-focus areas on the surface of objects, and cannot effectively remove noise, affecting measurement accuracy.
A noise feature classification method is adopted to generate multiple masks to process shadow, occlusion, inversion and defocus noise areas respectively, and the area of connected domains is calculated to remove isolated noise and generate the final denoised phase.
The accuracy of phase measurement and denoising is improved, noise is effectively removed, and correct phase information is retained.
Smart Images

Figure CN116612315B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of structured light three-dimensional measurement, and in particular relates to a phase denoising method based on noise feature classification. Background Art
[0002] In the field of structured light 3D measurement, the presence of noise often seriously interferes with the accuracy of measurement results. Traditional phase denoising methods primarily remove noise by jointly constraining the image background and modulation. However, this method is only effective for measuring dark areas on the surface of the object or areas obscured by shadows. As structured light 3D measurement becomes increasingly common, the increasing number of surface characteristics required for measurement makes these methods ineffective in removing noise, such as surface highlights, specular reflections, and out-of-focus areas. Summary of the Invention
[0003] The purpose of the present invention is to provide a phase denoising method based on noise feature classification, which classifies the noise problems in the phase measurement process, removes them one by one, and improves the accuracy of phase measurement.
[0004] The technical solution to achieve the purpose of the present invention is: a phase denoising method based on noise feature classification, the specific steps are:
[0005] Step 1: Read the fringe image and calculate the corresponding absolute phase, modulation depth, and background using the N-step phase shift method based on the fringe phase shift frequency and the number of phase shift steps;
[0006] Step 2: Use the data calculated in step 1 to determine the initial denoising phase. The specific steps are:
[0007] Step 2.1, set the background and the positions where the modulation index is lower than the first threshold to 0, and generate the corresponding denoising mask 1;
[0008] Step 2.2, perform phase-increasing derivative on the phase image to obtain a phase gradient image, set the negative regions in the phase gradient image to 0, and generate the corresponding mask 2;
[0009] Step 2.3, binarize the phase gradient image using the maximum inter-class variance method, and erode the binarized phase gradient image using the imerode function to generate phase mask 3;
[0010] Step 2.4: Use Mask 1, Mask 2, and Mask 3 to denoise the phase to obtain the initial denoised phase;
[0011] Step 3, using the initial denoising phase to calculate a phase difference map, and using the phase difference map to generate a denoising mask 4;
[0012] Step 4: Calculate the area of each connected domain in mask 4, remove the areas with an area greater than the second threshold to generate the final denoising mask, and set the phase value of the initial denoising phase at the corresponding position where the final denoising mask is 0 to a null value to obtain the final denoising phase.
[0013] Preferably, the light intensity of the fringe pattern read in step 1 is expressed as:
[0014] I n (x,y)=A(x,y)+B(x,y)cos[φ(x,y)+δ n ]
[0015] Where A(x,y) is the background, B(x,y) is the modulation pattern, and φ(x,y) is the wrapping phase;
[0016] The absolute phase, modulation depth and background are calculated by the N-step phase shift method.
[0017] Preferably, the formula for derivation of the phase diagram in the direction of phase increase is:
[0018]
[0019] in is the fringe moving direction, and Φ is the absolute phase value.
[0020] Preferably, the specific method of using Mask 1, Mask 2, and Mask 3 to denoise the phase to obtain the initial denoised phase is:
[0021] The phase values at positions where the values are 0 in Mask 1, Mask 2, and Mask 3 in the phase image are set to null value n.
[0022] Preferably, the specific method for calculating the phase difference map using the initial denoising phase is:
[0023] Calculate the maximum phase difference between each pixel in the phase image and the 8 pixels in the field. The calculation formula is as follows:
[0024] d(x,y)=max(|Φ(x,y)-Φ(x+1,y+1)|,|Φ(x,y)-Φ(x,y+1)|,
[0025] |Φ(x,y)-Φ(x-1,y+1)|,|Φ(x,y)-Φ(x+1,y)|,|Φ(x,y)-Φ(x-1,y)|,
[0026] |Φ(x,y)-Φ(x+1,y-1)|,|Φ(x,y)-Φ(x,y-1)|,|Φ(x,y)-Φ(x-1,y-1)|)
[0027] The maximum value is used as the value of the corresponding pixel point in the phase difference value map to obtain the phase difference value map.
[0028] Preferably, the calculation formula of the jump threshold is:
[0029]
[0030] Where T is the number of fringe cycles, dof is the depth of field of the lens, fov is the length of the field of view in the direction of phase increase, and p is the number of pixels in the direction of fringe movement.
[0031] Preferably, the values in the phase difference value map that are greater than the jump threshold are set to 0 to generate the initial mask 4 .
[0032] Compared with the existing technology, the present invention has the following significant advantages: (1) It classifies and removes noise problems one by one, thereby improving the accuracy of phase measurement. (2) By calculating the size of the connected domain area, it retains the correct phase caused by misjudgment on the basis of denoising, thereby improving the accuracy of denoising. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Flowchart of the present invention.
[0034] Figure 2 This is a schematic diagram of the phase shift diagram read in by the present invention and the absolute phase, background and modulation obtained by calculation.
[0035] Figure 3 These are the masks generated in the various steps of the present invention. Figure 3 (a), (b), (c), and (d) are masks 1, 2, 3, and 4, respectively.
[0036] Figure 4 The processed phases in each step of the present invention; Figure 4 (a) is the absolute phase calculated in step 1; Figure 4 (b) in the figure is the initial denoised phase after processing with masks 1, 2, and 3; Figure 4 (c) in the figure is the final denoised phase. DETAILED DESCRIPTION
[0037] A phase denoising method based on noise feature classification is proposed. First, a fringe image is read and the corresponding absolute phase, modulation, and background are calculated using the N-step phase shift method based on the fringe phase shift frequency and the number of phase shift steps. The calculated data is then used to classify noise features. Background and locations with low modulation are identified as shadows and occlusions, and corresponding denoising masks 1 are generated. The phase image is differentiated in the direction of increasing phase, and regions with negative derivatives are identified as phase inversion regions, generating corresponding mask 2. The phase gradient image is binarized using the maximum inter-class variance method and eroded using the imerode function to generate phase mask 3. These regions are classified as color and height abrupt changes due to defocus noise. Phase denoising is performed using masks 1, 2, and 3. Phase values at corresponding locations are set to null values (nan) to obtain the initial denoised phase. The initial denoised phase is then used to calculate a phase difference map. Whether the values in the phase difference map reach the threshold for isolated noise is determined to generate denoising mask 4. Next, calculate the area of each connected domain in mask 4, remove the areas with excessively large areas to generate the final denoising mask, and use this mask to denoise the phase. The specific steps are:
[0038] Step 1: Determine the absolute phase, modulation, and background. First, read in the fringe pattern. The intensity of the fringe pattern can be expressed as:
[0039] I n (x,y)=A(x,y)+B(x,y)cos[φ(x,y)+δ n ] (1)
[0040] Where A(x,y) is the background, B(x,y) is the modulation, and φ(x,y) is the wrapping phase. The absolute phase, modulation, and background are calculated using the N-step phase shift method.
[0041] Step 2: Classify the noise characteristics based on the data calculated in step 1.
[0042] (1) The background and the position with low modulation are judged as shadow and occlusion areas, and the values in the shadow and occlusion areas are set to 0 to generate mask 1.
[0043] (2) Derivative the phase image in the phase increasing direction, determine the area with a negative derivative result as the phase inversion area, and generate the corresponding mask 2. The derivation formula is:
[0044]
[0045] in is the direction of fringe movement, Φ is the absolute phase value. The area where the derivative result is negative is set to 0 in Mask 2.
[0046] (3) The phase gradient image is binarized using the maximum inter-class variance method and eroded using the imerode function to generate a phase mask 3. This area is classified as a color and height mutation area with noise due to defocus.
[0047] Use Mask 1, Mask 2, and Mask 3 to denoise the phase: Set the phase values at the positions where Mask 1, Mask 2, and Mask 3 have a value of 0 in the phase image to the null value nan to obtain the initial denoised phase.
[0048] Step 3, calculate the denoising mask 4. First, calculate the phase difference value map using the initial denoising phase: calculate the maximum phase difference between each pixel in the phase map and the 8 pixels in the area. The calculation formula is as follows:
[0049] d(x,y)=max(|Φ(x,y)-Φ(x+1,y+1)|,|Φ(x,y)-Φ(x,y+1)|,
[0050] |Φ(x,y)-Φ(x-1,y+1)|,|Φ(x,y)-Φ(x+1,y)|,|Φ(x,y)-Φ(x-1,y)|, (3)
[0051] |Φ(x,y)-Φ(x+1,y-1)|,|Φ(x,y)-Φ(x,y-1)|,|Φ(x,y)-Φ(x-1,y-1)|)
[0052] The maximum value is used as the value of the corresponding pixel point in the phase difference value map to obtain the phase difference value map.
[0053] Whether it is an isolated noise area is determined based on the jump threshold, where the calculation formula of the jump threshold is:
[0054]
[0055] Where T is the number of fringe cycles, dof is the depth of field of the lens, fov is the field of view in the phase increment direction, and p is the number of pixels in the fringe shift direction. Masks in the phase difference map that are greater than this threshold are set to 0 to generate an initial mask 4.
[0056] Step 4: Calculate the final denoised phase. First, perform a connected domain extraction on Mask 4 obtained in Step 3. Regions within the connected domain with excessively large areas are set to 1 in Mask 4 to generate the final denoising mask. Finally, use this mask to denoise the phase, setting the phase values at corresponding locations to null values (nan) to obtain the final denoised phase.
[0057] The present invention classifies the characteristics of phase noise and generates the following Figure 3The four denoising masks shown in the figure are used to remove the noise one by one. Finally, the remaining noise is removed by judging the isolated noise, and the following is obtained: Figure 4 The noise-free absolute phase image shown in (c) greatly improves the accuracy of phase denoising.
Claims
1. A phase denoising method based on noise feature classification, characterized in that: The specific steps are: Step 1: Read the fringe image and calculate the corresponding absolute phase, modulation depth, and background using the N-step phase shift method based on the fringe phase shift frequency and the number of phase shift steps; Step 2: Use the data calculated in step 1 to determine the initial denoising phase. The specific steps are: Step 2.1, set the background and the positions where the modulation index is lower than the first threshold to 0, and generate the corresponding denoising mask 1; Step 2.2, perform phase-increasing derivative on the phase image to obtain a phase gradient image, set the negative regions in the phase gradient image to 0, and generate the corresponding mask 2; Step 2.3, binarize the phase gradient image using the maximum inter-class variance method, and erode the binarized phase gradient image using the imerode function to generate phase mask 3; Step 2.4: Use Mask 1, Mask 2, and Mask 3 to denoise the phase to obtain the initial denoised phase; Step 3, using the initial denoising phase to calculate a phase difference map, and using the phase difference map to generate a denoising mask 4; Step 4: Calculate the area of each connected domain in mask 4, remove the areas with an area greater than the second threshold to generate the final denoising mask, and set the phase value of the initial denoising phase at the corresponding position where the final denoising mask is 0 to a null value to obtain the final denoising phase.
2. The phase denoising method based on noise feature classification according to claim 1, characterized in that: The intensity of the fringe pattern read in step 1 is expressed as: Yo n (x,y)=A(x,y)+B(x,y)cos[φ(x,y)+δ n ] Where A(x,y) is the background, B(x,y) is the modulation pattern, and φ(x,y) is the wrapping phase; The absolute phase, modulation depth and background are calculated by the N-step phase shift method.
3. The phase denoising method based on noise feature classification according to claim 1, characterized in that: The formula for derivation of the phase diagram in the direction of phase increase is: in is the fringe moving direction, and m is the absolute phase value.
4. The phase denoising method based on noise feature classification according to claim 1, characterized in that: The specific method of using Mask 1, Mask 2, and Mask 3 to denoise the phase and obtain the initial denoised phase is: Set the phase values at positions where the values are 0 in Mask 1, Mask 2, and Mask 3 in the phase image to null values.
5. The phase denoising method based on noise feature classification according to claim 1, characterized in that: The specific method for calculating the phase difference map using the initial denoising phase is: Calculate the maximum phase difference between each pixel in the phase image and the 8 pixels in the field. The calculation formula is as follows: d(x,y)=max(|Φ(x,y)-Φ(x+1,y+1)|,|Φ(x,y)-Φ(x,y+1)|, |Φ(x,y)-Φ(x-1,y+1)|,|Φ(x,y)-Φ(x+1,y)|,|Φ(x,y)-Φ(x-1,y)|, |Φ(x,y)-Φ(x+1,y-1)|,|Φ(x,y)-Φ(x,y-1)|,|Φ(x,y)-Φ(x-1,y-1)|) The maximum value is used as the value of the corresponding pixel point in the phase difference value map to obtain the phase difference value map.
6. The phase denoising method based on noise feature classification according to claim 1, characterized in that: The calculation formula for the transition threshold is: Where T is the number of fringe cycles, dof is the depth of field of the lens, fov is the length of the field of view in the direction of phase increase, and p is the number of pixels in the direction of fringe movement.
7. The phase denoising method based on noise feature classification according to claim 1, characterized in that: The values in the phase difference value map that are greater than the transition threshold are set to 0 to generate an initial mask 4.
Citation Information
Patent Citations
Phase shift stripe brightness amplitude-based point cloud noise deletion method
CN113793273A
Apparatus and method for reducing impulse noise
KR101290200B1