A three-dimensional measurement method based on ternary complementary Gray code phase unwrapping

Through the ternary complementary Gray code phase unwrapping method, the problems of high projection cost and order error in the traditional Gray code method are solved, and efficient and accurate three-dimensional measurement is achieved.

CN116734762BActive Publication Date: 2025-09-26SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310583891.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2025-09-26
Estimated Expiration
2043-05-23

AI Technical Summary

Technical Problem

The traditional Gray code method requires projecting multiple images in three-dimensional measurement, which increases the projection cost. In addition, the edge areas of the Gray code codewords are prone to level errors, and the binary coding efficiency is low.

Method used

The ternary complementary Gray code phase unwrapping method is adopted. The multi-step phase-shifted fringe image and the ternary Gray code pattern are generated by computer. The multi-step phase-shifting method is used to calculate the wrapped phase. Combined with the three groups of candidate level judgments, the continuous phase of the object is finally restored.

Benefits of technology

The projection cost is reduced, the coding efficiency and noise resistance performance are improved, and the accuracy of the measurement results and the correctness of the level solution are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116734762B_ABST
    Figure CN116734762B_ABST
Patent Text Reader

Abstract

The present invention provides a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping, comprising the following steps: S1: designing the required multi-step phase-shifted fringe image and ternary Gray code pattern, as well as an additional ternary complementary Gray code pattern; S2: projecting the generated fringe image and Gray code pattern using a projector, and capturing the deformed fringe image and Gray code pattern with a camera; S3: calculating the wrapped phase using a multi-step phase shift method; S4: calculating the threshold distribution required for segmenting the ternary Gray code pattern using the multi-step phase-shifted fringe image; S5: performing threshold segmentation on the Gray code pattern to obtain corresponding codewords, decoding the codewords to obtain three sets of candidate levels; S6: determining the final phase level using the three sets of candidate levels, restoring the wrapped phase, and ultimately obtaining a continuous phase distribution of the object. The three-dimensional measurement method based on ternary complementary Gray code phase unwrapping provided by the present invention has the advantages of high coding efficiency, good noise immunity, and high measurement accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional measurement, and in particular to a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping. Background Art

[0002] Fringe projection profilometry is widely used in many fields such as mechanical assembly, device modification, biomedicine and cultural relics protection due to its advantages of simple implementation, high accuracy and fast measurement speed.

[0003] During the three-dimensional measurement process, stripe structured light is mainly used for measurement. Since inverse trigonometric functions are used in the phase calculation process, the phase containing the three-dimensional information of the object is wrapped, which requires the recovery of the wrapped phase.

[0004] Phase recovery methods are mainly categorized into spatial unwrapping and temporal unwrapping. Compared to spatial unwrapping, temporal unwrapping exhibits superior noise immunity and is therefore widely used. Among temporal unwrapping methods, unwrapping algorithms based on Gray codes offer advantages due to their high robustness and measurement accuracy. However, traditional Gray code methods require the projection of numerous images for measurement, increasing projection costs. Furthermore, the edges of Gray code codewords are prone to level errors. In information science, ternary coding is more efficient than binary coding and is the most effective encoding method because it is closest to the base e of the natural logarithm.

[0005] Therefore, it is necessary to provide a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping to solve the above technical problems. Summary of the Invention

[0006] The present invention provides a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping, which solves the problem.

[0007] To solve the above technical problems, the present invention provides a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping, comprising the following steps:

[0008] S1: Use computer to design the required multi-step phase-shift fringe images and ternary Gray code patterns, as well as additional ternary complementary Gray code patterns;

[0009] S2: Use a projector to project the generated fringe image and Gray code pattern, and then the camera captures the deformed fringe image and Gray code pattern;

[0010] S3: Calculate the wrapping phase using the multi-step phase shift method;

[0011] S4: Calculate the threshold distribution required for ternary Gray code pattern segmentation using multi-step phase-shifted fringe images;

[0012] S5: performing threshold segmentation on the Gray code pattern to obtain corresponding codewords, and decoding the codewords to obtain three groups of candidate levels;

[0013] S6: The final phase order is obtained by judging the three sets of candidate orders, and the wrapped phase is restored to finally obtain the continuous phase distribution of the object.

[0014] Preferably, the specific steps of S1 are as follows:

[0015] S101: Computer generates the multi-step phase shift fringe image required to obtain the phase;

[0016] S102: A computer generates a ternary Gray code pattern and a ternary complementary Gray code pattern required for obtaining the level information.

[0017] Preferably, the specific steps of S3 are as follows:

[0018] S301: The deformed stripes obtained according to step S2 are expressed as follows:

[0019] I n (x,y)=A(x,y)+B(x,y)cos[Φ(x,y)-2πn / N]n=1,2,...,N

[0020] Among them I n (x,y) is the obtained deformed fringe, A(x,y) is the background light intensity, B(x,y) is the modulated light intensity, n is the phase shift step index, N is the phase shift step number, and Φ(x,y) is the phase of the object;

[0021] S302: Calculate the wrapped phase using the obtained deformed fringe image. The calculation formula is:

[0022]

[0023] The phase calculated using the above formula is the wrapped phase, and the levels obtained using the Gray code pattern are subsequently used to restore the wrapped phase to a continuous phase.

[0024] Preferably, the specific steps of S4 are as follows:

[0025] S401: Since ternary encoding is used, two threshold distributions are required for decoding. First, use the following formula to calculate A(x,y):

[0026]

[0027] where I1, I2, ..., I N is the collected multi-step phase-shift fringe image;

[0028] S402: Next, calculate B(x,y) using the following formula:

[0029]

[0030] Next, calculate the threshold required for image segmentation:

[0031]

[0032]

[0033] Where Th1(x,y) and Th2(x,y) are the threshold distributions required for image segmentation.

[0034] Preferably, the specific steps of S5 are as follows:

[0035] S501: Use two threshold distributions to segment the Gray code pattern and calculate the codeword information. The formula is as follows:

[0036]

[0037] Code i (x, y) is the codeword information obtained by threshold segmentation calculation, Gray i (x, y) is the Gray code pattern, m is the number of Gray code patterns;

[0038] S502: After obtaining the codeword information, the obtained codeword is decoded. The calculation formula is:

[0039]

[0040] V m (x,y)=MAP{V(x,y)}

[0041] Where V(x,y) is the obtained Gray code word, MAP{·} is the permutation operation, and V m (x,y) is the rearranged codeword;

[0042] S503: Next, the level is calculated using the rearranged codewords. The calculation formula is:

[0043]

[0044] where k i (x, y) are the three sets of candidate levels obtained, i = 1, 2, 3, CEIL{·}, FLOOR{·}, ROUND{·} are upward, downward, and nearest integer, respectively;

[0045] S504: Next, the final phase order is calculated using the three sets of candidate orders:

[0046]

[0047] where k(x,y) is the final phase order.

[0048] Preferably, the specific steps of S6 are as follows:

[0049] S601: Use the obtained level information to restore the wrapped phase to a continuous phase. The calculation formula is as follows:

[0050]

[0051] in is the wrapped phase, and Φ(x,y) is the continuous phase.

[0052] Compared with related technologies, the three-dimensional measurement method based on ternary complementary Gray code phase unwrapping provided by the present invention has the following beneficial effects:

[0053] This paper provides a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping. This method projects a multi-step phase-shifted fringe image and a ternary complementary Gray code pattern. Using the proposed threshold calculation method, additional projection images are not required for threshold determination, reducing projection costs. Furthermore, the final phase order is calculated using three sets of candidate orders, further improving the accuracy of the order solution. This method offers advantages such as high coding efficiency, excellent noise immunity, and high measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 4 is a measurement flow chart of the method of the present invention.

[0055] Figure 2 Schematic diagram of fringe projection profilometry based on ternary Gray code.

[0056] Figure 3 Schematic diagram of the positional relationship between the two threshold lines, three envelope lines and the stripe pattern.

[0057] Figure 4 Schematic diagram of determining the ternary Gray code word by two thresholds.

[0058] Figure 5 Graph showing the ternary complementary Gray code (3, 3) and the process of solving the order.

[0059] Figure 6 is the segment selection strategy diagram for the final phase order k.

[0060] Figure 7 Schematic diagram comparing the order errors between the threshold calculation strategy for the three attached images and the proposed threshold calculation strategy.

[0061] Figure 8 A comparison chart of the measurement results using different methods. DETAILED DESCRIPTION

[0062] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0063] Please refer to Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 、 Figure 6 、 Figure 7 and Figure 8 ,in, Figure 1 It is a measurement flow chart of the method of the present invention; Figure 2 The schematic diagram of fringe projection profilometry based on ternary Gray code; Figure 3 Schematic diagram of the positional relationship between two threshold lines, three envelope lines and the fringe pattern; Figure 4 Schematic diagram of determining ternary Gray code words by two thresholds; Figure 5 The diagram is a ternary complementary Gray code (3, 3) and the process of solving the order; Figure 6 is the segment selection strategy diagram for the final phase order k; Figure 7 A schematic diagram showing the comparison of the order errors between the threshold calculation strategy for the three attached images and the proposed threshold calculation strategy; Figure 8 A three-dimensional measurement method based on ternary complementary Gray code phase unwrapping includes the following steps:

[0064] S1: Use computer to design the required multi-step phase-shift fringe images and ternary Gray code patterns, as well as additional ternary complementary Gray code patterns;

[0065] S2: Use a projector to project the generated fringe image and Gray code pattern, and then the camera captures the deformed fringe image and Gray code pattern;

[0066] S3: Calculate the wrapping phase using the multi-step phase shift method;

[0067] S4: Calculate the threshold distribution required for ternary Gray code pattern segmentation using multi-step phase-shifted fringe images;

[0068] S5: performing threshold segmentation on the Gray code pattern to obtain corresponding codewords, and decoding the codewords to obtain three groups of candidate levels;

[0069] S6: The final phase order is obtained by judging the three sets of candidate orders, and the wrapped phase is restored to finally obtain the continuous phase distribution of the object.

[0070] Compared with related technologies, the three-dimensional measurement method based on ternary complementary Gray code phase unwrapping provided by the present invention has the following beneficial effects:

[0071] This paper provides a three-dimensional measurement method based on ternary complementary Gray code phase unwrapping. This method projects a multi-step phase-shifted fringe image and a ternary complementary Gray code pattern. Using the proposed threshold calculation method, additional projection images are not required for threshold determination, reducing projection costs. Furthermore, the final phase order is calculated using three sets of candidate orders, further improving the accuracy of the order solution. This method offers advantages such as high coding efficiency, excellent noise immunity, and high measurement accuracy.

[0072] Second embodiment

[0073] This embodiment is a measurement system diagram of the specific embodiment 1, such as Figure 2 shown. Specific embodiment three

[0075] This embodiment is about solving the segmentation threshold. Based on the first embodiment, the specific steps of step S4 are further defined as follows:

[0076] First calculate A(x,y) using the following formula:

[0077]

[0078] where I1, I2, ..., I N is the collected multi-step phase-shift fringe image;

[0079] Next, use the following formula to calculate B(x,y):

[0080]

[0081] Next, calculate the threshold required for image segmentation:

[0082]

[0083]

[0084] Where Th1(x,y) and Th2(x,y) are the threshold distributions required for image segmentation.

[0085] The positional relationship between the two threshold lines, three envelope lines and the fringe pattern is as follows: Figure 3 As shown, the two threshold lines are located in the middle of two of the three envelope lines, and the three envelopes are the top, middle and bottom of the fringe pattern respectively. Specific embodiment 4

[0087] This embodiment is ternary Gray code decoding. Based on the first embodiment, the specific steps of step S5 are further defined as follows:

[0088] The Gray code pattern is segmented using the calculated threshold value. The calculation formula is:

[0089]

[0090] The schematic diagram of determining the ternary Gray code word by two thresholds is as follows Figure 4 As shown, if the grayscale value of the Gray code pattern belongs to the following situations: lower than Th1, between Th1 and Th2, or higher than Th2, the code word is determined to be 0, 1, or 2, respectively. Specific embodiment five

[0092] This embodiment is about codeword solution and level calculation. Based on the first embodiment, the specific steps of step S5 are further defined as follows:

[0093] After obtaining the codeword information, the obtained codeword is decoded, and the calculation formula is:

[0094]

[0095] V m (x,y)=MAP{V(x,y)}

[0096] Where V(x,y) is the obtained Gray code word, MAP{·} is the permutation operation, and V m (x,y) is the rearranged codeword.

[0097] Next, the level is calculated using the rearranged codewords. The calculation formula is:

[0098]

[0099] where k i (x, y) are the three sets of candidate levels obtained, i = 1, 2, 3, CEIL{·}, FLOOR{·}, ROUND{·} are rounding up, rounding down, and rounding to the nearest integer, respectively.

[0100] The above steps take the ternary complementary Gray code (3, 3) as an example, and the process of solving the level is as follows: Figure 5 As shown, 3 and 3 in (3, 3) represent the ternary base and three Gray code patterns respectively. i 、C i , V and V m The definitions of are the Gray code pattern, the corresponding codeword, the decoded codeword, and the rearranged codeword, respectively. k1, k2, and k3 are the candidate levels calculated by the proposed method, and k is the final phase level. The background color indicates the final phase level selected from the corresponding candidate levels with the same color. Specific embodiment six

[0102] This embodiment is for determining the final phase order and restoring the continuous phase. Based on the first embodiment, the specific steps of step S5 are further defined as follows:

[0103] Calculate the final phase order using three sets of candidate orders:

[0104]

[0105] where k(x,y) is the final phase order.

[0106] The obtained order information is used to restore the wrapped phase to a continuous phase. The calculation formula is as follows:

[0107]

[0108] in is the wrapped phase, and Φ(x,y) is the continuous phase.

[0109] The segment selection strategy for the final phase order k is as follows: Figure 6 As shown, the phase order k is determined by selecting the order in the middle reliable segment of each candidate order, and the background color indicates the correspondence between the wrapped phase and the order to be determined. Specific embodiment seven

[0111] This example verifies the proposed threshold calculation strategy and compares it with the strategy of appending three images, such as Figure 7 As shown, Figure 7 Comparison of the order error between the threshold calculation strategy for the three additional images and the proposed threshold calculation strategy. Both strategies are used in conjunction with the proposed ternary complementary method. (a) and (b) show two target objects to be measured, with the images in the lower left and lower right corners representing a stripe image and a ternary Gray code pattern, respectively. (c) and (d) show the results of the threshold calculation strategy for the three additional images. (e) and (f) show the results of the proposed threshold calculation strategy. The main part of each result is the measured 3D profile, with the order error rate shown to the right, and the error location marked with a red dot.

[0112] To objectively analyze the difference in the levels calculated by these two methods, the proposed ternary complementary method was used to calculate the final phase levels for both strategies. Both strategies use four-step phase-shifted fringes and four ternary Gray code patterns (3 coded patterns + 1 complementary pattern). Furthermore, the results obtained using a binary complementary Gray code method at a high projection number were selected as the reference truth. This was calculated using 24-step phase-shifted fringes and 6 binary Gray code patterns (5 coded patterns + 1 complementary pattern). The results show the calculated 3D profiles, as well as the level error rate and error location. It can be seen that both the additional three-image strategy and the proposed calculation strategy achieve good measurement results with very low error rates. However, a more detailed comparison shows that the proposed strategy has an even slightly lower error rate. Specific embodiment eight

[0114] This embodiment comprehensively compares the proposed ternary complementary Gray code method with the binary complementary Gray code method and the traditional ternary Gray code method. Figure 8 As shown, the upper part of the figure shows the phase-shifted stripes (PS) and Gray code patterns (GC) required for projection using different methods: (a) the binary complementary method, (b) the proposed ternary complementary method, and (c) the traditional ternary method. Each method measures three different scenarios. (d), (e), and (f) are the measurement results of (a), (b), and (c), respectively, and (g) is the reference truth value.

[0115] The traditional ternary method, named [1], does not have complementary patterns and requires three more images to be projected for threshold segmentation. To make the comparison fairer, all methods use four fringe patterns for phase calculation, while the binary complementary method and the proposed ternary complementary method use four Gray code patterns. Due to the lack of complementary patterns in the traditional ternary method, the number of Gray code patterns is three, but it is worth emphasizing that its fringe pattern is exactly the same as that of the proposed method. In this setting, the maximum order that the binary complementary method can encode is 2 3 The maximum level that the traditional ternary method and the proposed ternary complementary method can encode is 3 3 . Since the binary method encodes fewer orders under the same number of Gray code patterns, and the stripe period needs to be consistent with the width of the lowest Gray code, the stripe frequency will be smaller than the traditional ternary method and the proposed method. The reference truth method selected in this comparison also uses 24-step phase-shifted stripes and 6 binary Gray code patterns (5 encoding patterns + 1 complementary pattern). In order to better show the differences between these methods, three different scenarios were constructed. It can be seen that the outline of the binary complementary method is rougher, and the proposed complementary ternary method has the same roughness as the traditional ternary method and is better than the binary complementary method. However, the traditional ternary method has no order correction, so there are some height jumps in the results. Compared with the reference truth, the results of the proposed method are better.

[0116] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A three-dimensional measurement method based on ternary complementary Gray code phase unwrapping, characterized in that: The following steps are involved: S1: Use computer to design the required multi-step phase-shift fringe images and ternary Gray code patterns, as well as additional ternary complementary Gray code patterns; S2: Use a projector to project the generated fringe image and Gray code pattern, and then the camera captures the deformed fringe image and Gray code pattern; S3: Calculate the wrapping phase using the multi-step phase shift method; S4: Calculate the threshold distribution required for ternary Gray code pattern segmentation using multi-step phase-shifted fringe images; S5: performing threshold segmentation on the Gray code pattern to obtain corresponding codewords, and decoding the codewords to obtain three groups of candidate levels; S6: Use the three sets of candidate orders to determine the final phase order, recover the wrapped phase, and finally obtain the continuous phase distribution of the object; The specific steps of S4 are as follows: S401: Since ternary encoding is used, two threshold distributions are required for decoding. First, the following formula is used to calculate : , in is the collected multi-step phase-shift fringe image, where n=1, 2, 3...N, To obtain the deformation fringes, is the background light intensity, Phase shift step index, is the number of phase shift steps; S402: Next, use the following formula to calculate the modulated light intensity : , Next, calculate the threshold required for image segmentation: , in 、 The threshold distribution required for image segmentation; The specific steps of S5 are as follows: S501: Use two threshold distributions to segment the Gray code pattern and calculate the codeword information. The formula is as follows: , is the codeword information obtained through threshold segmentation calculation, is the Gray code pattern, is the number of Gray code patterns; S502: After obtaining the codeword information, the obtained codeword is decoded. The calculation formula is: , in To obtain the Gray code word, is the rearrangement operation, is the rearranged codeword; S503: Next, the level is calculated using the rearranged codewords. The calculation formula is: , in For the three groups of candidate grades obtained, , 、 、 They are round up, round down, and round to the nearest integer; S504: Next, the final phase order is calculated using the three sets of candidate orders: , in is the final phase order, where For the wrapping phase.

2. The three-dimensional measurement method based on ternary complementary Gray code phase unwrapping according to claim 1, characterized in that: The specific steps of S1 are as follows: S101: Computer generates the multi-step phase shift fringe image required to obtain the phase; S102: A computer generates a ternary Gray code pattern and a ternary complementary Gray code pattern required for obtaining the level information.

3. The three-dimensional measurement method based on ternary complementary Gray code phase unwrapping according to claim 1, characterized in that: The specific steps of S3 are as follows: S301: The deformed stripes obtained according to step S2 are expressed as follows: , in To obtain the deformation fringes, is the background light intensity, is the modulated light intensity, Phase shift step index, is the number of phase shift steps, is the phase of the object; S302: Calculate the wrapped phase using the obtained deformed fringe image. The calculation formula is: , The phase calculated using the above formula is the wrapped phase, and the levels obtained using the Gray code pattern are subsequently used to restore the wrapped phase to a continuous phase.

4. The three-dimensional measurement method based on ternary complementary Gray code phase unwrapping according to claim 3, characterized in that: The specific steps of S6 are as follows: S601: Use the obtained level information to restore the wrapped phase to a continuous phase. The calculation formula is as follows: , in is the wrapping phase, is a continuous phase.