A phase unwrapping method for color phase order coding and decoding
Through the color phase order encoding and decoding method, combined with the HSI color space and the DeBruijn sequence, the problems of phase ambiguity and measurement speed in optical three-dimensional measurement are solved, and efficient three-dimensional measurement is achieved.
Patent Information
- Application Number
- CN202310385350.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2043-04-11
AI Technical Summary
In the existing optical three-dimensional measurement technology, the effective range of phase information is limited to (-π,π], resulting in phase ambiguity, and traditional methods require projection of a large number of stripe patterns, which increases the requirements of the equipment and the measurement speed is affected.
A phase expansion method for color phase order encoding and decoding is proposed. By constructing a color value mapping table containing color, color number label and tone values, combining the HSI color space and the DeBruijn sequence, the encoding and decoding of the phase order is realized, and the number of projected patterns is reduced.
The number of projections is significantly reduced, the three-dimensional measurement efficiency is improved, and sufficient phase order information can be obtained with fewer projection patterns, solving the problems of phase ambiguity and measurement speed.
Smart Images

Figure CN116429022B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of three-dimensional shape measurement, and in particular to a phase unwrapping method of color phase order encoding and decoding. Background Art
[0002] With the progress of image processing, optics and computer technology, optical image processing technology based on photoelectric imaging theory has developed rapidly, and has been widely studied and applied in the past few decades, and computer vision technology has also made a qualitative breakthrough. As people have higher and higher requirements for the richness and diversity of information, the development and application of computer vision technology has gradually evolved from two-dimensional images to three-dimensional space. How to quickly obtain high-quality spatial stereoscopic visual perception information has become a research focus in the field of computer vision today.
[0003] Optical 3D measurement technology in the field of computer vision has the advantages of high precision, high speed and non-contact, and is widely used in industrial modeling, virtual and reality, microscopic measurement and other fields. Among them, the most famous optical measurement method is the fringe projection profile measurement method, which uses a projector to project a grating image carrying phase information, and a camera synchronously captures the image modulated by the measured object, and uses the phase shift method to decode it to obtain the phase information. Since the contour information of the object surface is hidden in the phase information, and the phase information can only be obtained through the arc tangent function, the effective range of the phase is limited to (-π,π], resulting in phase ambiguity.
[0004] To eliminate phase ambiguity, phase unwrapping technology is needed to restore the continuous absolute phase. To robustly unwrap the wrapped phase into the absolute phase, additional coded structured light is mainly used to obtain phase order information, and then the phase order information is used to assist the wrapped phase in phase unwrapping to obtain the absolute phase. Because this type of method is more robust, it has a good effect on some discontinuous or isolated complex scenes. However, it is necessary to project a large number of fringe patterns on the basis of constructing the baseband wrapped phase, which increases the number of projected gratings, has higher requirements on the equipment, and the measurement speed is also affected accordingly.
[0005] Therefore, how to obtain sufficient phase order information with fewer projection patterns is one of the key issues to improve the performance of the phase method measurement system. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a phase unwrapping method for color phase order encoding and decoding.
[0007] The purpose of the present invention is achieved through the following technical solutions:
[0008] The present invention provides a phase unwrapping method for color phase order coding and decoding, comprising the following steps:
[0009] S1. Construct a color value mapping table including color, color number label and hue value according to the HSI color space;
[0010] S2, combining the color value mapping table to construct two sets of misaligned DeBruijn sequences as two sets of stripe labels;
[0011] S3, constructing a corresponding phase order lookup table after performing fringe encoding on the two groups of fringe tags;
[0012] S4, obtaining a gray deformed phase-shifted fringe pattern from the scene to be measured and calculating the wrapped phase;
[0013] S5, obtaining a color deformed phase-shifted fringe pattern from the scene to be tested, and decoding the color deformed phase-shifted fringe pattern in combination with a color value mapping table;
[0014] S6, the decoded information is converted into phase order in combination with a phase order lookup table;
[0015] S7. Combining the phase order with the wrapped phase to perform phase unwrapping to obtain the absolute phase.
[0016] As a further improvement, in step S2, two groups of staggered DeBruijn sequences are constructed as two groups of stripe labels in combination with the color value mapping table, which specifically includes the following steps:
[0017] S21, constructing a first set of six-element second-order DeBruijn sequences in combination with the color value mapping table;
[0018] S22. Use a shift operation to place the first value of the first group of DeBruijn sequences at the last position, and move all subsequent values forward by one position, to construct a second group of DeBruijn sequences.
[0019] As a further improvement, in step S3, after fringe encoding of two groups of fringe tags, a corresponding phase order lookup table is constructed, specifically in the following steps:
[0020] S31, combining the values of the same positions of the two groups of stripe labels into a decimal number;
[0021] S32. Form phase orders according to the sequence corresponding to the decimal digits.
[0022] As a further improvement, in step S4, obtaining a gray deformed phase-shifted fringe pattern from the scene to be measured and calculating the wrapped phase specifically includes the following steps:
[0023] S41, after projecting a multi-step phase-shifted fringe pattern into the scene to be tested, photographing it with a camera to obtain a gray deformed phase-shifted fringe pattern;
[0024] S42. Calculate the wrapping phase based on the gray deformed phase-shifted fringe pattern.
[0025] As a further improvement, in step S42, the wrapping phase is calculated based on the gray deformed phase-shifted fringe pattern, and the formula is as follows:
[0026]
[0027] where φ(u, v) is the wrapping phase, represents the gray deformed phase-shift fringe pattern, i represents the count of the gray deformed phase-shift fringe pattern, N represents the total number of phase-shift fringe patterns, n represents a constant, the superscript c represents the pattern captured by the camera, (u, v) represents the pixel coordinates, and the pixel coordinates are retrieved from the zero point to the maximum value.
[0028] As a further improvement, in step S5, a color deformation phase shift fringe pattern is obtained from the scene to be tested, and the color deformation phase shift fringe pattern is decoded in combination with a color value mapping table, which specifically includes the following steps:
[0029] S51, after projecting a color DeBruijn fringe pattern into the scene to be tested, photographing it with a camera to obtain a color deformed phase-shifted fringe pattern;
[0030] S52, converting the color deformation phase-shift fringe pattern from the RGB mode to the HSI mode;
[0031] S53 , decoding the color deformed phase-shifted fringe image in the HSI mode in combination with the color value mapping table to obtain a color number label value corresponding to each pixel in the color deformed phase-shifted fringe image.
[0032] As a further improvement, in step S6, the decoded information is converted into phase order in combination with the phase order lookup table, which specifically includes the following steps:
[0033] S61, converting the color number label value in the decoded color deformation phase-shift fringe image into a decimal value;
[0034] S62, converting the converted decimal value into a phase order;
[0035] S63, combining the converted phase order with the phase order lookup table to obtain a phase order diagram.
[0036] As a further improvement, in step S7, the phase order is combined with the wrapped phase to perform phase unwrapping to obtain the absolute phase, which specifically includes the following steps:
[0037] S71, performing phase unwrapping on the transformed phase order in combination with the wrapped phase to obtain an absolute phase with a periodic error;
[0038] S72, using median filtering to remove periodic errors in absolute phase;
[0039] S73, performing auxiliary phase unwrapping on the absolute phase with the periodic error removed to obtain an error-free absolute phase.
[0040] As a further improvement, in step S71, the transformed phase order is combined with the wrapped phase to perform phase unwrapping, and the phase unwrapping formula is as follows:
[0041] Φ erros (u, v) = φ (u, v) + 2π × k (u, v)
[0042] Among them, Φ erros (u, v) represents the absolute phase with periodic error, φ(u, v) represents the wrapped phase, and k(u, v) represents the phase order.
[0043] As a further improvement, in step S73, auxiliary phase unwrapping is performed on the absolute phase after removing the periodic error to obtain an error-free absolute phase, including the following formula:
[0044]
[0045] Where Φ(u, v) represents the absolute phase without error, Φ template (u, v) represents the absolute phase after removing the periodic error.
[0046] The present invention provides a phase unwrapping method for color phase order encoding and decoding, comprising the steps of: S1, constructing a color value mapping table including color, color number label and hue value according to HSI color space; S2, constructing two groups of staggered DeBruijn sequences as two groups of fringe labels in combination with the color value mapping table; S3, constructing a corresponding phase order lookup table after fringe encoding the two groups of fringe labels; S4, obtaining a gray deformed phase shift fringe diagram from the scene to be measured and calculating the wrapped phase; S5, obtaining a color deformed phase shift fringe diagram from the scene to be measured, and decoding the color deformed phase shift fringe diagram in combination with the color value mapping table; S6, converting the decoded information into a phase order in combination with the phase order lookup table; S7, performing phase unwrapping on the phase order in combination with the wrapped phase to obtain the absolute phase. The present invention constructs two groups of staggered DeBruijn sequences, performs phase order encoding in combination with HSI color space, uses the chromaticity channel in the HSI color space to distinguish basic color information, realizes hue decoupling in complex scenes with alternating light and dark, makes the number of projections significantly less than that of traditional methods, and greatly improves the efficiency of three-dimensional measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the process of the present invention;
[0048] Figure 2 Schematic diagram of the HSI color space plane in an embodiment of the present invention;
[0049] Figure 3A The color DeBruijn stripe coding diagram corresponding to the first group of DeBruijn sequences in the embodiment of the present invention;
[0050] Figure 3B The color DeBruijn stripe coding diagram corresponding to the second group of DeBruijn sequences in the embodiment of the present invention;
[0051] Figure 4A In the embodiment of the present invention Gray deformed phase-shifted fringe pattern;
[0052] Figure 4B In the embodiment of the present invention Gray deformed phase-shifted fringe pattern;
[0053] Figure 4C In the embodiment of the present invention Gray deformed phase-shifted fringe pattern;
[0054] Figure 5A In the embodiment of the present invention Color morphing phase-shifted fringe pattern;
[0055] Figure 5B In the embodiment of the present invention Color morphing phase-shifted fringe pattern;
[0056] Fig. 6A is a phase order diagram in an embodiment of the present invention;
[0057] Figure 6B is an absolute phase diagram with periodic error in an embodiment of the present invention;
[0058] Figure 6C is an absolute phase diagram without error in an embodiment of the present invention;
[0059] Figure 7 1 is an object depth distribution diagram of two portrait sculptures in an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features therein can be combined with each other without conflict.
[0061] The embodiment of the present invention takes the three-step phase shift with a period number of 36 and the color De Bruijn fringes as an example, and describes the measurement of a complex scene with two portrait sculptures.
[0062] Combination Figure 1 As shown, an embodiment of the present invention provides a phase unwrapping method for color phase order encoding and decoding, comprising the following steps:
[0063] S1. Construct a color value mapping table including color, color number label and hue value according to the HSI color space, and select six colors with large hue difference from the HSI color space for encoding to reduce the crosstalk between different color stripes, such as Figure 2 As shown, the six colors include red, green, blue, yellow, cyan and magenta. According to the corresponding color number labels of the six colors and the hue H value range in the HSI color space, a color value mapping table as shown in Table 1 is constructed:
[0064] Table 1 Color value mapping table
[0065]
[0066] S2. Combining the color value mapping table, constructing two sets of misaligned DeBruijn sequences as two sets of stripe labels, specifically including the following steps:
[0067] S21, combined with the color value mapping table to construct the first group of six-element second-order DeBruijn sequence S 1 As shown below:
[0068] S 1 ={665564544635343362524232261514131211}
[0069] S22, use the shift operation to convert the first group of DeBruijn sequences S 1 The first value of is placed at the last position, and all the following values are moved forward by one position to construct the second group of DeBruijn sequence S 2 As shown below:
[0070] S 2 ={655645446353433625242322615141312116}
[0071] S 1 and S 2 As two sets of striped labels.
[0072] S3, after performing fringe encoding on the two groups of fringe tags, a corresponding phase order lookup table is constructed, which is specifically performed in the following steps:
[0073] S31, two sets of stripe labels S 1 and S 2 The values at the same position of are combined into a decimal number;
[0074] S32, forming phase orders according to the sequence corresponding to the decimal digits, and constructing a phase order lookup table as shown in Table 2 below:
[0075] Table 2 Phase order lookup table
[0076]
[0077] Two sets of stripe labels are combined with the color and color number labels in the color value mapping table to encode stripes. Two color DeBruijn stripe encoding images CC 1 (u,v),CC 2 (u, v) are respectively Figure 3A and Figure 3B shown.
[0078] S4, obtaining a gray deformed phase-shifted fringe pattern from the scene to be tested and calculating the wrapped phase, specifically comprising the following steps:
[0079] S41, in this embodiment, a projector projects a three-step phase-shifted fringe pattern onto the scene to be tested, such as Figure 4A , Figure 4B and Figure 4C As shown, the gray deformed phase-shifted fringe pattern is obtained by synchronously shooting with an industrial camera.
[0080] S42. Calculate the wrapped phase according to the gray deformed phase shift fringe pattern. The specific formula is as follows:
[0081]
[0082] where φ(u, v) is the wrapping phase, represents the gray deformed phase-shift fringe pattern, i represents the count of the gray deformed phase-shift fringe pattern, N represents the total number of phase-shift fringe patterns, n represents a constant, the superscript c represents the pattern captured by the camera, (u, v) represents the pixel coordinates, and the pixel coordinates are retrieved from the zero point to the maximum value.
[0083] S5, obtaining a color deformation phase shift fringe pattern from the scene to be tested, and decoding the color deformation phase shift fringe pattern in combination with a color value mapping table, specifically comprising the following steps:
[0084] S51, after the projector projects two colored DeBruijn fringe patterns onto the scene to be tested, Figure 5A and Figure 5B As shown, two color deformation phase-shift fringe images were obtained by synchronously shooting with an industrial camera. Color deformation phase shift fringe image captured In RGB mode, it is expressed as the following formula:
[0085]
[0086] Where i represents the number of color deformation phase shift fringe patterns, i∈1,2, Represents the intensity of the red channel of the color fringe phase shift pattern RGB mode, Represents the intensity of the green channel of the color fringe phase shift pattern RGB mode, Represents the intensity of the blue channel of the color fringe phase shift pattern RGB mode.
[0087] S52, using the HSI mode-based color recognition algorithm to decode the color stripes, converting the color deformation phase-shifted stripe pattern from the RGB mode to the HSI mode, and obtaining the hue H of the HSI mode using the following formula:
[0088]
[0089]
[0090] Wherein, H(u, v) represents the hue of each pixel, θ(u, v) represents the hue angle of each pixel, and cos represents the cosine function.
[0091] S53, comparing the hue H value of the HIS mode color deformation phase shift fringe image with the hue H value range in the color value mapping table and distinguishing and decoding them to obtain two color deformation phase shift fringe images The label value corresponding to each pixel in .
[0092] S6, the decoded information is converted into phase order in combination with the phase order lookup table, specifically including the following steps:
[0093] S61, converting the color number label value in the decoded color deformation phase-shift fringe image into a decimal value, the formula is as follows:
[0094]
[0095] Wherein, W(u, v) represents the weighted decimal value.
[0096] S62. Convert the converted decimal value into phase order, the formula is as follows:
[0097] k(u,v)=f(W(u,v))
[0098] Among them, k(u, v) is the phase order, and f(.) represents the conversion between weighted value and phase order.
[0099] S63, combining the converted phase order with the phase order lookup table to obtain a phase order diagram, such as Fig. 6A shown.
[0100] S7, combining the phase order with the wrapped phase to perform phase unwrapping to obtain the absolute phase, specifically comprising the following steps:
[0101] S71. The transformed phase order is combined with the wrapped phase to perform phase unwrapping to obtain an absolute phase with periodic error. The phase unwrapping formula is as follows:
[0102] Φ erros (u, v) = φ (u, v) + 2π × k (u, v)
[0103] Among them, Φ erros (u, v) represents the absolute phase with periodic error.
[0104] S72. In the traditional phase order encoding, six Gray code patterns are required for global encoding, and due to the defocusing effect of the projector, a periodic phase error with an amplitude of ±2π appears on the absolute phase. The embodiment of the present invention uses median filtering to remove the periodic error on the absolute phase. While avoiding the periodic error, it will not affect the normal phase and has good robustness in a high noise environment. The median filtering process is as follows:
[0105] Φ template = medfilt[Φ erros ] a×b
[0106] Among them, medfilt[·] a×b represents the median filter operator, a and b represent the length and width of the filter kernel respectively, Φ template represents Φ after median filtering erros .
[0107] S73, performing auxiliary phase unwrapping on the absolute phase after removing the periodic error to obtain an error-free absolute phase, such as Figure 6C As shown, including the following formula:
[0108]
[0109] Here, Φ(u, v) represents the absolute phase without error.
[0110] Finally, the absolute phase is combined with the structured light system parameters to reconstruct the object depth distribution map, such as Figure 7 shown.
[0111] The color phase order encoding and decoding method in the embodiment of the present invention combines the advantages of traditional Gray code and DeBruijn code, uses only two images to globally encode 36 phase orders, and the number of projections is significantly less than that of traditional methods, which greatly improves the three-dimensional measurement efficiency.
[0112] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A phase unwrapping method for color phase order coding and decoding, It is characterized in that The steps include: S1. Construct a color value mapping table including color, color number label and hue value according to the HSI color space; S2, combining the color value mapping table to construct two sets of misaligned DeBruijn sequences as two sets of stripe labels; S3, constructing a corresponding phase order lookup table after performing fringe encoding on the two groups of fringe tags; S4, obtaining a gray deformed phase-shifted fringe pattern from the scene to be measured and calculating the wrapped phase; S5, obtaining a color deformed phase-shifted fringe pattern from the scene to be tested, and decoding the color deformed phase-shifted fringe pattern in combination with a color value mapping table; S6, the decoded information is converted into phase order in combination with a phase order lookup table; S7, combining the phase order with the wrapped phase to perform phase unwrapping to obtain the absolute phase; In step S3, after fringe encoding of two groups of fringe tags, a corresponding phase order lookup table is constructed, which is specifically as follows: S31, combining the values of the same positions of the two groups of stripe labels into a decimal number; S32, forming a phase order according to the sequence corresponding to the decimal digits; In step S4, a gray deformed phase-shifted fringe pattern is obtained from the scene to be measured and a wrapped phase is calculated, which specifically includes the following steps: S41, after projecting a multi-step phase-shifted fringe pattern into the scene to be tested, photographing it with a camera to obtain a gray deformed phase-shifted fringe pattern; S42. Calculate the wrapping phase based on the gray deformed phase-shifted fringe pattern.
2. The phase unwrapping method for color phase order coding and decoding according to claim 1, It is characterized in that In step S2, two groups of staggered DeBruijn sequences are constructed as two groups of stripe labels in combination with the color value mapping table, which specifically includes the following steps: S21, constructing a first set of six-element second-order DeBruijn sequences in combination with the color value mapping table; S22. Use a shift operation to place the first value of the first group of DeBruijn sequences at the last position, and move all subsequent values forward by one position, to construct a second group of DeBruijn sequences.
3. The phase unwrapping method for color phase order coding and decoding according to claim 1, It is characterized in that In step S42, the wrapping phase is calculated based on the gray deformed phase-shifted fringe pattern, and the formula is as follows: where φ(u, v) is the wrapping phase, represents the gray deformed phase-shift fringe pattern, i represents the count of the gray deformed phase-shift fringe pattern, N represents the total number of phase-shift fringe patterns, n represents a constant, the superscript c represents the pattern captured by the camera, (u, v) represents the pixel coordinates, and the pixel coordinates are retrieved from the zero point to the maximum value.
4. The phase unwrapping method for color phase order coding and decoding according to claim 1, It is characterized in that In step S5, a color deformation phase shift fringe pattern is obtained from the scene to be tested, and the color deformation phase shift fringe pattern is decoded in combination with a color value mapping table, which specifically includes the following steps: S51, after projecting a color DeBruijn fringe pattern into the scene to be tested, photographing it with a camera to obtain a color deformed phase-shifted fringe pattern; S52, converting the color deformation phase-shift fringe pattern from the RGB mode to the HSI mode; S53 , decoding the color deformed phase-shifted fringe image in the HSI mode in combination with the color value mapping table to obtain a color number label value corresponding to each pixel in the color deformed phase-shifted fringe image.
5. The phase unwrapping method for color phase order coding and decoding according to claim 4, It is characterized in that In step S6, the decoded information is converted into phase order in combination with the phase order lookup table, which specifically includes the following steps: S61, converting the color number label value in the decoded color deformation phase-shift fringe image into a decimal value; S62, converting the converted decimal value into a phase order; S63, combining the converted phase order with the phase order lookup table to obtain a phase order diagram.
6. The phase unwrapping method for color phase order coding and decoding according to claim 5, It is characterized in that In step S7, the phase order is combined with the wrapped phase to perform phase unwrapping to obtain the absolute phase, which specifically includes the following steps: S71, performing phase unwrapping on the transformed phase order in combination with the wrapped phase to obtain an absolute phase with a periodic error; S72, using median filtering to remove periodic errors in absolute phase; S73, performing auxiliary phase unwrapping on the absolute phase with the periodic error removed to obtain an error-free absolute phase.
7. The phase unwrapping method for color phase order coding and decoding according to claim 6, It is characterized in that In step S71, the transformed phase order is combined with the wrapped phase to perform phase unwrapping, and the phase unwrapping formula is as follows: Φ erros (u, v)=φ(u, v)+2π×k(u, v) Among them, Φ erros (u,v) represents the absolute phase with periodic error, φ(u,v) is the wrapped phase, and k(u,v) represents the phase order.
8. The phase unwrapping method for color phase order coding and decoding according to claim 7, It is characterized in that In step S73, auxiliary phase unwrapping is performed on the absolute phase after removing the periodic error to obtain an error-free absolute phase, including the following formula: Among them, Φ(u,v) represents the error-free absolute phase, φ(u,v) is the wrapped phase, Φ temolate (u, v) represents the absolute phase after removing the periodic error.
Citation Information
Patent Citations
Measurement system and method based on binocular camera and structural optical codec
CN108592822A
Decoding method based on binocular vision color strip encoding
CN108592823A