High-quality binary stripe generation method based on 2 +1 phase shift algorithm

By adopting a high-quality binary stripe generation method based on the 2+1 phase shift algorithm in structured light three-dimensional reconstruction technology, the problem of DC component error after defocus is solved, and the performance of the measurement system is improved.

CN119741428AActive Publication Date: 2025-04-01HEFEI UNIV OF TECH +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411877357.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-01
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

In the three-dimensional reconstruction technology of structured light, after the binary sinusoidal stripe pattern is defocused, the gray value of the DC component is different from the uniform grayscale pattern, resulting in DC component errors and affecting the measurement accuracy.

Method used

A high-quality binary stripe generation method based on the 2+1 phase shift algorithm is adopted, and the optimized binary stripe pattern is generated through steps such as Bayer jitter, pre-intensity optimization, and comprehensive optimization to reduce the DC component error.

Benefits of technology

The phase quality of the binary stripe pattern at different degrees of defocus is improved, the measurement error is reduced, and the performance of the measurement system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741428A_ABST
    Figure CN119741428A_ABST
Patent Text Reader

Abstract

The invention discloses a high-quality binary stripe generation method based on a 2 + 1 phase shift algorithm, and the method comprises the steps: 1, making a binary stripe pattern, and intercepting a part as a patch; 2, performing intensity optimization preprocessing on the patch; 3, performing comprehensive optimization processing on the pre-optimized patch so as to reduce a direct current component error introduced by a 2 + 1 phase shift algorithm; 4, changing the size of the patch, and repeating the step 2 and the step 3; and 5, selecting the patch with the optimal performance, and splicing the patch into a complete stripe pattern group. Under the binary out-of-focus technology, by reducing the direct current component error introduced by the 2 + 1 phase shift algorithm, better phase quality can be obtained under different out-of-focus degrees, and the measurement performance of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of structured light three-dimensional reconstruction, and in particular to the extraction of high-quality binary stripes under defocus technology. Technical Background

[0002] Structured light 3D reconstruction technology is a non-contact optical 3D measurement technology. Binary defocusing technology can improve measurement speed and accuracy and eliminate the nonlinear error of the projector. In the improved 2+1 phase shifting algorithm, only two sinusoidal patterns with a phase shift of π / 2 and a uniform grayscale pattern are required. Compared with the ordinary three-step phase shifting algorithm, the uniform grayscale image is much less sensitive to motion blur than the grating pattern, so it can effectively reduce the measurement error caused by object motion. However, the DC component of the binary sinusoidal fringe pattern after defocusing is different from the grayscale value of the uniform grayscale pattern, causing DC component error. Summary of the invention

[0003] In order to solve the problems existing in the prior art, a method for generating high-quality binary fringes based on a 2+1 phase shift algorithm is proposed, in order to reduce the measurement error caused by the DC component and obtain better phase quality at different defocus levels, thereby improving the performance of the measurement system.

[0004] The technical solution adopted by the present invention to solve the technical problem is:

[0005] The method for generating high-quality binary fringes based on a 2+1 phase shift algorithm of the present invention is characterized in that it comprises the following steps:

[0006] Step 1, using the Bayer dithering method to perform Bayer dithering on the standard sinusoidal fringe pattern to obtain an initial binary sinusoidal fringe pattern; according to the periodicity of the sinusoidal fringe pattern, a part of the initial binary sinusoidal fringe pattern is intercepted as patch A, and the column period of the patch A is the period number of the sinusoidal fringe pattern, and the row period is 2;

[0007] Step 2, performing pre-strength optimization on the patch A to obtain patch B;

[0008] Step 3: Comprehensively optimize patch B to obtain patch C;

[0009] Step 4: Increase the row period of patch A by one pixel to change the size of patch A, and determine whether the row period number of patch A exceeds the maximum value Max. If so, it means that Max patches C of different sizes are obtained; otherwise, return to step 2 and execute sequentially;

[0010] Step 5: Calculate the phase values ​​of the binary fringe pattern composed of Max patches C at different defocus levels, and select the patch with the smallest root mean square error as the optimal patch, so as to tile the optimal patch into a complete fringe pattern, that is, a high-quality binary fringe pattern.

[0011] The method for generating high-quality binary fringes based on a 2+1 phase shift algorithm described in the present invention is also characterized in that step 2 comprises the following steps:

[0012] Step 2.1, mutate each pixel in patch A in turn, and periodically tile the patch A after each mutation to obtain the first binary update pattern after the mutation;

[0013] Step 2.2: Gaussian filter the first binary update pattern after the current pixel point mutation to obtain the filtered pattern shown in formula (1): :

[0014] (1)

[0015] In formula (1): Represents the filtered pattern In the middle Gray value of the position; Representation pattern frequency; express exist The DC component at express exist The amplitude at

[0016] Step 2.3, calculation and The intensity root mean square error between the corresponding standard sinusoidal fringe patterns is compared with the intensity root mean square error between the pattern after the previous pixel point mutation and filtering and its corresponding standard sinusoidal fringe pattern. If the error is reduced, the current pixel point after the mutation is retained; otherwise, the current pixel point before the mutation is retained; thus completing a round of mutation;

[0017] Step 2.4: Perform several rounds of mutation according to the process of steps 2.1 to 2.3 until the root mean square error of the intensity no longer changes, so that the final mutated patch A is used as patch B.

[0018] Furthermore, step 3 includes the following steps:

[0019] Step 3.1, mutate each pixel in patch B in turn, and periodically tile the patch B after each mutation to obtain a mutated patch with A second binary update pattern and a third binary update pattern with a phase difference of 1:1;

[0020] Step 3.2: Gaussian filtering is performed on the second binary update pattern and the third binary update pattern after the current pixel point mutation, respectively, to obtain the second binary update pattern after Gaussian filtering. And the third binary update pattern after Gaussian filtering ; The white light pattern generated by the computer is recorded as , and thus use formula (2) to obtain a set of complete patterns after the current pixel point mutation:

[0021] (2)

[0022] In formula (2): express exist Where Gray value; express In the middle Gray value of the position; express In the middle Gray value of the position; express In the middle Gray value of the position;

[0023] Step 3.3: Calculate the global intensity root mean square error according to formula (3): :

[0024] (3)

[0025] In formula (3), N and M represent Length and width; is with The corresponding standard sinusoidal fringe pattern;

[0026] Step 3.4: Calculate for evaluation and its standard sinusoidal fringe pattern The local strength optimization index of the local structural similarity between ;

[0027] Step 3.5: Calculate using formula (11) Phase , and then use formula (11) to obtain The phase root mean square error :

[0028] (11)

[0029] In formula (11), express The phase of

[0030] (12)

[0031] In formula (12): Standard sinusoidal fringe pattern The phase value of

[0032] Step 3.6: Calculate according to formula (13) The DC component , and then use formula (13) to obtain The DC component RMS error :

[0033] (13)

[0034] In formula (13): express complementary patterns; express The DC component of

[0035] (14)

[0036] Step 3.7: Construct the comprehensive optimization objective function according to formula (15): :

[0037] (15)

[0038] In formula (15), , , , and There are 5 weight factors, and the value range of each weight factor is [0,1];

[0039] Step 3.8, calculate the objective function of a set of complete patterns after the mutation of the current pixel point, and compare it with the objective function of a set of complete patterns after the mutation of the previous pixel point. If the objective function decreases, keep the current pixel point after the mutation; otherwise, keep the current pixel point before the mutation; thus completing one round of mutation;

[0040] Step 3.9: Perform several rounds of mutation according to the process of steps 3.1 to 3.8 until the objective function no longer changes, so that the final mutated patch B is used as patch C.

[0041] Further, step 3.4 includes the following steps:

[0042] Step 3.4.1. Calculate using formula (4) and Brightness function between :

[0043] (4)

[0044] In formula (4), express The average intensity of is obtained by formula (5): express The average intensity of Represents the first parameter;

[0045] (5)

[0046] In formula (5), express No. The gray value of each pixel; express The total number of pixels;

[0047] Step 3.4.2: Calculate using formula (6) and The contrast function between :

[0048] (6)

[0049] In formula (6), Represents the second parameter, express The strength standard deviation is obtained by formula (7); Indicates The standard deviation of the intensity;

[0050] (7)

[0051] Step 3.4.3: Calculate using formula (8) and The structure function between :

[0052] (8)

[0053] In formula (8): Represents the third parameter, express and The intensity covariance of is obtained by formula (9):

[0054] (9)

[0055] In formula (9): express No. The gray value of each pixel;

[0056] Step 3.4.4: Calculate using formula (10) and its standard sinusoidal fringe pattern Local strength optimization index :

[0057] (10)

[0058] In formula (10): express The weighted value of express The weighted value of express The weighted value of .

[0059] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the generation method, and the processor is configured to execute the program stored in the memory.

[0060] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the generation method when the computer program is executed by a processor.

[0061] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0062] 1. The present invention modifies the original 2+1 phase shift algorithm to make it more conducive to optimizing the binary fringe pattern and improve the optimization efficiency of the fringe pattern;

[0063] 2. The present invention designs a DC optimization method, which can effectively reduce the error caused by the DC component, thereby improving the measurement accuracy;

[0064] 3. The present invention designs a comprehensive optimization method that combines intensity, phase and DC. While reducing the DC error, it ensures that the fringe pattern can also maintain a good state in structure and phase, thereby effectively improving the performance of the measurement system. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 is a flow chart of the present invention;

[0066] Figure 2 A detailed view of the high-quality stripe pattern of the present invention;

[0067] Figure 3This is a quality comparison diagram of the binary sinusoidal fringe pattern of the present invention. DETAILED DESCRIPTION

[0068] In this embodiment, a method for generating high-quality binary fringes based on a 2+1 phase shift algorithm is provided. Figure 1 As shown, the following steps are included:

[0069] Step 1: Use the Bayer dithering method to perform Bayer dithering on the standard sinusoidal fringe pattern. The Bayer dithering technique compares the original image with the two-dimensional threshold grid of the Bayer kernel, and then quantizes the original image according to the corresponding pixels in the Bayer kernel. An initial binary sinusoidal fringe pattern is obtained; a portion of the initial binary sinusoidal fringe pattern is intercepted as patch A, and the column period of patch A is the number of periods of the sinusoidal fringe pattern, and the row period is 2.

[0070] Step 2, performing pre-strength optimization on the patch A to obtain patch B;

[0071] Step 2.1, mutate each pixel in patch A in turn (from 0 to 1, or 1 to 0), and periodically tile the patch A after each mutation to obtain the first binary update pattern after a mutation;

[0072] Step 2.2: Perform Gaussian filtering on the first binary update pattern after the current pixel point mutation (filter size is 5×5, standard deviation is 5 / 3 pixel), and obtain the filtered pattern shown in formula (1): :

[0073] (1)

[0074] In formula (1): Represents the filtered pattern In the middle Gray value of the position; Representation pattern frequency; express exist The DC component at express exist The amplitude at .

[0075] Step 2.3, calculation and The intensity root mean square error between the corresponding standard sinusoidal fringe patterns is compared with the intensity root mean square error between the pattern after the previous pixel point mutation and filtering and its corresponding standard sinusoidal fringe pattern. If the error is reduced, the current pixel point after the mutation is retained; otherwise, the current pixel point before the mutation is retained; thus completing a round of mutation.

[0076] Step 2.4: Perform several rounds of mutation according to the process of steps 2.1 to 2.3 until the root mean square error of the intensity no longer changes, so that the final mutated patch A is used as patch B.

[0077] Step 3: Comprehensively optimize patch B to obtain patch C;

[0078] Step 3.1, mutate each pixel in patch B in turn (from 0 to 1, or 1 to 0), and periodically tile the patch B after each mutation to obtain a mutated patch with A second binary update pattern and a third binary update pattern with a phase difference of 1:1;

[0079] Step 3.2: Gaussian filtering is performed on the second binary update pattern and the third binary update pattern after the current pixel point mutation (the filter size is 5×5, and the standard deviation is 5 / 3 pixels), and the second binary update pattern after Gaussian filtering is obtained. And the third binary update pattern after Gaussian filtering ; The white light pattern generated by the computer is recorded as , and thus use formula (2) to obtain a set of complete patterns after the current pixel point mutation:

[0080] (2)

[0081] In formula (2): express exist Where Gray value; express In the middle Gray value of the position; express In the middle Gray value of the position; express In the middle The gray value of the position; this group of expressions has been slightly modified based on the original 2+1 phase shift algorithm, so only the optimization and , reducing the optimization time and the complexity of the optimization operation.

[0082] Step 3.3: Calculate the global intensity root mean square error according to formula (3): :

[0083] (3)

[0084] In formula (3), N and M represent Length and width; is with The corresponding standard sinusoidal fringe pattern;

[0085] Step 3.4: Calculate for evaluation and its standard sinusoidal fringe pattern The local intensity optimization index based on the local structural similarity between the two images includes: brightness function, contrast function and structure function; in the intensity domain, the index can evaluate the local structural similarity between the defocused binary sinusoidal fringe pattern and its standard sinusoidal fringe pattern, so as to optimize the binary sinusoidal fringe pattern more comprehensively;

[0086] Step 3.4.1. Calculate using formula (4) and Brightness function between :

[0087] (4)

[0088] In formula (4), express The average intensity of is obtained by formula (5): express The average intensity of Indicates the first parameter, which is 1 here;

[0089] (5)

[0090] In formula (5), express No. The gray value of each pixel; express The total number of pixels.

[0091] Step 3.4.2: Calculate using formula (6) and The contrast function between :

[0092] (6)

[0093] In formula (6), Represents the second parameter, which is 1 here; express The strength standard deviation is obtained by formula (7); Indicates The standard deviation of the intensity;

[0094] (7)

[0095] Step 3.4.3: Calculate using formula (8) and The structure function between :

[0096] (8)

[0097] In formula (8): Indicates the third parameter, here it is 1, express and The intensity covariance of is obtained by formula (9):

[0098] (9)

[0099] In formula (9): express No. The gray value of a pixel.

[0100] Step 3.4.4: Calculate using formula (10) and its standard sinusoidal fringe pattern Local strength optimization index :

[0101] (10)

[0102] In formula (10): express The weighted value of is 1 here; express The weighted value of is 1 here; express The weighted value of is 1 here.

[0103] Step 3.5: Calculate using formula (11) Phase , thus obtaining The phase root mean square error :

[0104] (11)

[0105] In formula (11): express The phase of

[0106] Compared with the phase extraction formula of the original 2+1 phase shift algorithm, the formula here has been slightly changed to make the optimization process simpler;

[0107] (12)

[0108] In formula (12): Standard sinusoidal fringe pattern The phase value of .

[0109] Step 3.6: Calculate according to formula (13) The DC component , and then use formula (14) to obtain The DC component RMS error :

[0110] (13)

[0111] In formula (13): express complementary patterns; express The DC component of

[0112] (14)

[0113] Step 3.7: Construct the comprehensive optimization objective function according to formula (15): :

[0114] (15)

[0115] In formula (15), , , , and There are 5 weight factors, and the value range of each weight factor is [0,1];

[0116] Step 3.8, calculate the objective function of a set of complete patterns after the current pixel point mutates, and compare it with the objective function of a set of complete patterns after the previous pixel point mutates. If the objective function decreases, keep the current pixel point after the mutation; otherwise, keep the current pixel point before the mutation; thus completing one round of mutation.

[0117] Step 3.9, perform several rounds of mutation according to the process of step 3.1 to step 3.8 until the objective function no longer changes, so that the patch B after the final mutation is used as patch C; the optimization purpose is to make the binary sinusoidal fringe pattern after defocus more sinusoidal; this objective function can solve the problem to a large extent and improve the quality of the binary sinusoidal fringe pattern;

[0118] Step 4: Increase the row period of patch A by one pixel to change the size of patch A, and determine whether the row period number of patch A exceeds the maximum value Max. If so, it means that Max patches C of different sizes are obtained; otherwise, return to step 2 and execute sequentially.

[0119] Step 5: Calculate the phase values ​​of the binary fringe pattern composed of Max patches C at different defocus levels, and select the patch with the smallest root mean square error as the optimal patch, so as to tile the optimal patch into a complete fringe pattern, that is, a high-quality binary fringe pattern, such as Figure 2 As shown;

[0120] Step 6: In this embodiment, sinusoidal stripe patterns with periods T of 16, 48, 64, and 100 pixels are used for simulation experiments. Figure 3 As shown; different sizes of filters are applied to achieve different degrees of defocus, the filter size G is 5~15, and the standard deviation for ; Among them, G=5 represents the minimum defocusing situation, and G=15 represents the maximum defocusing situation; and, two other classical optimization algorithms (intensity optimization and phase optimization) are used for comparison, which can be seen from Figure 3 It can be seen from the above that the method of the present invention has certain advantages.

[0121] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.

[0122] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.

Claims

1. A method for generating high-quality binary fringes based on a 2+1 phase shift algorithm, characterized in that: The steps include: Step 1, using the Bayer dithering method to perform Bayer dithering on the standard sinusoidal fringe pattern to obtain an initial binary sinusoidal fringe pattern; according to the periodicity of the sinusoidal fringe pattern, a part of the initial binary sinusoidal fringe pattern is intercepted as patch A, and the column period of the patch A is the period number of the sinusoidal fringe pattern, and the row period is 2; Step 2, performing pre-strength optimization on the patch A to obtain patch B; Step 3: Comprehensively optimize patch B to obtain patch C; Step 4: Increase the row period of patch A by one pixel to change the size of patch A, and determine whether the row period number of patch A exceeds the maximum value Max. If so, it means that Max patches C of different sizes are obtained; otherwise, return to step 2 and execute sequentially; Step 5: Calculate the phase values ​​of the binary fringe pattern composed of Max patches C at different defocus levels, and select the patch with the smallest root mean square error as the optimal patch, so as to tile the optimal patch into a complete fringe pattern, that is, a high-quality binary fringe pattern.

2. The method for generating high-quality binary fringes based on a 2+1 phase shift algorithm according to claim 1, characterized in that: Step 2 includes the following steps: Step 2.1, mutate each pixel in patch A in turn, and periodically tile the patch A after each mutation to obtain the first binary update pattern after the mutation; Step 2.2: Gaussian filter the first binary update pattern after the current pixel point mutation to obtain the filtered pattern shown in formula (1): : (1) In formula (1): Represents the filtered pattern In the middle Gray value of the position; Representation pattern frequency; express exist The DC component at express exist The amplitude at Step 2.3, calculation and The intensity root mean square error between the corresponding standard sinusoidal fringe patterns is compared with the intensity root mean square error between the pattern after the previous pixel point mutation and filtering and its corresponding standard sinusoidal fringe pattern. If the error is reduced, the current pixel point after the mutation is retained; otherwise, the current pixel point before the mutation is retained; thus completing a round of mutation; Step 2.4: Perform several rounds of mutation according to the process of steps 2.1 to 2.3 until the root mean square error of the intensity no longer changes, so that the final mutated patch A is used as patch B.

3. The method for generating high-quality binary fringes based on a 2+1 phase shift algorithm according to claim 2, characterized in that: Step 3 includes the following steps: Step 3.1, mutate each pixel in patch B in turn, and periodically tile the patch B after each mutation to obtain a mutated patch with A second binary update pattern and a third binary update pattern with a phase difference of 1:1; Step 3.2: Gaussian filtering is performed on the second binary update pattern and the third binary update pattern after the current pixel point mutation, respectively, to obtain the second binary update pattern after Gaussian filtering. And the third binary update pattern after Gaussian filtering ; The white light pattern generated by the computer is recorded as , and thus use formula (2) to obtain a set of complete patterns after the current pixel point mutation: (2) In formula (2): express exist Where Gray value; express In the middle Gray value of the position; express In the middle Gray value of the position; express In the middle Gray value of the position; Step 3.3: Calculate the global intensity root mean square error according to formula (3): : (3) In formula (3), N and M represent Length and width; is with The corresponding standard sinusoidal fringe pattern; Step 3.4: Calculate for evaluation and its standard sinusoidal fringe pattern The local strength optimization index of the local structural similarity between ; Step 3.5: Calculate using formula (11) Phase , and then use formula (11) to obtain The phase root mean square error : (11) In formula (11), express The phase of (12) In formula (12): Standard sinusoidal fringe pattern The phase value of Step 3.6: Calculate according to formula (13) The DC component , and then use formula (13) to obtain The DC component RMS error : (13) In formula (13): express complementary patterns; express The DC component of (14) Step 3.7: Construct the comprehensive optimization objective function according to formula (15): : (15) In formula (15), , , , and There are 5 weight factors, and the value range of each weight factor is [0,1]; Step 3.8, calculate the objective function of a set of complete patterns after the mutation of the current pixel point, and compare it with the objective function of a set of complete patterns after the mutation of the previous pixel point. If the objective function decreases, keep the current pixel point after the mutation; otherwise, keep the current pixel point before the mutation; thus completing one round of mutation; Step 3.9: Perform several rounds of mutation according to the process of steps 3.1 to 3.8 until the objective function no longer changes, so that the final mutated patch B is used as patch C.

4. The method for generating high-quality binary fringes based on a 2+1 phase shift algorithm according to claim 3, characterized in that: Step 3.4 includes the following steps: Step 3.4.

1. Calculate using formula (4) and Brightness function between : (4) In formula (4), express The average intensity of is obtained by formula (5): express The average intensity of Represents the first parameter; (5) In formula (5), express No. The gray value of each pixel; express The total number of pixels; Step 3.4.2: Calculate using formula (6) and The contrast function between : (6) In formula (6), Represents the second parameter, express The strength standard deviation is obtained by formula (7); Indicates The standard deviation of the intensity; (7) Step 3.4.3: Calculate using formula (8) and The structure function between : (8) In formula (8): Represents the third parameter, express and The intensity covariance of is obtained by formula (9): (9) In formula (9): express No. The gray value of each pixel; Step 3.4.4: Calculate using formula (10) and its standard sinusoidal fringe pattern Local strength optimization index : (10) In formula (10): express The weighted value of express The weighted value of express The weighted value of .

5. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports a processor to execute the generation method described in any one of claims 1 to 4, and the processor is configured to execute the program stored in the memory.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the generation method according to any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • High-quality binary stripe generation method based on multi-objective optimization jitter algorithm

    CN111141232A

  • Three-dimensional fingerprint method based on unsupervised super-resolution

    CN116721212A

  • Three-dimensional measurement method combining binary coding with error diffusion algorithm

    CN116839509A

  • Adversarial patch generation method and device

    CN118537857A

  • Semiconductor apparatus

    KR1020080066615A