A method for stripe order correction in fringe projection profilometry based on regional statistics
By employing a fringe projection profilometry method based on region statistics, effective pixels are identified using mask images, and the fringe order is corrected in intervals. This solves the problem of fringe order error in the Gray code-assisted multi-frequency phase shift method and achieves efficient 3D topography reconstruction.
Patent Information
- Application Number
- CN202310307475.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-03-27
AI Technical Summary
In the existing Gray code-assisted multi-frequency phase shift method, the boundary between the wrapped phase and the fringe series is easily misaligned during the wrap phase unwrapping process, leading to fringe series errors. Furthermore, traditional methods require additional projection images or are limited to the three-step phase shift method.
The method employs a fringe projection profilometry based on region statistics. By analyzing the independent distribution patterns of pixels within a single fringe period, the fringe levels are processed in intervals. Effective pixels are identified using a mask image, and the fringe level images are merged for correction. This method is suitable for parallel computation within a single fringe period.
It enables parallel stripe series error correction in CPU and GPU hardware, improving measurement accuracy and reducing hardware requirements, and is suitable for 3D topography reconstruction in binocular structured light systems.
Smart Images

Figure CN116793247B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of visual measurement technology, specifically relating to a method for correcting the fringe level in fringe projection contouring based on region statistics. Background Technology
[0002] Fringe projection profilometry has been a hot topic in machine vision research, widely applied in medical auxiliary diagnosis, industrial inspection, and cultural relic digitization. This method replaces one camera in a binocular vision measurement system with a projector, actively projecting coded structured light with a known distribution onto the surface of the object being measured to complete 3D measurement of a single uniform surface lacking texture information. Feature points are used to uniquely encode corresponding matching points in the camera and projector. Fringe projection profilometry projects sinusoidal or cosine fringes with multi-step phase shifts. The phase shift method is used for demodulation to obtain the phase values of the coded fringes. This phase-based encoding method is robust to noise, illumination, and projector defocusing. To improve measurement accuracy, fringe projection profilometry typically employs higher fringe frequencies. The demodulated phase value, influenced by the arctangent function, is truncated in the (-π, π] interval, also known as the wrapped phase. Unfolding the wrapped phase to obtain the absolute phase of a pixel has become a key focus of fringe projection profilometry research, with the core being the calculation of the fringe order of any pixel. Current phase unfolding methods can be divided into two categories: spatial domain methods and temporal phase unfolding methods. Among these, the multi-frequency method and Gray code-assisted method within the temporal phase unfolding method exhibit high robustness and have seen rapid development.
[0003] Gray code combined with multi-frequency phase-shifting technology for fringe projection profilometry in 3D contour measurement offers advantages such as high reconstruction accuracy, good environmental adaptability, and robust measurement performance, and has been widely applied in 3D component inspection in industrial settings. This method utilizes the robustness and high spatial resolution of phase encoding to calculate the wrapping phase of pixels, with Gray code encoding used to calculate the fringe order of the wrapping phase. However, due to system noise and low-pass filtering characteristics, the edges of the Gray code captured by the camera are not sharply cut off, necessitating binarization. This makes it difficult to accurately determine edge pixels, often introducing additional judgment errors. This leads to misalignment between the binarized Gray code edges and the truncated wrapping phase, causing incorrect unfolding of the pixel wrapping phase in that region and resulting in order jump errors.
[0004] To address the aforementioned issues, Sun Xuezhen et al. (Sun Xuezhen, Su Xianyu, Zou Xiaoping, Phase Unwrapping Based on Complementary Grating Coding, Acta Optica Sinica, (2008) 1947-1951) proposed a complementary Gray code encoding method. When encoding the wrapped phase with the same fringe period, this method uses an additional complementary Gray code shifted by half a period compared to the traditional Gray code, ensuring that the densest Gray code period is consistent with the fringe period. This method requires an additional image projection and two rounds of decoding operations. Wu Zhoujie et al. (Wu Z, Guo W, Lu L, & Zhang Q. Generalized phase unwrapping method that avoids jump errors for fringe projection profilometry[J]. Optics Express, 2021, 29(17):27181-27192.) obtained the fringe order by segmentation based on the characteristics of the wrapped phase in the three-step phase shifting method. This method is only suitable for the three-step phase shifting method. Summary of the Invention
[0005] To address the fringe level error introduced by the misalignment between the wrapping phase boundary and the fringe level boundary in the Gray code-assisted multi-frequency phase-shifting method for wrapping phase unwrapping, this invention proposes a fringe level correction method based on region statistics in fringe projection profilometry. Unlike traditional methods, the proposed method does not require an additional number of Gray code-encoded images or the limitation of being applicable only to three-step phase-shifting phase unwrapping. The proposed method utilizes the independent fringe level error distribution patterns of pixels in two intervals within a single fringe period, thereby performing interval processing on pixels within a single fringe period to correct the fringe level. The proposed method uses a row of pixels as the computational unit during the two-dimensional image data processing, thus enabling parallel computation of the algorithm on hardware.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A method for correcting the fringe series in fringe projection contouring based on region statistics includes the following steps:
[0008] Step 1: Generate a Gray code coded image and a cosine fringe coded image with phase shift based on the Gray code encoding principle and the phase shift method principle. The projection module projects the coded image, and the camera synchronously acquires the image after it has been highly modulated by the object under test.
[0009] Step 2: Demodulate the cosine fringe coded image acquired by the camera to obtain the wrapped phase image, and decode the Gray code coded image to obtain the wrapped phase fringe series; use the ratio of the background term and amplitude term of the cosine fringe obtained simultaneously by phase demodulation to obtain the confidence of the wrapped phase of any pixel, and define pixels with confidence values less than a set threshold as invalid pixels.
[0010] Step 3: Identify pixels with phase values less than 0 and greater than or equal to 0 in the wrapper phase image, generate two binary mask images, and eliminate background pixels. The mask images are represented as M1 and M2, where the value of valid pixels is 1 and the value of invalid pixels is 0.
[0011] Step 4: For the effective pixels in the M2 region of the mask image, traverse a continuous pixel sequence from left to right. When there are two values for the stripe level corresponding to the pixels in the interval, take the smaller level value for all pixels in the interval. After traversing all effective pixels, a new stripe level image S2 is obtained. For the effective pixels in the M1 region of the mask image, traverse a continuous pixel sequence from right to left. When there are two values for the stripe level corresponding to the pixels in the interval, take the larger level value for all pixels in the interval. After traversing all effective pixels, a new stripe level image S1 is obtained.
[0012] Step 5: Merge the newly calculated fringe series diagrams S1 and S2 to obtain the fringe series diagram S0, and at the same time complete the unrolling of the wrapped phase to obtain the absolute phase diagram;
[0013] Step 7: Use binocular stereo matching technology to match the corresponding points of the absolute phase maps of the left and right cameras, and obtain the three-dimensional shape of the object under test according to the calibration parameters of the projector and camera.
[0014] A further improvement of the present invention is that the specific implementation method of step 1) is as follows:
[0015] Step 1.1: Construct a binocular structured light system consisting of a binocular camera and a projector, and calibrate the binocular structured light system;
[0016] Step 1.2: Generate a cosine fringe coded pattern with phase shift, the expression of which is as follows:
[0017]
[0018] Where A(x,y) represents the fringe background term, B(x,y) represents the cosine fringe amplitude term, Φ(x,y) represents the absolute phase, and δ i =2πi / N is a known phase shift, i∈1,2,…,N, where N represents the number of phase shift steps;
[0019] Step 1.3: Generate Gray code encoded image G iThe Gray code encoding pattern has the same number of cycles as the cosine fringe encoding pattern. The encoded image is projected and the camera synchronously acquires the image after being highly modulated by the object under test.
[0020] A further improvement of the present invention is that the specific implementation method of step 2) is as follows:
[0021] Step 2.1: Demodulate the phase value of each pixel using the phase-shifting method:
[0022]
[0023]
[0024] in Represents the background item of any pixel. The magnitude term represents any pixel. This represents the wrapped phase obtained by the solution; because the arctangent solution makes the range of pixel phase values obtained by phase demodulation (-π, π], in order to obtain the absolute phase Φ(x,y) of any pixel, Gray code encoding is used to solve for the wrapped phase level value;
[0025] Step 2.2: Normalize the grayscale values of the Gray code image of any pixel. The normalized image is represented as follows: The binarization threshold ε0 of the camera-acquired image is calculated using the Gray code encoded images corresponding to pixel grayscale values of all 255 and all 0. Based on this threshold, Gray code image binarization is performed, generating a binarized image sequence G. i The mathematical definition of binarization is as follows:
[0026]
[0027] Based on the binarized image sequence G i And the stripe series diagram V is calculated using the Gray code decoding algorithm;
[0028] Step 2.3: Use the ratio of the background term to the amplitude term obtained from arbitrary pixel phase demodulation to describe the confidence level of the wrapped phase, and define pixels with a confidence level less than the threshold ε1 as invalid pixels, and identify them using a binarized mask:
[0029]
[0030] A further improvement of this invention is that the specific implementation method of step 3) is as follows:
[0031] Package phase diagram The value range of any pixel is (-π, π]. Pixels are classified using the value range, and the positions of the two types of pixels are recorded using two binary mask images, M1 and M2, with the values of the two mask images being exactly opposite:
[0032]
[0033]
[0034] The two obtained mask images are multiplied by the mask image M0 respectively to further remove invalid pixels with low confidence in the wrapping phase position.
[0035] A further improvement of this invention is that the specific implementation method of step 4) is as follows:
[0036] Step 4.1: Calculate the row in the image as the unit of calculation; use the mask image M2 to identify the location of continuous and reliable pixels. A continuous pixel segment with M2(x,y)=1 in the row direction is defined as a valid pixel region.
[0037] Step 4.2: Based on the stripe level diagram V, count the types of stripe level values for pixels within a valid pixel region; when there is only one level value, do not change the pixel level value within that region; when there are two stripe level values, set the stripe level value of all pixels within that region to the smaller value; the above yields a result containing stripes. Figure 1 S2 is a half-pixel stripe series diagram;
[0038] Step 4.3: Use mask image M1 to identify continuous reliable pixel positions. A continuous segment of pixels along the row direction M1(x,y) is defined as a valid pixel region. Count the types of stripe level values for all pixels within this region. When there are two stripe level values, set the larger stripe level value to the larger value for all pixels within that region. The above steps yield a striped pixel region. Figure 1 S1 is a half-pixel stripe series diagram.
[0039] A further improvement of the present invention is that the specific implementation method of step 5) is as follows:
[0040] Step 5.1: Merge the two stripe series maps S1 and S2 to obtain the stripe series map S of all pixels in the image;
[0041] Step 5.2: Utilize the fringe series diagram S and the wrapped phase diagram The expanded absolute phase diagram Φ is obtained; the mathematical definition of phase expansion is described as follows:
[0042] A further improvement of this invention is that the specific implementation method of step 6) is as follows:
[0043] Using the methods in steps 2 to 5, the Gray code encoded image and cosine fringe encoded image of the object under test captured by the left and right cameras are processed respectively. After processing, the absolute phase images Φ1 and Φ2 corresponding to the left and right cameras are obtained respectively.
[0044] A further improvement of this invention is that, in a binocular structured light system, the uniform position of the object being measured has the same and unique pixel value in the imaging pixels of the left and right cameras; using the principle of stereo matching in binocular vision, the corresponding pixel points of the left and right cameras are calculated with phase as the description of the corresponding points, satisfying |Φ1(xd,y)-Φ2(x,y)|≤ε1; where d represents the movement of the image coordinates of the corresponding point in the left and right cameras due to the change of viewing angle, which is called the disparity value of pixel point (x,y) in stereo vision;
[0045] Transform the disparity map into a depth map in the camera coordinate system using the parameters of the stereo system:
[0046]
[0047] Where f is the camera focal length, B represents the baseline distance of the binocular cameras, and pixel p is any pixel in the image with a disparity value of d. p The corresponding three-dimensional coordinates in the camera coordinate system are (X... p ,Y p Z p ).
[0048] The present invention has at least the following beneficial technical effects:
[0049] This invention proposes a fringe level correction method based on region statistics for fringe projection contouring. This method can perform the fringe level error correction calculation in parallel on both CPU and GPU hardware. The algorithm first calculates the wrapping phase using a multi-step phase-shifting method and the fringe level using Gray code. Then, based on the wrapping phase value, a fringe period is divided into two intervals (pixels with wrapping phase values less than 0 and pixels with wrapping phase values greater than or equal to 0). Row-based calculation units are used to statistically analyze consecutive pixels within the two intervals. For pixels in intervals with wrapping phase values greater than or equal to 0, the smaller fringe level value of that interval is taken; for pixels in intervals with wrapping phase values less than 0, the larger fringe level value of that interval is taken. Finally, the fringe level correction results of the two intervals are merged to obtain the fringe level value of the pixels throughout the entire fringe period. Attached Figure Description
[0050] Figure 1 It is a binocular structured light hardware system.
[0051] Figure 2 For a three-step phase-shift cosine fringe pattern and Gray code encoded image, its Figure 2 (a) is the three-step phase-shift cosine fringe pattern. Figure 2 (b) is a Gray code encoded image.
[0052] Figure 3 The image is acquired by the camera after projection of the three-step phase-shifted cosine fringe pattern and Gray code encoded image. Figure 3 (a) Image acquired by a three-step phase-shift cosine fringe pattern camera. Figure 3 (b) Images are captured by the camera for Gray code encoding.
[0053] Figure 4 This is a diagram illustrating background pixel removal. Figure 4 (a) is the phase map that wraps the entire image. Figure 4 (b) is the confidence level calculated from the amplitude and background terms, and the effective pixel region is calculated by setting a confidence threshold. Figure 4 (c) is the wrapping phase map for removing invalid pixels.
[0054] Figure 5 This diagram illustrates errors based on the wrapping phase and the boundary position of the fringe series, and explains the classification of pixels based on the wrapping phase.
[0055] Figure 6 A schematic diagram illustrating the misalignment of the wrapping phase and fringe series boundaries.
[0056] Figure 7 The absolute phase map is calculated from the images acquired by the left and right cameras, where Figure 7 (a) is the absolute phase map of the left image. Figure 7 (b) is the absolute phase map of the image.
[0057] Figure 8 For comparison of the results of the stripe level correction algorithm, among which Figure 8 (a) is the absolute phase map obtained by calculating the fringe series using the traditional Gray code method. Figure 8 (b) is the absolute phase map obtained after correcting the fringe series using the proposed algorithm. Figure 8 (c) is the phase interface diagram of Figure (a) and Figure (b) at the 400th row of pixels.
[0058] Figure 9 This is a stereo matching disparity map. Detailed Implementation
[0059] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the disclosure to those skilled in the art. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and exemplary embodiments.
[0060] The hardware system of the fringe series correction method based on region statistics for fringe projection profilometry proposed in this invention for binocular structured light 3D profilometry is as follows: Figure 1 As shown, the projector projects a Gray code-encoded image and a three-step phase-shift cosine fringe pattern. Then, the left and right cameras respectively acquire images deformed by object height modulation. Finally, the wrapping phase calculation, fringe series calculation and correction, absolute phase unwrapping, and disparity map calculation are completed, and the final output is the disparity map of the left image. The calculation process for this example is as follows:
[0061] Step 1: Set up a binocular structured light system, perform system calibration, and project and acquire coded patterns;
[0062] A binocular structured light system was constructed, using phase as the descriptive criterion for corresponding point matching. The system calibration employed Zhang Zhengyou's checkerboard calibration method to determine the pose relationship between the two cameras. The camera resolution was 2048×1536, and the projector resolution was 912×1140. Gray code encoded images were generated (6 images, period 58 pixels, e.g., ...). Figure 2 (b) and the three-step phase-shifted cosine fringe pattern (background term A = 130, amplitude term B = 90, fringe period 58 pixels, three-step phase shift values δ = 0, 2π / 3, 4π / 3, as shown) Figure 2 As shown in (a), a DLP projection module is used for projection, and the camera simultaneously completes image acquisition. The camera acquires the coded image modulated by the object under test, as shown in (a). Figure 3 As shown.
[0063] Step 2: Perform phase demodulation using the cosine fringe pattern captured by the camera, calculate the fringe order using the captured Gray code-encoded image, and simultaneously remove background pixels from the image based on the calculated cosine fringe amplitude and background term. For example... Figure 4 As shown;
[0064] Step 2.1: Demodulate the encapsulated phase value using the three-step phase shift demodulation method. Simultaneously, the ratio of amplitude to background term is calculated.
[0065] Step 2.2: Calculate the binarization threshold ε0 for each pixel in the acquired images with grayscale values of 255 and 0 in the Gray code encoded image. This represents the image captured by the camera after projecting a Gray code image with a grayscale value of 255, and after normalization processing. This represents the image captured by the camera after projecting a Gray code image with a grayscale value of 0, and after normalization. The Gray code image captured by the camera is binarized, and the mathematical expression is as follows:
[0066]
[0067] Then, based on the Gray code decoding principle, the stripe levels of all pixels are obtained.
[0068] Step 2.3: Setting the threshold ε1 = 0.2, pixels with an amplitude-to-background ratio γ less than the threshold have a large phase error. Defining these pixels as invalid pixels can effectively identify background region pixels. For example... Figure 4 As shown in (b).
[0069] Step 3: Perform stripe level correction and wrap phase boundary error area pixel stripe level correction.
[0070] Step 3.1: The wrapper phase value range is (-π, π]. Pixels within the effective area are classified according to the wrapper phase value, resulting in two categories. One category of pixels has a phase value greater than or equal to 0, and the other category has a phase value less than 0. Pixel positions are marked using two templates, M1 and M2, as shown below:
[0071]
[0072] Related illustrations are as follows Figure 5 As shown.
[0073] Step 3.2: For region M2, the edge of the fringe level can only be to the left or right of the pixel enclosing the phase π value. When the pixel enclosing the phase pixel is to the right of the fringe level transition pixel, the fringe level of all pixels in region M2 is k, such as... Figure 5 As shown; when the wrapped phase pixel is to the left of the pixel that changes the fringe level, the fringe levels of all pixels in the M2 region are k and k+1. Therefore, the smaller value (fringe level k) is taken for all pixels in the M2 region at this time, as shown. Figure 6 As shown.
[0074] Step 3.3: For region M1, the edge of the fringe level can only be to the left or right of the pixel enclosing the phase-π value. When the pixel enclosing the phase is to the left of the pixel that changes the fringe level, the fringe level of all pixels in region M1 is k, such as... Figure 6As shown; when the wrapped phase pixel is to the right of the pixel that changes the fringe level, the fringe levels of all pixels in region M1 are k-1 and k. Therefore, the larger value (k is chosen as the fringe level) is taken for all pixels in region M1 at this time. Figure 5 As shown.
[0075] Step 3.4: After completing the stripe level correction for all pixels in regions M1 and M2, merge the stripe levels of pixels in the two regions to obtain the stripe level of all pixels in the effective region.
[0076] Step 4: Use the wrapped phase diagram and fringe series diagram to expand the wrapped phase to obtain the absolute phase diagram. Calculate the absolute phase:
[0077] Step 5: Using the methods from Steps 2 to 4, calculate the absolute phase maps of the left and right camera images respectively, obtaining the absolute phase maps of the effective pixel areas of the left and right cameras as follows: Figure 7 As shown, the absolute phase map limit correction of the left and right cameras and the disparity map of the left camera are calculated using binocular vision limit correction and stereo matching techniques, as shown. Figure 9 As shown.
[0078] Step 6: Use the parameters of the binocular camera to convert the disparity map into a depth map to obtain the three-dimensional shape of the scene.
[0079] Transform the disparity map into a depth map in the camera coordinate system using the parameters of the stereo system:
[0080]
[0081] Where f is the camera focal length, B represents the binocular baseline distance, and pixel p is any pixel in the image with a disparity value of d. p The corresponding three-dimensional coordinates in the camera coordinate system are (X... p ,Y p Z p ).
[0082] Using the method of this invention, a binocular structured light system was constructed. Gray code-assisted multi-frequency phase-shifting method was used to correct the fringe order in phase unwrapping, and measurements were performed on a plaster cast image. Figure 3 , Figure 7 and Figure 8 As shown, Figure 3 Encoded images sampled by the camera during measurement. Figure 7 This is the absolute phase map of the left and right viewpoints obtained after fringe series correction using the method of this invention. Figure 8 The phase expansion results of the traditional Gray code method and the phase expansion results of the method of this invention are shown.
[0083] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. A method for stripe order correction in fringe projection profilometry based on regional statistics, characterized in that, The method comprises the following steps: Step 1: generating a Gray code encoding image and a cosine fringe encoding image with phase shift according to the Gray code encoding principle and the phase shift principle, projecting the encoding image by a projection module, and synchronously collecting images modulated by the height of a measured object by a camera; Step 2: phase demodulation is performed on the camera-acquired cosine fringe encoding image to obtain a wrapped phase image, and the wrapped phase fringe order is obtained by decoding the Gray code encoding image; the confidence of the wrapped phase of any pixel is obtained by using the ratio of the background item and the amplitude item of the cosine fringe obtained simultaneously by phase demodulation, and the pixel whose confidence value is less than a set threshold is defined as an invalid pixel; the gray value of the Gray code encoding image of any pixel is normalized, and the normalized image is represented as , the binary threshold of the camera-acquired image is calculated by using the camera-acquired image corresponding to the Gray code encoding image whose pixel gray values are all 255 and all 0 , and the binary threshold is used to complete the binary processing of the Gray code image to generate a binary image sequence , and the binary mathematical definition is as follows: According to the binarized image sequence And the fringe order graph is calculated by using a gray code decoding algorithm ; The ratio of the background term and the amplitude term obtained by arbitrary pixel phase demodulation is used to describe the confidence of wrapped phase, and the confidence less than a threshold value is defined as invalid pixel pixels whose confidence is less than a threshold value are invalid pixels and are identified by a binary mask Step 3: Identify the pixels with phase values less than 0 and greater than or equal to 0 in the wrapped phase map, generate 2 binary mask images, and eliminate the background pixels at the same time, the mask images are represented as and where the value of the valid pixels is 1, and the value of the invalid pixels is 0; the specific implementation method is as follows: wrapped phase map The value range of any pixel is The value range is used to classify the pixels and two binary mask images and are used to record the location of the two classes of pixels, the values of the two mask images are exactly opposite: The obtained two mask images are respectively multiplied with the mask image Further, invalid pixels with low phase position reliability are removed. Step 4: to the mask image The effective pixels in the region, from left to right, a continuous pixel sequence is traversed, when the interval pixel corresponding to the number of the stripe level has two values, all the pixels in the region take the smaller level value, and after all the effective pixels are traversed, a new stripe level diagram is obtained ; to the mask image The effective pixels in the region, from right to left, a continuous pixel sequence is traversed, when the interval pixel corresponding to the number of the stripe level has two values, all the pixels in the interval take the larger level value, and after all the effective pixels are traversed, a new stripe level diagram is obtained ; the specific implementation method is as follows: Step 4.1: Compute the behavior of the unit in the image; adopt the mask image to identify the continuous reliable pixel position, a segment of continuous pixels in the row direction =1 is defined as a segment of valid pixel area; Step 4.2: Determine the fringe order map Count the number of pixels in the valid pixel region that have a fringe order value of k. When there is only one series value, the pixel series value in the region is not changed; when there are two series values, the fringe series value of all pixels in the region is set to a smaller value; The above results in a fringe order map containing half the pixels of the fringe pattern ; Step 4.3: Use a mask To identify the location of consecutive reliable pixels in the row direction A continuous segment of pixels is defined as a valid pixel region. The types of stripe level values for all pixels within this region are counted. When there are two stripe level values, the larger value is set for all pixels within this region. The above yields a stripe level map containing half the pixels of the stripe pattern. ; Step 5: updating the fringe order map with the newly calculated fringe order map and combining to obtain a fringe order map while simultaneously unwrapping the wrapped phase to obtain an absolute phase map Step 6: Using the method of step 2 to step 5, process the Gray code encoded pattern and the cosine fringe encoded pattern modulated by the measured object captured by the left and right cameras respectively, and get the absolute phase pattern corresponding to the left and right cameras respectively after processing and ; Step 7: completing the matching of corresponding absolute phase images of left and right cameras by using binocular stereo matching technology, and obtaining the three-dimensional appearance of the measured object according to the projection and camera calibration parameters.
2. The method according to claim 1, wherein, The specific implementation method of step 1) is as follows: Step 1.1: building a binocular structured light system composed of a binocular camera and a projector, and calibrating the binocular structured light system; Step 1.2: generating a cosine fringe encoding image with phase shift, and the expression is as follows: wherein represents a fringe background term, represents a cosine fringe amplitude term, represents an absolute phase, is a known phase shift amount, N represents a number of phase shift steps; Step 1.3: Generating the Gray code encoded image The encoding period of the Gray code encoded image is the same as that of the cosine fringe encoded image. The encoded image is projected, and the camera synchronously acquires the image that has been modulated by the height of the measured object.
3. The method according to claim 2, wherein, Step 2) further comprises: Demodulating the phase value of each pixel by using the phase shift principle: wherein represents a background term for any pixel, represents a magnitude term for any pixel, represents the unwrapped phase obtained by solving; because of the arctangent solution, the pixel phase value obtained by phase demodulation has a value range of , in order to obtain the absolute phase of any pixel , the Gray code encoding is used to solve the wrapped phase level value.
4. The method according to claim 3, wherein, The specific implementation method of step 5) is as follows: Step 5.1 : Combining the two fringe order maps and obtaining a fringe order map for all pixels of the image ; Step 5.2: Utilizing the fringe order map and wrapped phase map to obtain the unwrapped absolute phase map ; the mathematical definition of phase unwrapping is described as .
5. The method according to claim 2, wherein In a binocular structured light system, a uniform position of a measured object has the same and unique pixel value in imaging pixels of left and right cameras; a principle of binocular vision stereo matching is used to calculate the same-named pixel points of the left and right cameras by taking phase as a description of the same-named points, which satisfies ; wherein represents movement of image coordinates of the same-named points in imaging in the left and right cameras due to change of a visual angle, which is called a disparity value of a pixel point in stereo vision. Converting the disparity map into a depth map in the camera coordinate system by using binocular system parameters: wherein is the camera focal length, denotes the binocular camera baseline distance, pixel point is an arbitrary pixel point of the image, whose disparity value is , the corresponding three-dimensional coordinates in the camera coordinate system are .