A fast spatial phase unwrapping method

By employing a step-by-step sub-region unfolding method and utilizing connected component analysis and adjacency relationships to determine the stripe level encoding, the problem of long processing time in existing spatial phase unfolding methods is solved, enabling rapid three-dimensional measurement that is suitable for the inspection needs of industrial production.

CN116772745BActive Publication Date: 2026-08-25EASY THINKING HANGZHOU TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310632276.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-08-25
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

Existing spatial phase unfolding methods have long processing times in 3D measurement, which makes it difficult to meet the detection speed requirements of industrial production, especially for high-resolution images, which require processing times on the order of seconds.

Method used

By employing a stepwise subregion expansion method, the fringe connected region is treated as a whole. The fringe level encoding is determined through connected region analysis and adjacency relationship. Continuous phases are quickly calculated using mathematical calculations, reducing the number of comparisons and sorting operations.

Benefits of technology

It significantly shortens processing time and improves computing speed, increasing processing speed by nearly 30 times, and is suitable for the effectiveness of detection results in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116772745B_ABST
    Figure CN116772745B_ABST
Patent Text Reader

Abstract

The application discloses a fast spatial phase unwrapping method, which comprises the following steps: calculating the truncated phase of each pixel point according to a plurality of acquired phase shift images; generating image A and image B according to the truncated phase value; respectively performing connected domain analysis on the image A and the image B to obtain a plurality of stripe connected domains; numbering the stripe connected domains in the image A and the image B respectively, and obtaining the stripe order code according to the numbering sequence; or, generating an auxiliary image by phase shift, and then obtaining the adjacency relationship between the stripe connected domains in the image A and the image B according to the phase overlapping relationship between the auxiliary image and the image A and the image B, obtaining the stripe order according to the adjacency relationship, and finally calculating the continuous phase by using the stripe order code and the truncated phase to complete the spatial phase unwrapping; the method can shorten the processing time of the existing spatial phase unwrapping method to one-tenth of the original time, and is beneficial to realizing the fast structured light three-dimensional measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of phase deflection analysis, and more specifically to a fast spatial phase unfolding method. Background Technology

[0002] Structured light 3D measurement technology has wide applications in industrial manufacturing, medicine, cultural relic preservation, reverse engineering, and other fields. Phase unwrapping is a key step in structured light 3D measurement based on sinusoidal fringes. Among them, spatial phase unwrapping methods (such as quality-oriented, flood algorithm, and branch method) are an important class of phase unwrapping techniques. Spatial phase unwrapping methods only require projecting and capturing multi-step phase-shifted fringes of one frequency onto the object under test. Common methods only require projecting and capturing four fringes, resulting in short image projection and capture times. However, these methods have long processing times for extracting and unwrapping the phase from the fringe image. Existing spatial phase unwrapping methods unfold pixel by pixel. For each pixel unfolded, the phase value of that pixel needs to be compared with several neighboring pixels, sometimes involving complex sorting processes. For example, a 3-megapixel resolution image may require tens of millions of comparisons and millions of sorting operations, which is difficult to achieve in parallel computing. Therefore, the algorithm execution speed is slow, typically on the order of seconds. This is not conducive to achieving rapid 3D measurement and cannot meet the detection speed requirements of industrial production applications. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides a fast spatial phase unfolding method, which can reduce the processing time of existing spatial phase unfolding methods to a fraction of the original time, thus facilitating rapid structured light three-dimensional measurement.

[0004] Therefore, the technical solution of the present invention is as follows:

[0005] A fast spatial phase unfolding method includes the following steps:

[0006] S1. Calculate the truncated phase of each pixel based on the acquired multiple phase-shifted images;

[0007] S2. Set the gray value of the truncated pixels with a phase value ≥ 0 to c, and set the gray value of the other pixels to d to generate an image, denoted as image A;

[0008] Set the gray value of the truncated pixels with a phase value < 0 to c, and set the gray value of the other pixels to d to generate another image, denoted as image B;

[0009] S3. Perform connected component analysis on images A and B respectively to obtain multiple stripe connected components; then number the stripe connected components in images A and B in order from the top left corner to the bottom right corner.

[0010] S4. Record the numbering order of the fringe connected regions in image A as the positive phase fringe order code, and record the numbering order of the fringe connected regions in image B as the negative phase fringe order code.

[0011] Then, the continuous phase is calculated using the positive phase fringe level encoding, the negative phase fringe level encoding, and the truncated phase in step S1, thus completing the spatial phase unfolding.

[0012] This invention also discloses a fast spatial phase unfolding method, comprising the following steps:

[0013] 1) Calculate the truncated phase of each pixel based on the acquired multiple phase-shifted images;

[0014] 2) Set the gray value of the pixels with a phase value ≥ 0 to c, and set the gray value of the other pixels to d to generate an image, denoted as image A;

[0015] Set the gray value of the truncated pixels with a phase value < 0 to c, and set the gray value of the other pixels to d to generate another image, denoted as image B;

[0016] 3) Shift the phase shift step size of each phase-shifted image in step 1) by a constant Δδ, and use the shifted phase shift step size to calculate the truncated phase of each pixel.

[0017] Using the same processing method as in step 2), new image A and new image B are obtained based on the newly obtained truncated phase of each pixel, and they are denoted as image A1 and image B1 respectively.

[0018] Image A1 and image B1 are collectively referred to as auxiliary images;

[0019] 4) Perform connected component analysis on image A, image B, and each auxiliary image to obtain multiple stripe connected components;

[0020] Based on the phase overlap relationship between the fringe connected regions in image A and the auxiliary image, and the phase overlap relationship between the fringe connected regions in image B and the auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively.

[0021] Based on the adjacency relationship, each fringe connected region is sequentially numbered in image A and image B respectively;

[0022] 5) The numbering order of the fringe connected regions in image A is recorded as the positive phase fringe order code, and the numbering order of the fringe connected regions in image B is recorded as the negative phase fringe order code.

[0023] The continuous phase is calculated using positive phase fringe level coding, negative phase fringe level coding, and the truncated phase in step S1, thus completing the spatial phase unfolding.

[0024] Furthermore, in step 3), the phase shift step size δ of the i-th phase-shifted image in step 1) is... i The phase shift constant Δδ is used to calculate the truncated phase Phw at pixel (x,y). 移动(x,y) :

[0025]

[0026] I i (x,y)=A(x,y)+B(x,y)cos(Phu(x,y)+δ i Let A(x,y) represent the fringe expression of the i-th phase-shifted image; where A(x,y) is the background light intensity at pixel (x,y), B(x,y) is the modulation intensity at pixel (x,y), and Phu(x,y) is the continuous phase to be solved at pixel (x,y).

[0027] Preferred,

[0028] For ease of differentiation, preferably, in step 4), each stripe connected region is numbered in image A, image B and each auxiliary image respectively.

[0029] Further, in step 4), based on the phase overlap relationship between the fringe connected regions in image A and each auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively. This can be done in two ways, and either method one or method two can be used in the specific implementation:

[0030] Method 1:

[0031] ① Select any one of the stripe connected regions in image A and label it as stripe connected region I;

[0032] ② Set the gray value of the fringe connected region I to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A;

[0033] ③ Multiply the image by either image B1 or image A1; then proceed to step Q.

[0034] Step Q: Determine if the dot product is zero:

[0035] If the value is zero, proceed directly to step 9;

[0036] If it is not zero, then mark the fringe connected region corresponding to the region where the dot product result is located as fringe connected region II; set the gray value of fringe connected region II to 1, and set the gray value of other regions to 0, to generate an image of the same size as image A;

[0037] ④ Multiply the generated image by the image B; process the dot product result in the same way as in step Q, and label the newly labeled fringe connected region II as fringe connected region II-B;

[0038] ⑤ Multiply the images B1 and A1 by the image generated in step ④; process the multiplication result in the same way as in step Q;

[0039] ⑥ Multiply the image generated in step ⑤ by the image A; process the dot product result in the same way as in step Q; and in image A, record the newly labeled fringe connected region II and fringe connected region I as adjacent;

[0040] ⑦ Multiply the images B1 and A1 by the image generated in step ⑥; process the multiplication result in the same way as in step Q;

[0041] ⑧ Multiply the image generated in step ⑦ by the image B, and process the dot product result in the same way as in step Q; and in image B, record the newly labeled fringe connected region II and the fringe connected region II-B labeled in step ④ as adjacent;

[0042] ⑨ Remove the fringe connected regions in image A that have already been labeled as fringe connected regions I. Select any one of the remaining fringe connected regions and label it as a new fringe connected region I. Repeat steps ② to ⑧ using the new fringe connected region I until all fringe connected regions in image A have been labeled as fringe connected regions I. The process ends here. The adjacency relationship between each fringe connected region in images A and B is obtained.

[0043] Method 2:

[0044] ① Select any one of the stripe connected regions in image B and label it as stripe connected region I;

[0045] ② Set the gray value of the fringe connected region I to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A;

[0046] ③ Multiply the image by either image B1 or image A1; then proceed to step Q.

[0047] Step Q: Determine if the dot product is zero:

[0048] If the value is zero, proceed directly to step 9;

[0049] If it is not zero, then mark the fringe connected region corresponding to the region where the dot product result is located as fringe connected region II; set the gray value of fringe connected region II to 1, and set the gray value of other regions to 0, to generate an image of the same size as image A;

[0050] ④ Multiply the generated image by image A; process the dot product result in the same way as in step Q, and label the newly labeled fringe connected region II as fringe connected region II-A;

[0051] ⑤ Multiply the images B1 and A1 by the image generated in step ④; process the multiplication result in the same way as in step Q;

[0052] ⑥ Multiply the image generated in step ⑤ by the image B; process the dot product result in the same way as in step Q; and in image B, record the newly labeled fringe connected region II and fringe connected region I as adjacent;

[0053] ⑦ Multiply the images B1 and A1 by the image generated in step ⑥; process the multiplication result in the same way as in step Q;

[0054] ⑧ Multiply the image generated in step ⑦ by the image A, and process the dot product result in the same way as in step Q; and in image A, record the newly labeled fringe connected region II and the fringe connected region II-A obtained in step ④ as adjacency;

[0055] ⑨ Remove the fringe connected regions in image B that have already been labeled as fringe connected regions I. Select any one of the remaining fringe connected regions and label it as a new fringe connected region I. Do not label the old fringe connected regions I. Repeat steps ② to ⑧ using the new fringe connected regions I until all fringe connected regions in image B have been labeled as fringe connected regions I. End the process. Obtain the adjacency relationship between each fringe connected region in images A and B.

[0056] Preferably, in image A, image B, and each auxiliary image, each stripe connected region is numbered in order from the top left corner to the bottom right corner;

[0057] In step ①, the fringe connected region with the smallest number is selected in image A / image B and marked as fringe connected region I; in step ⑨, the fringe connected region with the smallest number is selected from the remaining fringe connected regions and marked as the new fringe connected region I.

[0058] Correspondingly, in step ③, when Δδ>0, the image is multiplied by image A1, and when Δδ<0, the image is multiplied by image B1.

[0059] or:

[0060] In step ①, the stripe connected region with the largest number is selected from image A / image B and marked as stripe connected region I; in step ⑦, the stripe connected region with the largest number is selected from the remaining stripe connected regions and marked as the new stripe connected region I.

[0061] Correspondingly, in step ③, when Δδ>0, the image is multiplied by the image B1, and when Δδ<0, the image is multiplied by the image A1.

[0062] To suppress noise interference in the image, noise points are analyzed as separate connected components and included in the numbering during connected component analysis; preferably, when performing connected component analysis on image A, dilation is performed on image A first, and then connected component analysis is performed; in the obtained fringe connected components, the gray values ​​of pixels with truncated phases less than zero are set to zero.

[0063] To facilitate connected component analysis, preferably, the grayscale difference between c and d is greater than 100; preferably, c = 255 and d = 0, generating a binarized image.

[0064] The present invention has the following beneficial effects:

[0065] Compared to the pixel-by-pixel unfolding of existing methods, the unfolding approach of this invention is to unfold in sub-regions step by step, treating the stripe connected region as a whole, with each pixel in a single connected region having the same stripe level; a 3-megapixel resolution image typically has only 100 stripe level regions (stripe connected regions), thus greatly reducing the number of comparisons and sorting, and effectively improving the calculation speed.

[0066] Furthermore, this method also corrects the stripe level in cases where stripes are discontinuous or missing in complex scenes. By finding the adjacency relationship between stripes, the stripe level of discontinuous or missing stripes is corrected to the correct stripe level, ensuring the effectiveness of the detection results in complex scenes.

[0067] The table below compares the processing time of the method of this invention with that of the existing spatial phase unfolding method (Herraez's), with a fringe frequency of f = 0.006. The computer hardware configuration for executing the algorithm is: Intel Core i7-8750H CPU @ 2.20GHz, 16GB of memory. The comparison shows that the method of this invention is nearly 30 times faster, with a significant improvement in processing speed, when the image resolution is 500×500 and 1000×1000.

[0068] Attached Figure Description

[0069] Figure 1 a is a schematic diagram of the truncated phase in Example 1;

[0070] Figure 1 b is a schematic diagram of image A in Example 1;

[0071] Figure 1 c is a schematic diagram of image B in Example 1;

[0072] Figure 2 a is a schematic diagram of the truncated phase in Example 2;

[0073] Figure 2 b is a schematic diagram of image A in Example 2;

[0074] Figure 2 c is a schematic diagram of image B in Example 2;

[0075] Figure 3 a is a schematic diagram of the stripe connected region numbering in image A of Example 2;

[0076] Figure 3 b is a schematic diagram of the connected component numbering of stripes in image B in Example 2;

[0077] Figure 4 In Example 2, when A schematic diagram of the phase overlap relationship between connected regions of stripes in each image;

[0078] Figure 5 In Example 2, when A schematic diagram of the phase overlap relationship between the connected regions of each image stripe. Detailed Implementation

[0079] In the prior art, the formula for calculating the truncated phase phw(x,y) is as follows:

[0080]

[0081] The expression for the i-th phase-shifted image: I i (x,y)=A(x,y)+B(x,y)cos(Phu(x,y)+δ i )

[0082] Where A(x,y) is the background light intensity at pixel (x,y), B(x,y) is the modulation intensity at pixel (x,y), and δ i Let be the phase shift step size of the i-th phase-shifted image, and Phu(x,y) be the continuous phase to be solved at pixel (x,y).

[0083] Since the arctangent function is a periodic function, it will truncate the originally continuous Phu(x,y) into the range of the arctangent function, causing Phu(x,y) to be discontinuous. Therefore, phase expansion is required.

[0084] The relationship between continuous phase Phu(x,y) and truncated phase Phw(x,y) is as follows:

[0085] Phu(x,y)=Phw(x,y)+2πK (x,y)

[0086] Among them, K(x,y) Let K be the fringe order at pixel (x, y). It is clear that the key to phase unrolling is solving for the fringe order K. (x,y) .

[0087] After obtaining the fringe order, the continuous phase can be corrected and the absolute phase obtained using existing methods. This invention aims to propose a fast spatial phase unfolding method that can reduce the processing time of existing spatial phase unfolding methods to a fraction of the original time, enabling rapid identification of the fringe order.

[0088] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0089] Example 1

[0090] The method in this embodiment is suitable for situations where the test scenario is relatively simple and the acquired stripe image does not have any breaks or gaps, such as... Figure 1 As shown in a.

[0091] A fast spatial phase unfolding method includes the following steps:

[0092] S1. Calculate the truncated phase of each pixel based on the acquired multiple phase-shifted images;

[0093] S2. Set the grayscale value of pixels with a phase value ≥ 0 to c, and the grayscale value of other pixels to d, generating an image, denoted as image A; (e.g., ...) Figure 1 As shown in b;

[0094] Set the grayscale value of pixels with a phase value < 0 to 'c', and set the grayscale value of other pixels to 'd' to generate another image, denoted as image B; (e.g.) Figure 1 As shown in c;

[0095] S3. Perform connected component analysis on images A and B respectively to obtain multiple stripe connected components; then number the stripe connected components in images A and B in order from the top left corner to the bottom right corner.

[0096] S4. Record the numbering order of the fringe connected regions in image A as the positive phase fringe order code, and record the numbering order of the fringe connected regions in image B as the negative phase fringe order code.

[0097] Then, the continuous phase is calculated using the positive phase fringe level encoding, the negative phase fringe level encoding, and the truncated phase in step S1, thus completing the spatial phase unfolding.

[0098] The truncated phase map is an image that contains the truncated phase of each pixel.

[0099] As a preferred implementation, when performing connected component analysis on image A, dilation is first performed on image A, followed by connected component analysis. In the resulting fringe connected components, the gray values ​​of pixels with truncated phases less than zero are set to zero. This effectively suppresses noise interference in the image and prevents noise points from being analyzed as separate fringe connected components and included in the numbering during connected component analysis.

[0100] To facilitate connected component analysis, in practice, the grayscale difference between c and d is greater than 100; in this embodiment, c = 255 and d = 0, generating a binarized image.

[0101] Example 2

[0102] The method in this embodiment is more universal, applicable not only to simple test scenarios where the collected stripes are not discontinuous or missing, but also to complex scenarios where stripes are missing or discontinuous (e.g. Figure 2 a) In this case, if the connected regions of the stripes are numbered, there may be situations where regions belonging to the same stripe level have two or more different numbers in the connected region image, which will cause trouble for subsequent stripe level acquisition. To address this, in this embodiment, the adjacency relationship between each stripe connected region is obtained first, and then the stripe level is obtained using the adjacency relationship, effectively solving the above problem.

[0103] A fast spatial phase unfolding method includes the following steps:

[0104] 1) Calculate the truncated phase of each pixel based on the acquired multiple phase-shifted images;

[0105] 2) Set the grayscale value of pixels with a phase value ≥ 0 to c, and the grayscale value of other pixels to d, generating an image, denoted as image A; For example... Figure 2 As shown in b;

[0106] Set the grayscale value of pixels with a phase value < 0 to 'c', and set the grayscale value of other pixels to 'd' to generate another image, denoted as image B; (e.g.) Figure 2 As shown in c

[0107] 3) Shift the phase shift step size of each phase-shifted image in step 1) by a constant Δδ, and use the shifted phase shift step size and the fringe expression of each phase-shifted image to calculate the truncated phase of each pixel.

[0108] Using the same processing method as in step 2), new image A and new image B are obtained based on the newly obtained truncated phase of each pixel, and they are denoted as image A1 and image B1 respectively.

[0109] Image A1 and image B1 are collectively referred to as auxiliary images;

[0110] 4) Perform connected component analysis on image A, image B and each auxiliary image (image A1 and image B1) to obtain multiple stripe connected components;

[0111] Based on the phase overlap relationship between the fringe connected regions in image A and the auxiliary image, and the phase overlap relationship between the fringe connected regions in image B and the auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively.

[0112] Based on the adjacency relationship, each fringe connected region is sequentially numbered in image A and image B respectively;

[0113] 5) The numbering order of the fringe connected regions in image A is recorded as the positive phase fringe order code, and the numbering order of the fringe connected regions in image B is recorded as the negative phase fringe order code.

[0114] The continuous phase is calculated using positive phase fringe level coding, negative phase fringe level coding, and the truncated phase in step S1, thus completing the spatial phase unfolding.

[0115] It is worth noting that in step 3), there is no need to reproject the phase-shifted image. During the solution process, the phase-shifted image is the original image, and the fringe expression remains unchanged. Instead, the phase-shift step size δ is determined through mathematical calculation. i The constant Δδ is shifted; the entire process is fast and efficient; the specific calculations are as follows:

[0116] In step 3), the phase shift step size δ of the i-th phase-shifted image in step 1) is... i The phase shift constant Δδ is used to calculate the truncated phase Phw at pixel (x,y). 移动(x,y) :

[0117]

[0118] I i (x,y)=A(x,y)+B(x,y)cos(Phu(x,y)+δ i ) represents the fringe expression of the i-th phase-shifted image; at this point, the phase-shifted image is the original phase-shifted image, only the image shift step size δ has been changed. i Where A(x,y) is the background light intensity at pixel (x,y), B(x,y) is the modulation intensity at pixel (x,y), and Phu(x,y) is the continuous phase to be solved at pixel (x,y).

[0119] The constant Δδ is an angle value, which can be positive or negative. As a preferred implementation,

[0120] To facilitate differentiation, in step 4), each stripe connected region is numbered in both image A and each auxiliary image. For example... Figure 3 a is a schematic diagram showing the numbering of the connected components of the stripes in image A; Figure 3 b is a schematic diagram illustrating the numbering of the connected regions of the B-fringe in the image; the numbering serves the purpose of naming or identification. The numbers can be assigned in a predetermined order, such as from the top left corner to the bottom right corner; or they can be assigned in an unordered manner, as long as it is possible to distinguish the various connected regions of the fringe.

[0121] like Figure 4 For when A schematic diagram of the phase overlap relationship between connected regions of stripes in each image; Figure 5 For when This diagram illustrates the phase overlap between connected regions of the stripes in each image. For ease of illustration, only a portion of the connected regions are shown in the diagram.

[0122] As shown in the figure, the fringe connected regions in image A have phase overlap with the fringe connected regions in images A1 and B1, respectively; the fringe connected regions in image B also have phase overlap with the fringe connected regions in images A1 and B1, respectively.

[0123] Specifically, in step 4), based on the phase overlap relationship between the fringe connected regions in image A and the auxiliary image, and the phase overlap relationship between the fringe connected regions in image B and the auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively. There are two methods, and either method one or method two can be used in the specific implementation:

[0124] Method 1:

[0125] ① Select any one of the fringe connected regions in image A and label it as fringe connected region I; for example, Figure 4 The solid line represents the connected region of fringe number 4;

[0126] ② Set the gray value of the fringe connected region I to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A;

[0127] ③ Multiply the image by either image B1 (dashed line) or image A1 (solid line); then proceed to step Q.

[0128] Step Q: Determine if the dot product result is zero: (This indicates that there is no phase overlap region and the image boundary has been reached.)

[0129] If the value is zero, proceed directly to step 9;

[0130] If it is not zero, then mark the fringe connected region corresponding to the area where the dot product result is located (the fringe connected region labeled 4, which is the fringe connected region 4 represented by the dashed line if it is multiplied by image B1) as fringe connected region II; set the gray value of fringe connected region II to 1, and set the gray value of other areas to 0, to generate an image of the same size as image A.

[0131] ④ Multiply the generated image by the image B; process the dot product result in the same way as in step Q, and mark the latest labeled fringe connected region II (fringe connected region No. 4 represented by the dashed line) as fringe connected region II-B;

[0132] (That is: multiply the generated image by the image B;)

[0133] Step Q: Determine if the dot product is zero:

[0134] If the value is zero, proceed directly to step 9;

[0135] If it is not zero, then mark the fringe connected region corresponding to the region where the dot product result is located as fringe connected region II; set the gray value of fringe connected region II to 1, and set the gray value of other regions to 0, to generate an image of the same size as image A;

[0136] And the newly labeled striped connected region II is labeled as striped connected region II-B;

[0137] ⑤ Multiply the images B1 and A1 by the image generated in step ④; process the multiplication result in the same way as in step Q;

[0138] ⑥ Multiply the image generated in step ⑤ by the image A; process the dot product result in the same way as in step Q; and in image A, record the newly labeled fringe connected region II (fringe connected region No. 5 represented by the solid line) and fringe connected region I (fringe connected region No. 4 represented by the solid line) as adjacent;

[0139] ⑦ Multiply the images B1 and A1 by the image generated in step ⑥; process the multiplication result in the same way as in step Q;

[0140] ⑧ Multiply the image generated in step ⑦ by the image B, and process the dot product result in the same way as in step Q; and in image B, record the newly labeled fringe connected region II (fringe connected region No. 18 represented by the dashed line) and the fringe connected region II-B (fringe connected region No. 4 represented by the dashed line) labeled in step ④ as adjacent to each other.

[0141] ⑨ Remove the fringe connected regions in image A that have already been labeled as fringe connected regions I. Select any one of the remaining fringe connected regions and label it as a new fringe connected region I. Repeat steps ② to ⑧ using the new fringe connected region I until all fringe connected regions in image A have been labeled as fringe connected regions I. The process ends here. The adjacency relationship between each fringe connected region in images A and B is obtained.

[0142] Method 2:

[0143] ① Select any one of the fringe connected regions in image B and label it as fringe connected region I; for example, Figure 5 The dashed line represents the connected region of stripe number 4;

[0144] ② Set the gray value of the fringe connected region I to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A;

[0145] ③ Multiply the image by either image B1 (dashed line) or image A1 (solid line); then proceed to step Q.

[0146] Step Q: Determine if the dot product is zero:

[0147] If the value is zero, proceed directly to step 9; (this indicates that there is no phase overlap region and the image boundary has been reached).

[0148] If it is not zero, then mark the fringe connected region corresponding to the area where the dot product result is located as fringe connected region II (if the dot product is image B1, then it is connected region No. 4 represented by the dashed line); set the gray value of fringe connected region II to 1, and set the gray value of other areas to 0, to generate an image of the same size as image A.

[0149] ④ Multiply the generated image by image A; process the dot product result in the same way as in step Q, and label the latest labeled fringe connected region II (the 5th fringe connected region represented by the solid line) as fringe connected region II-A;

[0150] ⑤ Multiply the images B1 and A1 by the image generated in step ④; process the multiplication result in the same way as in step Q;

[0151] ⑥ Multiply the image generated in step ⑤ by the image B; process the dot product result in the same way as in step Q; and in image B, record the newly labeled fringe connected region II (fringe connected region No. 18 represented by the dashed line) and fringe connected region I (fringe connected region No. 4 represented by the dashed line) as adjacent;

[0152] ⑦ Multiply the images B1 and A1 by the image generated in step ⑥; process the multiplication result in the same way as in step Q;

[0153] ⑧ Multiply the image generated in step ⑦ by the image A, and process the dot product result in the same way as in step Q; and in image A, record the newly labeled fringe connected region II (fringe connected region No. 19 represented by the solid line) and the fringe connected region II-A (fringe connected region No. 5 represented by the solid line) obtained in step ④ as adjacency.

[0154] ⑨ Remove the fringe connected regions in image B that have already been labeled as fringe connected regions I. Select any one of the remaining fringe connected regions and label it as a new fringe connected region I. Do not label the old fringe connected regions I. Repeat steps ② to ⑧ using the new fringe connected regions I until all fringe connected regions in image B have been labeled as fringe connected regions I. End the process. Obtain the adjacency relationship between each fringe connected region in images A and B.

[0155] also,

[0156] To facilitate calculations, the following search rules are specified:

[0157] In image A, image B, and each auxiliary image, the connected components of each stripe are numbered in order from the top left corner to the bottom right corner.

[0158] In step ①, the fringe connected region with the smallest number is selected in image A / image B and marked as fringe connected region I; in step ⑨, the fringe connected region with the smallest number is selected from the remaining fringe connected regions and marked as the new fringe connected region I.

[0159] Correspondingly, in step ③, when Δδ>0, the image is multiplied by the image A1, that is, in Figure 5 In the middle, find the adjacency relationship from left to right.

[0160] When Δδ < 0, multiply the image by the dot product of the image B1; that is, in Figure 4 In the middle, find the adjacency relationship from left to right.

[0161] or:

[0162] In step ①, the stripe connected region with the largest number is selected from image A / image B and marked as stripe connected region I; in step ⑦, the stripe connected region with the largest number is selected from the remaining stripe connected regions and marked as the new stripe connected region I.

[0163] Correspondingly, in step ③, when Δδ>0, the image is multiplied by the image B1, that is, in Figure 5 In the middle, the adjacency relationship is found from right to left.

[0164] When Δδ < 0, multiply the image by the image A1, i.e., in Figure 4 In the middle, the adjacency relationship is found from right to left.

[0165] In this embodiment, when performing connected component analysis on image A, dilation is first performed on image A, followed by connected component analysis. In the resulting fringe connected components, the gray values ​​of pixels with truncated phases less than zero are set to zero. This effectively suppresses noise interference in the image and prevents noise points from being analyzed as separate fringe connected components and included in the numbering during connected component analysis. To facilitate connected component analysis, in specific implementation, the gray value difference between c and d is greater than 100.

[0166] In this embodiment, if two or more striped connected regions are found to be adjacent to striped connected region I during the search process (there are multiple new striped connected regions II), the multiple striped connected regions II are marked as adjacent to striped connected region I respectively.

[0167] Once the adjacency relationships of each stripe are determined, if two or more stripe connected regions have the same connection relationship, it means that they belong to the same stripe and have the same stripe level.

[0168] For example, Figure 3 In pattern a, stripe 5 is adjacent to stripes 6 and 19, and stripes 6 and 19 are adjacent to stripes 7 and 22. Since stripes 6 and 19 are both adjacent to stripes 5, 7 and 22 (i.e., they have the same adjacency relationship), it is determined that stripes 6 and 19 are the same stripe and have the same stripe class.

[0169] This method, based on phase overlap, progressively identifies the adjacency relationships between connected fringe regions in image A and image B, and then derives the fringe order based on these adjacency relationships. It is fast and accurate, and can perform rapid spatial phase unfolding.

[0170] For ease of interpretation and precise definition of the appended claims, the terms “upper,” “lower,” “inner,” and “outer” are used to describe features of exemplary embodiments with reference to the positions of these features shown in the accompanying drawings.

[0171] The foregoing description of specific exemplary embodiments of the present invention is for illustrative and descriptive purposes. It is not intended to be exhaustive, nor to limit the invention to the precise forms disclosed; obviously, many changes and variations are possible in accordance with the foregoing teachings. The exemplary embodiments were chosen and described to explain the specific principles of the invention and its practical application, thereby enabling others skilled in the art to implement and utilize various exemplary embodiments of the invention, as well as their different alternatives and modifications. The scope of the invention is intended to be defined by the appended claims and their equivalents.

Claims

1. A fast spatial phase unfolding method, characterized in that, Includes the following steps: 1) Calculate the truncated phase of each pixel based on the acquired multiple phase-shifted images; 2) Set the gray value of the pixels with a phase value ≥ 0 to c, and set the gray value of the other pixels to d to generate an image, denoted as image A; Set the gray value of the truncated pixels with a phase value < 0 to c, and set the gray value of the other pixels to d to generate another image, denoted as image B; 3) Shift the phase shift step size of each phase-shifted image from step 1) by a constant. The truncated phase of each pixel is calculated using the phase shift step size after the shift. Using the same processing method as in step 2), new image A and new image B are obtained based on the newly obtained truncated phase of each pixel, and they are denoted as image A1 and image B1 respectively. Image A1 and image B1 are collectively referred to as auxiliary images; 4) Perform connected component analysis on image A, image B, and each auxiliary image to obtain multiple stripe connected components; Based on the phase overlap relationship between the fringe connected regions in image A and the auxiliary image, and the phase overlap relationship between the fringe connected regions in image B and the auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively. Based on the adjacency relationship, each fringe connected region is sequentially numbered in image A and image B respectively; 5) The numbering order of the fringe connected regions in image A is recorded as the positive phase fringe order code, and the numbering order of the fringe connected regions in image B is recorded as the negative phase fringe order code. The continuous phase is calculated using positive phase fringe level coding, negative phase fringe level coding, and the truncated phase in step S1, thus completing the spatial phase unfolding.

2. The fast spatial phase unfolding method as described in claim 1, characterized in that: In step 3), the phase shift step size of the i-th phase-shifted image in step 1) is... moving constant The truncated phase at pixel (x,y) is calculated using the phase shift step size after the shift. : Represent the fringe expression for the i-th phase-shifted image; where, It is the background light intensity at pixel (x, y). Phu(x,y) is the modulation intensity at pixel (x,y), and Phu(x,y) is the continuous phase to be solved at pixel (x,y).

3. The fast spatial phase unfolding method as described in claim 1, characterized in that: - ≤ ≤ 。 4. The fast spatial phase unfolding method as described in claim 1, characterized in that: In step 4), each stripe connected region is numbered in image A, image B and each auxiliary image respectively.

5. The fast spatial phase unfolding method as described in claim 1, characterized in that: Step 4) Based on the phase overlap relationship between the fringe connected regions in image A and the auxiliary image, and the phase overlap relationship between the fringe connected regions in image B and the auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively, in the following way: ① Select any one of the stripe connected regions in image A and label it as stripe connected region I; ② Set the gray value of the fringe connected region I to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A; ③ Multiply the image by either image B1 or image A1; then proceed to step Q. Step Q: Determine if the dot product is zero: If the value is zero, proceed directly to step 9; If it is not zero, then the fringe connected region corresponding to the region where the dot product result is located is marked as fringe connected region II; Set the gray value of the fringe connected region II to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A; ④ Multiply the generated image by the image B; process the dot product result in the same way as in step Q, and label the newly labeled fringe connected region II as fringe connected region II-B; ⑤ Multiply the images B1 and A1 by the image generated in step ④; Process the dot product results in the same way as in step Q; ⑥ Multiply image A by the image generated in step ⑤; The dot product result is processed in the same way as in step Q; and in image A, the newly labeled fringe connected region II and fringe connected region I are recorded as adjacency. ⑦ Multiply the images B1 and A1 by the image generated in step ⑥; Process the dot product results in the same way as in step Q; ⑧ Multiply the image generated in step ⑦ by the image B, and process the dot product result in the same way as in step Q; and in image B, record the newly labeled fringe connected region II and the fringe connected region II-B labeled in step ④ as adjacent; ⑨ Remove the fringe connected regions in image A that have already been labeled as fringe connected regions I. Select any one of the remaining fringe connected regions and label it as a new fringe connected region I. Repeat steps ② to ⑧ using the new fringe connected region I until all fringe connected regions in image A have been labeled as fringe connected regions I. End the process. Obtain the adjacency relationship between each fringe connected region in images A and B.

6. The fast spatial phase unfolding method as described in claim 1, characterized in that: Step 4) Based on the phase overlap relationship between the fringe connected regions in image A and the auxiliary image, and the phase overlap relationship between the fringe connected regions in image B and the auxiliary image, the adjacency relationship between each fringe connected region in image A and image B is obtained respectively, in the following way: ① Select any one of the stripe connected regions in image B and label it as stripe connected region I; ② Set the gray value of the fringe connected region I to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A; ③ Multiply the image by either image B1 or image A1; then proceed to step Q. Step Q: Determine if the dot product is zero: If the value is zero, proceed directly to step 9; If it is not zero, then the fringe connected region corresponding to the region where the dot product result is located is marked as fringe connected region II; Set the gray value of the fringe connected region II to 1, and set the gray value of other regions to 0 to generate an image of the same size as image A; ④ Multiply the generated image by the image A; Process the dot product result in the same way as in step Q, and label the latest labeled fringe connected region II as fringe connected region II-A; ⑤ Multiply the images B1 and A1 by the image generated in step ④; Process the dot product results in the same way as in step Q; ⑥ Multiply the image generated in step ⑤ by the image B; process the dot product result in the same way as in step Q; and in image B, record the newly labeled fringe connected region II and fringe connected region I as adjacent; ⑦ Multiply the images B1 and A1 by the image generated in step ⑥; Process the dot product results in the same way as in step Q; ⑧ Multiply the image generated in step ⑦ by the image A, and process the dot product result in the same way as in step Q; and in image A, record the newly labeled fringe connected region II and the fringe connected region II-A obtained in step ④ as adjacency; ⑨ Remove the fringe connected regions in image B that have already been labeled as fringe connected regions I. Select any one of the remaining fringe connected regions and label it as a new fringe connected region I. Do not label the old fringe connected regions I. Repeat steps ② to ⑧ using the new fringe connected regions I until all fringe connected regions in image B have been labeled as fringe connected regions I. End the process. Obtain the adjacency relationship between each fringe connected region in images A and B.

7. The fast spatial phase unfolding method as described in claim 5 or 6, characterized in that: In image A, image B, and each auxiliary image, the connected components of each stripe are numbered in order from the top left corner to the bottom right corner. In step ①, the fringe connected region with the smallest number is selected in image A / image B and marked as fringe connected region I; in step ⑨, the fringe connected region with the smallest number is selected from the remaining fringe connected regions and marked as the new fringe connected region I. Correspondingly, in step ③, when >0, multiply the image A1 by the image dotwise respectively, when <0, multiply the image by the image B1 respectively; or: In step ①, the stripe connected region with the largest number is selected from image A / image B and marked as stripe connected region I; in step ⑦, the stripe connected region with the largest number is selected from the remaining stripe connected regions and marked as the new stripe connected region I. Correspondingly, in step ③, when >0, multiply the image by the image B1 respectively, when If <0, multiply the image by the image A1.

8. The fast spatial phase unfolding method as described in claim 1, characterized in that: When performing connected component analysis on image A, first perform dilation operation on image A, and then perform connected component analysis; in the obtained fringe connected component, set the gray value of pixels with a phase less than zero to zero.

9. The fast spatial phase unfolding method as described in claim 1, characterized in that: The grayscale difference between c and d is greater than 100; or, c=255, d=0, to generate a binarized image.

Citation Information

Patent Citations

  • Structured light three-dimensional measurement method based on spatial binary encoding

    CN110645919A

  • Interval processing type phase unwrapping method

    CN111307066A

  • Folding phase assisted binary coding fast phase unwrapping method

    CN116055739A