Method for computing absolute phase using generated complement image

By generating a two's complement image to assist in calculating the absolute phase, the 2π phase jump problem in the global phase calculation of the prior art is solved, thus improving the imaging accuracy and quality.

CN116188288BActive Publication Date: 2025-12-23BIG FRAME TECH (SUZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211555890.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-12-23
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

Existing phase measurement profilometry suffers from 2π phase jumps when calculating global phase due to image resolution and Gray code edge extraction errors, which affects imaging accuracy and quality.

Method used

A method for calculating the absolute phase using generated two's complement images is adopted. By generating sinusoidal encoded images and auxiliary Gray code images, combined with XOR operations and two's complement series calculations, phase jumps are avoided, and the global phase is calculated using a formula.

Benefits of technology

It solves the 2π phase jump problem in global phase calculation of two's complement images without adding new images, thus ensuring imaging accuracy and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188288B_ABST
    Figure CN116188288B_ABST
Patent Text Reader

Abstract

This invention discloses a method for calculating absolute phase using a generated two's complement image, comprising the following steps: generating a sinusoidal encoded image, wherein the number of sinusoidal fringes in the image is 2. n Projection is achieved using the N-step phase-shifting method, generating a total of n+1 Gray code images. The wrapping phase is calculated, and the Gray code images are decoded and normalized to obtain the normalized binarized image GB. 1、 GB2…GB n+1 In this process, the GB1 image remains unchanged, while the remaining images are XORed with the previous XOR image to segment the spatial regions of the Gray code, resulting in XOR images XG1, XG2, XG3…XG n+1 Using formula k x =XG1*2 n‑1 +XG2*2 n‑2 +…+XG n‑1 *2 1 +XG n *2 0 Calculate the series k corresponding to the phase of the package. x Using formula k y =XG1*2 n‑1 +XG2*2 n‑2 +…+XG n‑1 *2 1 +XG n *2 0 +XG n+1 Calculate the two's complement series k y The global phase is calculated by selecting 0~π / 2, π / 2~2π / 3, or 2π / 3~2π as the calculation interval within a single wrapper period. This invention can solve the 2π phase jump that exists during the phase solution process, ensuring the final imaging accuracy and imaging quality.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of machine vision, in particular relates to a method for calculating absolute phase with the aid of generated complementary image. BACKGROUND

[0002] With the improvement of industrial automation and the rapid development of machine vision, optical three-dimensional measurement is widely used in the field of industrial automation, and structured light three-dimensional imaging is the current mainstream three-dimensional imaging scheme, which can be divided into line-based and surface-based according to its appearance. In the method of surface structured light imaging, phase measurement profilometry is the most widely used one.

[0003] The existing phase measurement profilometry mostly uses the phase shift method to achieve it, and the main steps of the implementation are divided into two steps: the first step is to project the phase shift picture, and the absolute phase information of the measured object in the scene is obtained by calculation; the second step is to use the calibrated camera parameters to solve the phase map in the first step, and the phase information is converted into depth information.

[0004] In the calculation of absolute phase, in order to improve the resolution of the device or the camera in the depth direction, dozens or hundreds of sinusoidal projection stripes are usually used. In order to ensure that the wrapped phase of dozens or hundreds of stripes is unwrapped to obtain global phase information, some auxiliary methods are needed to complete the global phase calculation, and Gray code combined with phase shift is one of them.

[0005] In the method of using phase shift Gray code, the wrapped phase is first calculated, and then the number of levels N of the wrapped phase is determined by Gray code assistance, and finally the global phase information is calculated by using φ=2*π*N+φ.

[0006] However, in the process of calculating the global phase, although the wrapped phase of each level and the minimum area of the Gray code are one-to-one corresponding in the projection image, in the actual shooting process, because of the resolution of the image or the extraction error of the edge of the Gray code, the global phase calculated at the junction of adjacent levels often has a phase error of 2π. This error has a great influence on the final imaging accuracy and imaging quality. SUMMARY

[0007] The technical problem solved by the present application is to provide a method for calculating absolute phase with the aid of generated complementary image, which only needs Gray code picture and phase shift picture, and does not need to design new complementary picture, so as to solve the 2π phase jump in the process of phase calculation and ensure the final imaging accuracy and imaging quality.

[0008] To solve the above technical problems, one technical scheme adopted by the present application is: a method for calculating absolute phase with the aid of generated complementary image, comprising the following steps:

[0009] S1: generate a sinusoidal coded picture, wherein the number of sinusoidal fringe on the picture is 2 n , and the N-step phase shifting method is used to realize projection, and the sinusoidal coded pictures after projection are I0, I1, I2…I N-1 ;

[0010] S2: generate an auxiliary Gray code picture, according to the number of sinusoidal fringes 2 n in step S1, the total number of generated Gray code pictures is n+1, that is, the Gray code pictures are G1, G2, G3…G n+1 ;

[0011] S3: the picture after the sinusoidal coded picture in step S1 is captured by the camera, the phase information is calculated through the following formula, and the wrapped phase is calculated;

[0012]

[0013] S4: decode the Gray code picture in step S2, normalize the Gray code picture, and obtain the normalized binary picture GB, GB includes GB 1、 GB2…GB n+1 , wherein the GB1 picture is unchanged, and the rest of the pictures are XORed with the previous XOR picture to segment the spatial area of the Gray code, and obtain the XOR picture XG, XG includes XG1, XG2, XG3…XG n+1 , using the formula k x =XG1*2 n-1 +XG2*2 n-2 +…+XG n-1 *2 1 +XG n *2 0 , the order k x corresponding to the wrapped phase is calculated;

[0014] S5: production of complementary order, the order kx solved in step S4 is the order corresponding to the wrapped phase, but the XOR picture XG n+1 has not participated in the calculation, using the formula k y =XG1*2 n-1 +XG2*2 n-2 +…+XG n-1 *2 1 +XG n *2 0 +XG n+1 , the complementary order k y is calculated;

[0015] S6: using the order corresponding to the wrapping phase calculated in step S4 and the complementary order calculated in step S5, the wrapping phase calculated in step S3, selecting 0~pi / 2, pi / 2~2pi / 3 or 2pi / 3~2pi as the calculation interval in a single wrapping period to calculate the global phase, using the following formula:

[0016]

[0017] Further, k in the formula in step S2 is the specific phase shift number, and I k It refers to bringing each pixel point on the projected sinusoidal coded picture into the formula.

[0018] Further, the specific steps of the XOR picture operation in step S4 are that the first GB1 is XG1, the second XG2 is GB2 XOR XG1, the third XG3 is GB3 XOR XG2, and the nth+1 XG n+1 is GB n+1 XOR XG n .

[0019] Further, in step S1, N in the N-step phase shift method is greater than or equal to 3.

[0020] Further, in steps S4 and S5, GB and XG brought into the formula refer to bringing each pixel point of the picture into the formula.

[0021] Further, in step S1, the phase shift method is that the camera shoots a set of sinusoidal fringe pictures with the same number of fringes but different initial phases projected by the projection device.

[0022] Further, in step S1, the number of sinusoidal fringes 2 n n is related to the picture resolution to be generated and the resolution of the projector.

[0023] The present application has at least the following advantages:

[0024] In the calculation of the unwrapping phase, the order is used to participate in the calculation at the junction of the wrapping phase, the order of the Gray code is used to calculate at the middle position of the wrapping phase, and finally the global phase without phase jump can be completed by combining the two, which can solve the 2pi phase jump in the phase solving process.

[0025] The pictures required by the present application are only Gray code pictures and phase shift pictures themselves, without the need to design new complementary code pictures. BRIEF DESCRIPTION OF DRAWINGS

[0026] Figure 1 is a flowchart of the present application. DETAILED DESCRIPTION

[0027] The advantages and features of the present application will be more apparent from the following detailed description of preferred embodiments of the present application, taken in conjunction with the accompanying drawings, in which:

[0028] Embodiment one: a method for calculating absolute phase with the help of generating complementary code images, as shown in the figure, comprising the following steps: Figure 1

[0029] S1: generating a sinusoidal coded picture, wherein the number of sinusoidal fringe strips on the picture is 2 n , and N-step phase shifting method is used to realize projection, and the projected sinusoidal coded picture has: I0, I1, I2…I N-1 ;

[0030] S2: generating auxiliary Gray code pictures, according to the number of sinusoidal fringe strips 2 n in step S1, the total number of generated Gray code pictures is n+1, that is, the Gray code pictures have: G1, G2, G3…G n+1 ;

[0031] S3: the picture captured by the camera after the projected sinusoidal coded picture in step S1 is calculated by the following formula to calculate the phase information, and the wrapped phase is obtained by calculation;

[0032]

[0033] S4: decoding the Gray code pictures in step S2, normalizing the Gray code pictures, and obtaining the normalized binary pictures GB, GB including GB 1、 GB2…GB n+1 , wherein GB1 picture is unchanged, and the rest of the pictures are XORed with the previous XORed picture to segment the spatial region of the Gray code, and obtain the XORed picture XG, XG including XG1, XG2, XG3…XG n+1 , using the formula k x =XG1*2 n-1 +XG2*2 n-2 +…+XG n-1 *2 1 +XG n *2 0 , the order kx corresponding to the wrapped phase is calculated; x ;

[0034] S5: producing complementary code orders, the order kx solved in step S4 is the order corresponding to the wrapped phase, but the XORed picture XG n+1 has not participated in the calculation, using the formula k y =XG1*2 n-1 +XG2*2 n-2 +…+XG​n-1 *2 1 +XG n *2 0 +XG n+1 , the complement order k is calculated y ;

[0035] S6: using the order corresponding to the wrapping phase calculated in step S4 and the complement order calculated in step S5, the wrapping phase calculated in step S3, selecting 0~π / 2, π / 2~2π / 3 or 2π / 3~2π as the calculation interval in a single wrapping period to calculate the global phase, using the following formula:

[0036]

[0037] In the formula of step S2, k is the specific phase shift number, for example, three-step phase shift method is used for three-step phase shift, I0, I1, I2 are respectively, and the phase of the shifted picture is 0, 2π / 3, 4π / 3, then k=0, representing the picture with phase 0; k=1, representing the picture with phase 2π / 3; k=2, representing the picture with phase 4π / 3;

[0038] In the formula, I k refers to bringing each pixel point on the projected sinusoidal coded picture into the formula, for example, for a picture with a size of 640*480, 640*480 times of calculation are needed in actual calculation, and each pixel is calculated once to obtain a result picture with a size of 640*480.

[0039] In step S4, the specific steps of the exclusive or picture operation are as follows: the first GB1 is XG1, the second XG2 is GB2 exclusive or XG1, the third XG3 is GB3 exclusive or XG2, and the nth+1 XG n+1 is GB n+1 exclusive or XG n .

[0040] In step S1, N-step phase shift method is used, and N≥3.

[0041] In steps S4 and S5, GB and XG brought into the formula refer to bringing each pixel point of the picture into the formula.

[0042] In step S1, the phase shift method is that the camera shoots a set of sinusoidal fringe pictures with the same number of fringes but different initial phases.

[0043] In step S1, the number of sinusoidal fringes is 2 n , and n is related to the resolution of the generated picture and the resolution of the projector.

[0044] Embodiment two: in this example, the number of sinusoidal codes in the projected fringe pattern is 2 5 , a total of 32 fringe levels, using 4-step phase shifting, generating corresponding auxiliary gray code pictures, the number of gray code pictures is 6;

[0045] Step 1: project 4 phase shift pictures and 6 gray code pictures, and synchronously shoot 10 projected pictures;

[0046] Step 2: 4-step phase shift pictures are I0, I1, I2, I3 respectively, and the wrapped phase is calculated by using the following formula:

[0047]

[0048] Step 3: gray code decoding, normalizing the obtained gray code pictures, excluding the first gray code picture, the rest of the normalized gray code pictures are XORed with the previous XOR picture, and the XORed picture is brought into the formula k x =XG1*2 n-1 +XG2*2 n-2 +…+XG n-1 *2 1 +XG n *2 0 , calculate the corresponding wrapped phase level K x ;

[0049] Step 4: the XOR picture in step 3 is brought into the formula k y =XG1*2 n-1 +XG2*2 n-2 +…+XG n-1 *2 1 +XG n *2 0 +XG n+1 , calculate the complement level k y ;

[0050] Step 5: the results calculated in steps 2, 3 and 4 are brought into the following formula:

[0051]

[0052] The above only describes the embodiments of the present application, and does not limit the patent range of the present application, any equivalent structural transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection range of the present application.

Claims

1. A method of using a generated complement image to assist in computing absolute phase, the method comprising: The method comprises the following steps: ​ S1: generating a sinusoidal coded picture, wherein the number of sinusoidal fringe on the picture is 2 n , using N-step phase shifting method to realize projection, the sinusoidal coded picture after projection is: I0, I1, I2…I N-1 ; S2: generate an auxiliary gray code picture, according to the number of sinusoidal stripes 2 in step S1 n , the total number of generated gray code pictures is n+1, that is, the gray code pictures have: G1, G2, G3…G n+1 ; S3: the wrapped phase is calculated by the following formula by using the projected sinusoidal coded picture in step S1 and the captured picture after the camera captures the picture; ; S4: decoding the Gray code picture in step S2, normalizing the Gray code picture to obtain a normalized binary picture GB, GB includes GB 1、 GB2…GB n+1 , wherein GB1 picture is unchanged, and the rest of the pictures are XORed with the previous XOR picture to segment the spatial region of the Gray code to obtain an XOR picture XG, XG includes XG1, XG2, XG3…XG n+1 , using the formula k x =XG1*2 n-1 +XG2*2 n-2 +…+XG n-1 *2 1 +XG n *2 0 , to calculate the order k x corresponding to the package phase. S5: production of the complement series, the series k solved in step S4 x is the series corresponding to the phase of the package, but the XOR picture XG n+1 has not yet participated in the calculation, using the formula k y = XG1*2 n-1 + XG2*2 n-2 + … + XG n-1 *2 1 + XG n *2 0 + XG n+1 , the complement series k y is calculated; S6: the global phase is calculated by selecting 0~π / 2, π / 2~2π / 3 or 2π / 3~2π as the calculation interval in a single wrapped period by using the wrapped phase calculated in step S3, the order corresponding to the wrapped phase calculated in step S4 and the complementary order calculated in step S5, and the following formula is used: 。 2. The method of claim 1, wherein the method further comprises: k in the formula in step S3 is a specific phase shift number, and I k The formula is used to bring each pixel point on the projected sinusoidal coded picture into the formula.

3. The method of using a generated complementary image to assist in computing absolute phase according to claim 1, wherein: The specific steps of the exclusive or picture operation in step S4 are that the first picture GB1 is XG1, the second picture XG2 is GB2 exclusive or XG1, the third picture XG3 is GB3 exclusive or XG2, and the (n+1)th picture XGn+1 is GBn+1 exclusive or XGn n+1 GB n+1 exclusive or XG n .

4. The method of using a generated complementary image to assist in computing absolute phase according to claim 1, wherein: In step S1, N≥3 in the N-step phase-shifting method.

5. The method of using a generated complementary image to assist in computing absolute phase according to claim 1, wherein: In steps S4 and S5, GB and XG in the formula refer to that each pixel point of the picture is brought into the formula.

6. The method of using a generated complementary image to assist in computing absolute phase of claim 1, wherein: In step S1, the phase-shifting method is that the camera captures a group of sinusoidal fringe pictures with the same number of fringes but different initial phases projected by the projection device.

7. The method of using a generated complementary image to assist in computing absolute phase of claim 1, wherein: In step S1 the number of sinusoidal fringes 2 n n takes values related to the resolution of the picture to be generated and the resolution of the projector.

Citation Information

Patent Citations

  • Self-alignment XOR code method capable of resisting global illumination

    CN114399445A

  • Three-dimensional measurement device and three-dimensional measurement method

    JP2012042332A