A novel coding method for digital fringe projection
By combining large and small period encoding methods and using lookup tables, the binarization error caused by projector defocusing and noise in high-frequency stripe measurement of the DFPP system is solved, achieving high-precision and efficient phase unfolding, which is suitable for 3D reconstruction in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG ZHIXIANG PHOTOELECTRIC TECH CO LTD
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-10
AI Technical Summary
Existing DFPP systems are susceptible to projector defocusing and noise when measuring high-frequency stripe patterns, leading to binarization errors and phase jumps, making it difficult to achieve reliable phase unfolding, especially with insufficient accuracy under complex surfaces and lighting conditions.
A coding method combining large and small cycles is adopted. By optimizing the cycle numbering, large-cycle code maps and small-cycle code maps are used to mark the high-frequency and low-frequency phase cycles respectively. Binarization and phase expansion are performed in combination with lookup tables to ensure that each codeword contains at least one 0 or 1, thereby reducing errors.
This improved the system's stability and measurement accuracy under complex lighting and surface reflection characteristics, reduced binarization errors caused by projector defocusing and noise, and enabled reliable unfolding and efficient 3D reconstruction of high-frequency phase maps.
Smart Images

Figure CN122371998A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and three-dimensional sensing, and in particular to a novel encoding and decoding method for digital stripe projection, in order to avoid binarization errors caused by projector defocusing in high-frequency grayscale codes, thereby ensuring reliable unfolding of high-frequency phase maps and achieving reliable and accurate phase reconstruction. Background Technology
[0002] In the field of 3D sensing, Digital Fringe Projection Profilometry (DFPP) is an effective technique playing a crucial role in non-contact, high-resolution, and high-speed 3D measurement across various fields such as computer vision, industrial defect detection, and smart manufacturing. Typically, the fringe phase collected by a DFPP system carries the depth information of the measured object. Therefore, the implementation of DFPP mainly involves two steps: fringe pattern acquisition and phase retrieval. To achieve fast and accurate 3D reconstruction, numerous studies have explored the application of multi-frequency methods, complementary Gray codes, and phase-encoding-based techniques in acquiring the desired fringe pattern data. These methods are highly valued for their high accuracy in providing accurate measurement results in various industrial applications. Alongside data acquisition research, phase demodulation methods have also been extensively studied. Among various phase demodulation methods, the phase-shifting method is widely adopted due to its pixel-by-pixel measurement and robustness to reflectivity variations. The application of the phase-shifting method is further divided into two types: phase extraction and phase unwrapping. Unlike traditional interferometry or moiré fringe profilometry, DFPP systems can always obtain accurate phase results through a simple phase-shifting algorithm because the system is unaffected by phase shift errors. Therefore, when the measured surface remains stationary, many phase demodulation algorithms can be used to accurately obtain the phase map of the package of interest, such as the four-step algorithm.
[0003] However, phase unwrapping presents challenges due to the highly discontinuous contours of industrial objects. There are two main methods for phase unwrapping: spatial phase unwrapping (SPU) and temporal phase unwrapping (TPU). SPU is well-known for its sensitivity to noise and poses significant challenges during discontinuities and abrupt changes. In contrast, TPU produces stable and unrestricted results even in 3D measurements of large-scale complex surfaces, making it widely used for measuring isolated objects or discontinuous complex surfaces, covering computational complexity, robustness, and various parameter requirements. However, stable measurement results from existing DFPP systems can only be obtained using low- to mid-frequency fringes. A second problem with TPU is that it requires the additional projection of multiple frames of fringe patterns at different frequencies. Therefore, TPU involves a trade-off between speed and accuracy. Third, TPU is susceptible to certain errors that affect the accuracy of the reconstruction. One is gamma distortion caused by system settings, phase shift steps, and projected sinusoidal fringes. Another is phase error caused by calculating the inverse tangent function and fringe order in the presence of random noise. The former can be corrected through pre-calibration and compensation algorithms, while the latter is unavoidable and difficult to eliminate. Although various phase unwrapping methods have been proposed to achieve reliable and accurate phase unwrapping of DFPP, efficiency and accuracy remain issues, especially in the presence of noise or drastic changes in the object's surface. This problem is further exacerbated when measuring objects with complex surface geometry and lighting conditions using high-frequency fringe patterns. In such cases, higher fringe frequencies do not necessarily translate to higher 3D reconstruction accuracy due to phase unwrapping errors. Therefore, the main challenge in achieving optimal phase retrieval performance lies in how to quickly and accurately unwrap high-frequency encapsulated phase maps. For high speed, Gray code-assisted phase shifting techniques may be a good choice, as projected Gray codes can achieve efficient 3D reconstruction. However, this technique is prone to errors when binarization errors occur at the boundaries between two adjacent codewords in grayscale encoding.
[0004] Currently, an increasing number of researchers are exploring phase correction strategies after obtaining the phase. Given that self-correction methods struggle to remove unfolding errors at the occurrence of steps, Zheng et al. designed an adaptive median filter to attenuate neighborhood contamination. However, this surface-smoothness-based approach struggles to effectively distinguish different step heights in the phase map because the current pixel output by the median filter is easily influenced by the value of another pixel.
[0005] Recent research on robust phase coding methods has extensively explored how the formation mechanisms of different fringe errors affect the 3D shape of FPP measurements. Cao et al., in "H. Cao, D. Qiao, and D. Yang, "Phase correction strategy based on structured light fringe projection profilometry," Opt. Express 32(3), 4137 (2024)," discussed Gray code-assisted phase shifting techniques in detail, investigating the fusion performance of grayscale image and phase map segmentation results at low fringe frequencies. Wu et al., in "Z. Wu, W. Guo, L. Lu, and Q. Zhang, "Generalized phase unwrapping method that avoids jump errors for fringe projection profilometry," Opt. Express 29(17), 27181 (2021)," proposed a robust and efficient 3D measurement method based on Gray code, which avoids jump errors at order boundaries through a three-part phase unwrapping method. However, these methods are only effective for low-frequency fringe patterns and are therefore susceptible to the potential influence of high-frequency fringes. In practice, high-frequency fringe patterns are currently preferred for obtaining more detailed information about the measured object. In such cases, the performance of Gray code-assisted methods is severely affected when higher fringe frequencies appear in the scene. This is because projection of high-frequency grayscale code patterns is prone to binarization errors due to projector defocusing. Furthermore, when using high-frequency Gray code patterns in actual measurements, the saturated pixels of the Gray code pattern can erode neighboring dark pixels, leading to significant phase jump errors. Therefore, overcoming the physical limitations of high-frequency fringe demodulation is urgently needed, which will contribute to the development of reliable measurement methods. Summary of the Invention
[0006] To overcome the shortcomings of the prior art, the present invention aims to provide a novel encoding and decoding method for digital stripe projection. This method is based on the principle that only one bit changes between adjacent codewords in traditional Gray code. It uses a combination of large and small period encoding to uniquely mark the period of the wrapped phase. The small period code map is designed as an equal period code map, and the large period code map is consistent with the design principle of traditional complementary Gray code. Its period decreases as the number of Gray code bits increases. This method has the advantages of wide applicability, high robustness, and strong noise resistance.
[0007] To achieve the above objectives, the technical solution of the present invention is as follows: A novel encoding and decoding method for digital stripe projection includes the following steps: Step 1: Use a combination of large and small period encoding to uniquely mark the period of the wrapping phase in the phase-shifting fringe image captured by the camera. Step 2: Search for the maximum and minimum light intensity values corresponding to each codeword, calculate the binarization threshold, and binarize the code image according to the threshold. Step 3: Based on the binarized small-period code diagram, obtain its lookup code value, find the corresponding level through the lookup table, and solve the initial expanded phase from the small-period level. Step 4: Based on the binarized large-cycle code diagram, obtain its lookup code value, find the corresponding level through the lookup table, expand the initial expanded phase using the large-cycle level, and solve for the final expanded phase.
[0008] Step one specifically involves: The period of the packaged phase is uniquely marked through two stages, including the large-period code map. The level corresponding to the code value Used to mark 4 times the package phase period, small period code map The level corresponding to the code value Used to mark a 1x package phase period, the small-period code map is designed as an equal-period code map, and the period of the large-period code map decreases as the Gray code bit number increases.
[0009] The codeword is a sequence of pixel values at the same pixel in each code image.
[0010] The code pattern is a binary code pattern used to mark the phase period of the package.
[0011] The small-cycle code diagram This refers to a code map used to uniquely mark each of the four adjacent cycles of the wrapped phase.
[0012] The large-cycle code diagram This refers to a code chart used to uniquely mark every four cycles of the wrapped phase as a large cycle.
[0013] The small-period codemap consists of 16 primitive codemaps, each representing 8 code values and reliably and uniquely marking 4 wrapping phase periods. Assuming a fringe frequency of 64, the small-period codemap comprises 64 / 4 = 16 primitive codemaps, with 4 frames. The large-period codemap, on the other hand, has 16 frames. frame.
[0014] Step two specifically involves: The code map design ensures that each codeword contains at least one 0 or 1, and searches for the maximum light intensity value corresponding to each codeword. and minimum light intensity value Then the binarization threshold can be obtained as: (3) These are the five light intensity values at the same pixel location in five large-period code images; These are the four light intensity values at the same pixel position in the four small-period code images; code Figure 2 Value transformation: (4) in, , This represents the binarized code image.
[0015] Step three specifically involves: Based on the binarized small-period code diagram The lookup key value is obtained as follows: (5) Furthermore, by looking up table (1), we can obtain the result. Corresponding level ; Lookup table (1): Let the package phase be Then the small-period order of the wrapped phase is calculated. for: (6) in , ; Therefore, use Obtain the initial expansion phase , (7) in .
[0016] Step four specifically involves: Based on the binarized large-cycle code diagram The lookup key value is obtained as follows: (8) The table is obtained by looking up table (2) and... , Corresponding level ; Lookup Table 2 is: The large period order of the calculated wrap phase for: (9) in ; use right The expansion is performed to obtain the final expanded phase. : (10) in .
[0017] Compared with the prior art, the advantages of the present invention are: 1. This invention uses a combination of large and small period encoding methods. By optimizing the determination method of period numbering, each phase period can be marked with large intervals. This method has stronger robustness to defocusing, effectively solves the binarization error problem caused by projector defocusing in high-frequency grayscale codes, and reduces the phase jump phenomenon caused by period numbering errors, thereby ensuring the reliable unfolding of high-frequency phase maps.
[0018] 2. The code image of this invention is designed to ensure that each codeword contains at least one 0 or 1. This design avoids the need for additional projection of black and white images during the binarization process, thus improving the measurement speed.
[0019] In summary, this method uses a combination of large and small period encoding to enable the system to maintain stable measurement performance under complex lighting conditions and different surface reflection characteristics, thereby improving the system's environmental adaptability. Attached Figure Description
[0020] Figure 1 It is a complete encoding diagram.
[0021] Figure 2 yes , , Schematic diagram.
[0022] Figure 3 It is the encoding of a single unit.
[0023] Figure 4 yes , , Schematic diagram.
[0024] Figure 5 yes , , Schematic diagram. Detailed Implementation
[0025] This invention discloses a novel encoding strategy for large-gap grayscale codes and a corresponding decoding strategy. The technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. These are merely one embodiment of the invention and are not intended to limit the invention in any way. Therefore, any simple modifications, equivalent changes, or modifications made to the above embodiments based on the technical essence of this invention shall still fall within the scope of the technical solutions of this invention.
[0026] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0027] A novel encoding and decoding method for digital stripe projection includes the following steps: Phase extraction using phase shifting method In the DFPP system of phase-shift profilometry, the phase-shift fringe image captured by the camera is represented as follows: (1) in Indicates the first m The light intensity of the striped pattern Indicates background light intensity. Representative adjustment system, f It is the fringe frequency. It is the phase, which carries the depth information of the object. It is the phase shift of the striped pattern, in which , M It is the number of phase shift steps. It is the initial phase.
[0028] The formula for solving the phase using the multi-step phase shift algorithm is as follows: (2) In equation (2), This represents the phase obtained through demodulation, after applying the arctangent function. Enclosed in the interval After obtaining the stripe order in subsequent steps, Phase unrolling is performed to obtain continuous absolute phases. .
[0029] Large-gap grayscale code design As is well known, the more grayscale patterns there are, the more unique the markings of the stripe patterns become. This means that when using high-frequency stripes, higher-frequency grayscale patterns must be used. Unlike other encoding methods, the encoding of this invention retains medium frequencies for each code image, thus exhibiting greater robustness against defocusing. This characteristic is highly advantageous in three-dimensional shape measurement due to its robustness and noise resistance.
[0030] The high-frequency stripes refer to Gray codes projected by a projector in scenarios requiring high-precision measurements, which match the frequency of the phase-shifted stripes. Figure 2 After value-modification, "adhesion" is prone to occur, and such phase-shifted fringes are called high-frequency fringes.
[0031] The term "medium frequency" refers to the code that matches the frequency of the phase-shifted fringes after being projected by a projector, in scenarios requiring high-precision measurements. Figure 2 Value-enhanced codes are less prone to "sticking" and are therefore called medium-frequency codes.
[0032] In traditional complementary Gray code with phase shift, the width of the highest frequency Gray code decreases as the phase shift fringe frequency increases, making binarization prone to errors and consequently leading to decoding errors. This invention proposes a novel encoding and decoding strategy, denoted as the Fundamental Gray-Code Unit.
[0033] The encoding strategy is to use a combination of large and small periods to uniquely mark the period of the wrapped phase. The code diagram of the present invention is as follows Figure 1 As shown. It includes a large-cycle code diagram (see...). Figure 1 middle ) and small-cycle code chart (see Figure 1 middle )composition. It is a standard 5-bit Gray code. The design also follows the principle that only one bit changes between adjacent codewords in Gray code, thus possessing the spatial continuity and reliability of ordinary Gray code encoding.
[0034] The code map of this invention uniquely marks the period of the wrapped phase through two stages, wherein the large-period code map... The level corresponding to the code value Used to mark 4 times the package phase period, small period code map The level corresponding to the code value Used to mark 1x the wrapping phase period, such as Figure 2 As shown. The small-period code map of this invention is designed as an equal-period code map, while the large-period code map follows the design principle of traditional complementary Gray code, with its period decreasing as the number of Gray code bits increases. Unlike traditional complementary Gray code, this invention uses a combination of large and small periods for encoding, thus allowing each phase period to be marked at large intervals.
[0035] The codeword is a sequence of pixel values at the same pixel in each code image, i.e., as shown below. Figure 1 Each column shown.
[0036] The code image is a binary code pattern used to mark the phase period of the package. The first row of each code image is taken, as shown below. Figure 1 As shown.
[0037] The small-cycle code diagram This refers to a code map used to uniquely mark each of the four adjacent cycles of the package phase, i.e., as shown below. Figure 1 The lower half is shown.
[0038] The large-cycle code diagram This refers to a code diagram used to uniquely mark every four cycles of the wrapped phase as a large cycle, i.e., as shown in the example. Figure 1 The upper half shown.
[0039] The primitive code diagram of the small-period code diagram designed in this invention is as follows: Figure 3 As shown. One primitive code map represents 8 code values, which can reliably and uniquely identify 4 wrapper phase periods. Assuming the fringe frequency is 64, then the small-period code map consists of 64 / 4 = 16 primitive code maps, with 4 frames, while the large-period code map has 16 frames. frame.
[0040] Decoding strategy The decoding stage includes three stages: binarization, code value calculation, and level calculation.
[0041] Step 1: Search for the maximum and minimum light intensity values corresponding to each codeword, calculate the binarization threshold, and binarize the code image according to the threshold. Unlike traditional complementary Gray codes, the codemap of this invention guarantees that each codeword contains at least one 0 or 1. This design avoids the need for additional black and white projections during binarization. The specific binarization method is as follows: Search for the maximum light intensity value corresponding to each codeword. and minimum light intensity value Then the binarization threshold can be obtained as: (3) These are the five light intensity values at the same pixel location in five large-period code images; These are the four light intensity values at the same pixel position in the four small-period code images; The specific binarization process of the code image is as follows: (4) in, , This represents the binarized code image.
[0042] Step 2: Decoding the small-cycle code image. Based on the binarization result, obtain the lookup code value of the small-cycle code image. Find the corresponding level using a lookup table, and solve for the initial expanded phase from the small-cycle level. Then, the small-cycle code image can be obtained. The lookup code value is: (5) Furthermore, by looking up table (1), we can obtain the result that is related to... Corresponding level .
[0043] Let the package phase be Then the small-period order of the wrapped phase is calculated. for: (6) in , .
[0044] Therefore, use The initial expansion phase can be obtained. The process is as follows Figure 4 As shown.
[0045] (7) in .
[0046] Step 3: Decoding the large-cycle code image, that is, obtaining the lookup code value of the large-cycle code image from the binarization result, finding the corresponding level through the lookup table, expanding the initial expanded phase by the large-cycle level, and solving for the final expanded phase.
[0047] Large cycle code chart The lookup code value is: (8) The table is obtained by looking up table (2) and... , Corresponding level .
[0048] The large period order of the calculated wrap phase for: (9) in .
[0049] use right The expansion is performed, thus obtaining the final expanded phase. The process is as follows Figure 5 As shown.
[0050] (10) in .
[0051] This invention proposes a robust high-frequency grayscale code encoding and decoding framework for digital fringe projection (DFP) systems. This method aims to overcome the problem of edge binarization misjudgment caused by projector defocusing blur in high-frequency auxiliary modes during 3D reconstruction, significantly improving the stability of phase unfolding and the accuracy of geometric reconstruction under complex measurement environments. It completely solves the persistent problem of "order misalignment" under high-frequency fringes, achieving a highly efficient balance between high spatial resolution and high reconstruction accuracy.
Claims
1. A novel encoding and decoding method for digital stripe projection, comprising the following steps: Step 1: Use a combination of large and small period encoding to uniquely mark the period of the wrapping phase in the phase-shifting fringe image captured by the camera. Step 2: Search for the maximum and minimum light intensity values corresponding to each codeword, calculate the binarization threshold, and binarize the code image according to the threshold. Step 3: Based on the binarized small-period code diagram, obtain its lookup code value, find the corresponding level through the lookup table, and solve the initial expanded phase from the small-period level. Step 4: Based on the binarized large-cycle code diagram, obtain its lookup code value, find the corresponding level through the lookup table, expand the initial expanded phase using the large-cycle level, and solve for the final expanded phase.
2. The novel encoding and decoding method for digital stripe projection according to claim 1, characterized in that, Step one specifically involves: The period of the packaged phase is uniquely marked through two stages, including the large-period code map. The level corresponding to the code value Used to mark 4 times the package phase period, small period code map The level corresponding to the code value Used to mark a 1x package phase period, the small-period code map is designed as an equal-period code map, and the period of the large-period code map decreases as the Gray code bit number increases.
3. A novel encoding and decoding method for digital stripe projection according to claim 2, characterized in that, The small-cycle code diagram This refers to a code map used to uniquely mark each of the four adjacent cycles of the wrapped phase. The large-cycle code diagram This refers to a code chart used to uniquely mark every four cycles of the wrapped phase as a large cycle.
4. A novel encoding and decoding method for digital stripe projection according to claim 3, characterized in that, The small-period codemap consists of 16 primitive codemaps, each representing 8 code values and reliably and uniquely marking 4 wrapping phase periods. Assuming a fringe frequency of 64, the small-period codemap comprises 64 / 4 = 16 primitive codemaps, with 4 frames. The large-period codemap, on the other hand, has 16 frames. frame.
5. A novel encoding and decoding method for digital stripe projection according to claim 1, characterized in that, The codeword is a sequence of pixel values at the same pixel in each code image. The code pattern is a binary code pattern used to mark the phase period of the package.
6. A novel encoding and decoding method for digital stripe projection according to claim 1, characterized in that, Step two specifically involves: The code map design ensures that each codeword contains at least one 0 or 1, and searches for the maximum light intensity value corresponding to each codeword. and minimum light intensity value Then the binarization threshold can be obtained as: (3) These are the five light intensity values at the same pixel location in five large-period code images; These are the four light intensity values at the same pixel position in the four small-period code images; The code image is binarized as follows: (4) in, , This represents the binarized code image.
7. A novel encoding and decoding method for digital stripe projection according to claim 6, characterized in that, Step three specifically involves: Based on the binarized small-period code diagram The lookup key value is obtained as follows: (5) Furthermore, by looking up table (1), we can obtain the result. Corresponding level ; Lookup table (1): Let the package phase be Then the small-period order of the wrapped phase is calculated. for: (6) in , ; Therefore, use Obtain the initial expansion phase , (7) in .
8. A novel encoding and decoding method for digital stripe projection according to claim 6, characterized in that, Step four specifically involves: Based on the binarized large-cycle code diagram The lookup key value is obtained as follows: (8) The table is obtained by looking up table (2) and... , Corresponding level ; Lookup Table 2 is: The large period order of the calculated wrap phase for: (9) in ; use right The expansion is performed to obtain the final expanded phase. : (10) in .