Three-dimensional reconstruction method and system based on line shift coding pattern
Through the three-dimensional reconstruction method based on line shift coding patterns, the problems of low efficiency and low accuracy in the three-dimensional reconstruction of high-reflective or high-dynamic range objects are solved, and the three-dimensional reconstruction effect with high precision and high efficiency is achieved.
Patent Information
- Application Number
- CN202411559933.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In the prior art, when processing high-reflective objects or objects with high dynamic range, the three-dimensional reconstruction effect is affected, resulting in low efficiency and low accuracy.
Using a three-dimensional reconstruction method based on line shift coded patterns, multiple coded patterns are designed through line shift method, and the objects to be measured are projected and collected in combination with the preset Gray code pattern, and the M-frame phase shift stripe pattern is synthesized for phase solution and phase Expand and finally use the three-dimensional reconstruction principle to reconstruct.
High-precision three-dimensional reconstruction in high-dynamic range scenarios is realized, improving reconstruction efficiency and robustness.
Smart Images

Figure CN119437086A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of machine vision, image processing and three-dimensional reconstruction, and in particular to a three-dimensional reconstruction method and system based on line shift coding patterns. Background Art
[0002] Fringe projection technology has been widely used in many fields such as industrial parts inspection, reverse engineering, quality control, and cultural relics digitization due to its advantages of non-contact detection, fast response, high precision, and full-field measurement. However, this technology is mainly suitable for 3D reconstruction of diffuse reflective object surfaces. When facing highly reflective objects or objects with a high dynamic range (such objects are prone to overexposure of camera data), the reconstruction effect will be significantly affected, thus limiting the further development of this technology.
[0003] Machine vision technology is also widely used in the industrial field, especially in workpiece grasping, sorting, palletizing, quality inspection, assembly and workpiece tracking. In the field of automatic optical inspection (AOI), the application of 3D inspection is gradually expanding, but it is worth noting that since PCB circuits and metal workpieces often have high dynamic range and high reflective properties, these unfavorable conditions seriously affect the 3D reconstruction quality of fringe projection technology.
[0004] To meet this challenge, multi-exposure technology or line laser scanning technology is currently commonly used. Multi-exposure technology projects multiple sets of fringe patterns for high-dynamic synthesis. Although it can improve the reconstruction effect, it significantly reduces the time efficiency. This is because the N-step phase shift image projected by conventional fringe projection profilometry is usually an 8-bit grayscale image, and the projection speed can generally only reach a maximum of 360 frames per second, which affects the overall efficiency.
[0005] On the other hand, line laser scanning technology utilizes spatial information by directly extracting the center of the line. Although it can complete 3D reconstruction to a certain extent, its accuracy is relatively low. In addition, this technology reconstructs one or more lines, and in order to obtain complete point cloud data, it also requires the assistance of a motion mechanism. Therefore, in terms of efficiency and accuracy, line laser scanning technology is also difficult to achieve both. Summary of the invention
[0006] The embodiments of the present invention provide a three-dimensional reconstruction method and system based on line shift coding patterns, aiming to solve the problems of low efficiency and low precision caused by multi-exposure technology or line laser scanning technology in the prior art.
[0007] In a first aspect, an embodiment of the present invention provides a three-dimensional reconstruction method based on a line shift coding pattern, comprising:
[0008] The original fringe pattern is designed by line shifting to obtain multiple coding patterns, and the multiple coding patterns and the preset Gray code pattern are used to project and collect the object to be tested, thereby obtaining multiple fringe projection images and multiple Gray code projection images respectively;
[0009] Synthesizing M phase-shifted fringe images according to the collected multiple fringe projection images, where M is an integer greater than or equal to 3;
[0010] Performing phase calculation on the M phase-shifted fringe patterns to obtain a folded phase pattern;
[0011] The folded phase image is combined with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and the object to be measured is reconstructed using the three-dimensional reconstruction principle.
[0012] Optionally, the designing of the original fringe pattern by line shifting to obtain multiple coding patterns includes:
[0013] The original fringe pattern is moved in the same direction at an interval of 1 pixel to generate N coding patterns, where the interval between two adjacent bright lines in the original fringe pattern is N-1 pixels, one bright line occupies 1 pixel in the column direction, and N is greater than 1.
[0014] Optionally, for the multiple coding patterns, the j-th coding pattern is expressed by the following formula:
[0015]
[0016] Wherein, j=1, 2, ..., N, u and v are the horizontal and vertical coordinates of the pixel point respectively, N is the number of steps of line shift, and % represents the remainder operation.
[0017] Optionally, synthesizing M phase-shifted fringe images according to the generated multiple fringe projection images includes:
[0018] The following formula is used to synthesize M-amplitude phase-shifted fringe patterns:
[0019]
[0020] Where N is the number of fringe projection images, I j represents the j-th fringe projection image, j = 1, 2, ..., N; I ci is the synthesized i-th phase-shifted fringe pattern, i=1,2,…,M.
[0021] Optionally, performing phase calculation on the M phase-shifted fringe patterns to obtain a folded phase pattern includes:
[0022] The phase is solved using the M-step phase shift solution formula to obtain a folded phase diagram, wherein the M-step phase shift solution formula is as follows:
[0023] in, represents the folding phase, δ i Indicates the phase shift amount corresponding to each phase shift fringe pattern,
[0024] Optionally, combining the folded phase image with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image includes:
[0025] Binarizing the Gray code projection image and reading the Gray code of each pixel;
[0026] Convert the Gray code into a decimal value to obtain the level of each pixel;
[0027] The folded phase image and the order after Gray code decoding are combined to perform a phase unwrapping operation to obtain an unwrapped phase image.
[0028] Optionally, binarizing the Gray code pattern includes:
[0029] Respectively collecting a full black projection image and a full white projection image of a full black pattern and a full white pattern projected onto the object to be measured;
[0030] According to the collected all-black projection image and all-white projection image, the threshold value I of each pixel point is calculated according to the following formula: threshold :
[0031]
[0032] Among them, I w Indicates the gray value corresponding to the completely black projection image, I b Indicates the gray value corresponding to the all-white projection image;
[0033] The grayscale value of each pixel is compared with the threshold, and the pixel values greater than the threshold are set to 1, and the pixel values less than the threshold are set to 0.
[0034] Optionally, the reconstruction using the three-dimensional reconstruction principle includes:
[0035] The three-dimensional reconstruction is performed using phase depth mapping to reconstruct the three-dimensional morphology of the object to be measured.
[0036] Optionally, the three-dimensional reconstruction using phase depth mapping to reconstruct the three-dimensional morphology of the object includes:
[0037] The three-dimensional reconstruction is performed according to the following formula:
[0038]
[0039] Among them, h is the height of the pixel point (x, y), C1 and C2 are the equation coefficients of the pixel point (x, y) obtained by calibration in advance, is the difference between the unfolded phase of the pixel point (x, y) and the unfolded phase of the reference plane.
[0040] In a second aspect, an embodiment of the present invention provides a three-dimensional reconstruction system based on a line shift coding pattern, comprising:
[0041] A coding pattern generating unit is used to design a plurality of coding patterns from an original fringe pattern by a line shift method, and use the plurality of coding patterns and a preset Gray code pattern to project and collect data on the object to be tested, and obtain a plurality of fringe projection images and a plurality of Gray code projection images respectively;
[0042] A phase-shift fringe pattern generating unit, configured to synthesize M phase-shift fringe patterns according to the collected multiple fringe projection patterns, wherein M is an integer greater than or equal to 3;
[0043] A folded phase diagram generating unit is used to perform phase calculation on the M-amplitude phase-shifted fringe diagrams to obtain a folded phase diagram;
[0044] The three-dimensional reconstruction unit is used to combine the folded phase image with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and reconstruct the object to be measured using the three-dimensional reconstruction principle.
[0045] The embodiment of the present invention discloses a three-dimensional reconstruction method and system based on line-shifted coding patterns, the method comprising: designing an original fringe pattern by line shifting to obtain multiple coding patterns, and using the multiple coding patterns and a preset Gray code pattern to project and collect the object to be measured, respectively obtaining multiple fringe projection images and multiple Gray code projection images; synthesizing M phase-shifted fringe images according to the generated multiple fringe projection images; performing phase calculation on the M phase-shifted fringe images to obtain a folded phase image; combining the folded phase image with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and reconstructing the object to be measured using the three-dimensional reconstruction principle. The embodiment of the present invention achieves high reconstruction accuracy by first synthesizing multiple coding patterns and then performing phase calculation on the M phase-shifted fringe images, and thus using the phase to perform three-dimensional reconstruction on the object to be measured. It has high robustness and has good application effects in high dynamic range scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0047] Figure 1 A schematic flow chart of a three-dimensional reconstruction method based on line-shift coding patterns provided by an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of a first coding pattern designed according to an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of a synthesized phase-shift fringe pattern provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of a folded phase image calculated according to an embodiment of the present invention;
[0051] Figure 5 Schematic diagram of 7 Gray code images provided by an embodiment of the present invention;
[0052] Figure 6 A schematic diagram of a sub-process of a three-dimensional reconstruction method based on a line-shift coding pattern provided by an embodiment of the present invention;
[0053] Figure 7 A schematic diagram of an unfolded phase image provided by an embodiment of the present invention;
[0054] Figure 8 A schematic diagram of another sub-process of a three-dimensional reconstruction method based on a line-shift coding pattern provided by an embodiment of the present invention;
[0055] Fig. 9 A schematic block diagram of a three-dimensional reconstruction system based on line-shift coding patterns provided by an embodiment of the present invention;
[0056] Fig.10 A schematic block diagram of subunits of a three-dimensional reconstruction system based on line-shift coding patterns provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0059] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0060] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0061] See also Figure 1 , Figure 1 A schematic flow chart of a three-dimensional reconstruction method based on a line shift coding pattern provided in an embodiment of the present invention, the method comprising steps S101 to S104:
[0062] S101, designing a plurality of coding patterns by a line shifting method on an original fringe pattern, and using the plurality of coding patterns and a preset Gray code pattern to project and collect data on an object to be tested, to obtain a plurality of fringe projection images and a plurality of Gray code projection images, respectively;
[0063] In this embodiment, the line shift method is a method of generating different coding patterns by changing the position, direction or phase of the stripes. The stripes can move along a certain direction (such as horizontally or vertically) or change their phase (i.e. the starting position of the stripes).
[0064] Through the line shifting method, multiple patterns with different coded information can be designed. When these patterns are projected onto the object to be tested, they will produce different deformations due to the differences in the shapes of the surface of the object to be tested. In other words, when the designed multiple coded patterns are projected onto the object to be tested in sequence, each pattern will produce a specific deformation due to the shape of the object surface.
[0065] Gray code patterns are a type of coding used to determine pixel locations, which can help distinguish between different areas or pixels. Use a camera or other imaging device to capture multiple fringe projections projected onto an object. These images will contain information about the shape of the object's surface. Similarly, capture multiple Gray code projections projected onto an object, and these images will be used to determine the absolute position of each pixel.
[0066] In one embodiment, in step S101, the designing of the original fringe pattern by line shifting to obtain multiple coding patterns includes step S201:
[0067] S201. Move the original fringe pattern in the same direction in sequence at an interval of 1 pixel to generate N coded patterns, wherein the interval between two adjacent bright lines in the original fringe pattern is N-1 pixels, one bright line occupies 1 pixel in the column direction, and N is greater than 1.
[0068] In a specific embodiment, taking 20-step line shift as an example, the line interval of each coding pattern is 19 pixels (the period is 20 pixels). The first coding pattern (i.e., the original fringe pattern) is designed as follows: Figure 2 As shown in the figure, the first column of pixels is set to 1, each bright line occupies 1 pixel in the column direction, and 20 coded patterns are obtained. The subsequent coded patterns are each bright line moved backward by 1 pixel. It should be noted that the number of pixels occupied by the bright line and the number of pixels moved backward can be adjusted according to the actual situation.
[0069] Further, in one embodiment, for the multiple coding patterns, the j-th coding pattern is expressed by the following formula:
[0070]
[0071] Wherein, j=1, 2, ..., N, u and v are the horizontal and vertical coordinates of the pixel point respectively, N is the number of steps of line shift, and % represents the remainder operation.
[0072] S102, synthesizing M phase-shifted fringe images according to the collected multiple fringe projection images, where M is an integer greater than or equal to 3;
[0073] In this embodiment, the phase-shifted fringe pattern is synthesized. According to the multiple fringe projection patterns obtained in the above step S101, these fringe projection patterns are usually sine or cosine waveforms, and the phase difference between each pattern is known. By projecting them onto the surface of the object to be measured by a projector, a series of images containing the surface height information of the object to be measured can be obtained. These images (i.e., the multiple fringe projection patterns) are then synthesized into M phase-shifted fringes, and each phase-shifted fringe pattern represents the fringes on the surface of the object at different phases.
[0074] It should be explained that the phase shift method requires that the phase solution must be greater than or equal to 3 steps, because there are three unknowns in the phase solution equation, so 3 equations are required, and therefore at least 3 phase shift fringe patterns are required to perform phase solution, so here M is an integer greater than or equal to 3. The specific phase solution process is described in the following embodiments and will not be described in detail here.
[0075] In one embodiment, the step S102 includes step S301:
[0076] S301, synthesize M-amplitude phase-shift fringe patterns using the following formula:
[0077]
[0078] Where N is the number of fringe projection images, I j represents the j-th fringe projection image, j = 1, 2, ..., N; I ci is the synthesized i-th phase-shifted fringe pattern, i=1,2,…,M;
[0079] In this embodiment, taking the synthesis of M=20-step phase-shift fringe patterns as an example, the above formula is used for synthesis to obtain a total of M phase-shift fringe patterns, such as Figure 3 Shown is a synthesized phase-shifted fringe pattern.
[0080] S103, performing phase calculation on the M-amplitude phase-shifted fringe patterns to obtain a folded phase pattern;
[0081] In this embodiment, the goal of phase resolution is to extract the phase information of the surface of the object to be measured from the collected M phase-shifted fringe patterns. These phase information reflects the phase change caused by the reflection of light on the surface of the object, which is directly related to the shape of the surface of the object. Phase resolution mainly uses multiple fringe patterns with different phase shifts to calculate the phase value of each pixel. These phase values form a phase map, in which the phase value of each pixel represents the height or shape change of the point relative to the reference plane.
[0082] In one embodiment, the step S103 includes step S401:
[0083] S401, performing phase calculation using an M-step phase shift calculation formula to obtain a folded phase diagram, wherein the M-step phase shift calculation formula is as follows:
[0084] in, represents the folding phase value, δ i Indicates the phase shift amount corresponding to each phase shift fringe pattern,
[0085] In this embodiment, if Figure 4 The figure shows a folded phase diagram obtained by the solution. It should be noted that since the above formula is an inverse tangent operation, the calculated phase is truncated between [-π, π], so the phase obtained by the above formula is called a folded phase.
[0086] S104, combining the folded phase image with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and reconstructing the object to be measured using a three-dimensional reconstruction principle.
[0087] In this embodiment, the purpose of phase unwrapping (or phase unwrapping) is to eliminate the folding phenomenon of the phase value in the folded phase image and obtain a continuous phase image. This is because during the phase measurement process, due to the periodicity of the phase value (usually an integer multiple of 2π), the phase value in the folded phase image may suddenly jump in some areas.
[0088] In structured light 3D vision, Gray code has only one bit difference between adjacent code values, and at most one bit error is generated. Therefore, it has the advantages of strong anti-interference ability, simple coding, and large range. It is often used as a coding to assist phase unfolding. Simply put, Gray code roughly divides the entire horizontal pixel interval into multiple sub-regions (regions represent levels), and then uses phase shifting technology to subdivide the sub-regions into individual pixel units. The folded phase map is combined with the corresponding Gray code projection map (multiple Gray code projection maps) for phase unfolding. The Gray code projection map provides additional spatial information, which can help determine the correct order of phase values in the continuous change process. By comparing the folded phase map and the Gray code projection map, the jump point of the phase value can be identified, and the phase value can be corrected accordingly to obtain a continuous phase map.
[0089] In a specific embodiment, taking 7 Gray code projection images as an example, the 2nd to 7th Gray codes can divide the horizontal pixels into 64 pixel intervals (n is the number of Gray code bits, which can be divided into intervals). The first Gray code is added mainly to prevent boundary level errors, also known as complementary Gray code. Figure 5 In the Gray code encoding, each pixel is encoded, and each picture represents a certain bit of the Gray code. Figure 5 A set of coding values can be obtained from the 2nd to 7th images in the figure. Taking a certain pixel as an example, black represents 0 and white represents 1. If the code of the point is 000001, it means that the color of the point in the first 5 images is black, representing 0, and the 6th is white, representing 1. Then the 000001 code is converted to a decimal value of 1, which means that the level of the point is 1. In order to prevent the error of level expansion from the π to -π boundary jump, the first Gray code and the 2nd to 7th Gray code images are added to recalculate another set of coding values. The combination of the two finally obtains the expansion level of the point as k, and the expansion phase of the point is: Among them, k is the level, is the folded phase value required above.
[0090] In one embodiment, if Figure 6 As shown, in the step S104, the folded phase image is combined with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, including steps S501 to S503:
[0091] S501, performing a binarization operation on the Gray code projection image, and reading the Gray code of each pixel;
[0092] S502, converting the Gray code into a decimal value to obtain the level of each pixel;
[0093] S503 , performing a phase unwrapping operation on the folded phase image and the order after Gray code decoding to obtain an unwrapped phase image.
[0094] In this embodiment, in order to further obtain a good three-dimensional reconstruction result, the Gray code projection image captured by the camera can be accurately binarized, that is, the grayscale image is converted into a binary image, so that the Gray code encoding of each pixel can be read out, so that each pixel in the camera image can be correctly decoded. After completing the binarization operation of the Gray code projection image, the Gray code encoding is converted into a decimal value, and the complementary Gray code is used to calculate the final order of each pixel, and the value of the folded phase is added to complete the phase unfolding operation. In summary, the phase shift method described above is to calculate the main value of the phase, and the Gray code is decoded (the Gray code value is converted to a decimal value) as the order of phase unfolding. As Figure 7 The figure shows an unfolded phase image obtained by combining the above-mentioned folded phase image with a plurality of Gray code projection images for phase unfolding.
[0095] In one embodiment, if Figure 8 As shown, the step S501 includes steps S601 to S603:
[0096] S601, respectively collecting a full black projection image and a full white projection image of a full black pattern and a full white pattern projected onto the object to be measured;
[0097] S602: According to the collected all-black projection image and all-white projection image, the threshold value I of each pixel is calculated according to the following formula: threshold :
[0098]
[0099] Among them, I w Indicates the gray value corresponding to the completely black projection image, I b Indicates the gray value corresponding to the all-white projection image;
[0100] S603: Compare the grayscale value of each pixel with the threshold, and set the pixel value greater than the threshold to 1, and set the pixel value less than the threshold to 0.
[0101] There are many common binarization operations. In this embodiment, two additional images (all black and all white images) are projected, and then the threshold of each pixel is obtained by collecting the pattern images under these two projections. The formula in step S602 determines the threshold by calculating the average grayscale value of the corresponding pixels in the all black and all white projection images. For each pixel in the image, its grayscale value is compared with the calculated threshold. If the grayscale value of the pixel is greater than the threshold, it is set to 1 (usually indicating the foreground or target object); if it is less than the threshold, it is set to 0 (usually indicating the background or non-target object).
[0102] It should be noted that the result of this process is a binary image, which contains only two pixel values (0 and 1) and is used to represent the features or shape of the surface of the object to be measured.
[0103] In one embodiment, in step S104, the reconstruction using the three-dimensional reconstruction principle includes step S701:
[0104] S701 , performing three-dimensional reconstruction using phase depth mapping to reconstruct the three-dimensional morphology of the object to be measured.
[0105] In this embodiment, after the phase information after expansion is obtained according to the method of step S103, the three-dimensional reconstruction principle can be used for reconstruction. Specifically, the three-dimensional reconstruction can be performed using phase depth mapping.
[0106] Furthermore, in one embodiment, the step S701 includes step S801:
[0107] S801, perform three-dimensional reconstruction according to the following formula:
[0108]
[0109] Among them, h is the height of the pixel point (x, y), C1 and C2 are the equation coefficients of the pixel point (x, y) obtained by calibration in advance, is the difference between the unfolded phase of the pixel point (x, y) and the unfolded phase of the reference plane.
[0110] In this embodiment, it is only necessary to first obtain the equation coefficients through the calibrated pixel points, and then obtain the difference in the unfolded phase to obtain the height information of the object to be measured, and finally reconstruct the three-dimensional shape of the object to be measured. In the above formula, calibrating the equation coefficients is to establish a phase-depth mapping relationship. Subsequently, only the phase information needs to be obtained, and then the three-dimensional shape of the object can be quickly reconstructed in combination with the phase-depth mapping relationship.
[0111] In a specific embodiment, the calibration method is: select a plane as a reference plane, project fringes to obtain the unfolded phase of the reference plane, then take a calibration plane, place it 5 mm in front of the reference plane (this distance is variable and is set according to the specific situation), then project fringes again, obtain the unfolded phase in this case, then move the calibration plane forward 5 mm again, repeat multiple times (if it is moved 10 times, it will be 50 mm in front of the reference plane at the end), and respectively obtain the difference in unfolded phase with the reference plane. That is to say, ten sets of h and h are obtained at this time. Substitute the data into the formula of step S801, and the simultaneous equations can be solved to obtain C1 and C2, and the phase-depth mapping relationship is established. When the object to be measured is to be reconstructed later, it is only necessary to place the object to be measured on the reference plane, calculate the unfolded phase of the object to be measured, and then calculate the difference between the unfolded phase of the object to be measured and the reference plane, and then combine the previously calculated phase-depth mapping relationship to calculate the height information of the object to be measured, and finally reconstruct the three-dimensional morphology of the object to be measured.
[0112] In one embodiment, the resolution of the projection on the object to be measured is 1280X720 pixels, the projection speed can reach more than 4000 frames per second, the frame rate of the three-dimensional scanning is increased by nearly 10 times, and the time efficiency is significantly improved.
[0113] like Fig. 9 As shown, an embodiment of the present invention further provides a three-dimensional reconstruction system 900 based on a line-shift coding pattern, including a coding pattern generating unit 901, a phase-shift fringe pattern generating unit 902, a folded phase pattern generating unit 903, and a three-dimensional reconstruction unit 904.
[0114] A coding pattern generating unit 901 is used to design a plurality of coding patterns from the original fringe pattern by line shifting, and use the plurality of coding patterns and a preset Gray code pattern to project and collect data on the object to be tested, and obtain a plurality of fringe projection images and a plurality of Gray code projection images respectively;
[0115] A phase-shift fringe pattern generating unit 902 is used to synthesize M phase-shift fringe patterns according to the collected multiple fringe projection patterns, where M is an integer greater than or equal to 3;
[0116] A folded phase diagram generating unit 903 is used to perform phase calculation on the M-amplitude phase-shifted fringe diagram to obtain a folded phase diagram;
[0117] The three-dimensional reconstruction unit 904 is used to combine the folded phase image with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and reconstruct the object to be measured using the three-dimensional reconstruction principle.
[0118] In one embodiment, if Fig.10 As shown, the 3D reconstruction unit 904 includes:
[0119] A binarization operation unit 1001 is used to perform a binarization operation on the Gray code projection image and read the Gray code of each pixel;
[0120] A conversion unit 1002, used to convert the Gray code into a decimal value to obtain the level of each pixel;
[0121] The phase unwrapping unit 1003 is used to combine the folded phase image and the order after Gray code decoding to perform a phase unwrapping operation to obtain an unwrapped phase image.
[0122] The three-dimensional reconstruction system based on line-shift coding patterns provided in an embodiment of the present invention achieves higher reconstruction accuracy by first synthesizing stripes of multiple coding patterns and then performing phase resolution on M phase-shifted fringe patterns, thereby utilizing the phase to perform three-dimensional reconstruction of the object to be measured. The system has high robustness and has better application effects in high dynamic range scenes.
[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, and units with the same function may be combined into one unit, for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0125] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0126] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A three-dimensional reconstruction method based on line shift coding pattern, characterized in that: include: The original fringe pattern is designed by line shifting to obtain multiple coding patterns, and the multiple coding patterns and the preset Gray code pattern are used to project and collect the object to be tested, thereby obtaining multiple fringe projection images and multiple Gray code projection images respectively; Synthesizing M phase-shifted fringe images according to the collected multiple fringe projection images, where M is an integer greater than or equal to 3; Performing phase calculation on the M phase-shifted fringe patterns to obtain a folded phase pattern; The folded phase image is combined with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and the object to be measured is reconstructed using the three-dimensional reconstruction principle.
2. The three-dimensional reconstruction method based on line shift coding pattern according to claim 1, characterized in that: The method of designing the original fringe pattern by line shifting to obtain multiple coding patterns includes: The original fringe pattern is moved in the same direction at an interval of 1 pixel to generate N coding patterns, wherein the interval between two adjacent bright lines in the original fringe pattern is N-1 pixels, a bright line occupies 1 pixel in the column direction, and N is greater than 1.
3. The three-dimensional reconstruction method based on line shift coding pattern according to claim 2, characterized in that: For the multiple coding patterns, the j-th coding pattern is expressed by the following formula: Wherein, j=1, 2, ..., N, u and v are the horizontal and vertical coordinates of the pixel point respectively, N is the number of steps of line shift, and % represents the remainder operation.
4. The three-dimensional reconstruction method based on line shift coding pattern according to claim 1, characterized in that: The step of synthesizing M phase-shifted fringe images according to the generated multiple fringe projection images comprises: The following formula is used to synthesize M-amplitude phase-shifted fringe patterns: Where N is the number of fringe projection images, j represents the jth fringe projection image, j = 1, 2, ..., N; I ci is the synthesized i-th phase-shifted fringe pattern, i=1,2,…,M.
5. The three-dimensional reconstruction method based on line shift coding pattern according to claim 4, characterized in that: The performing phase calculation on the M-amplitude phase-shifted fringe patterns to obtain a folded phase pattern comprises: The phase is solved using the M-step phase shift solution formula to obtain a folded phase diagram, wherein the M-step phase shift solution formula is as follows: in, represents the folding phase, δ i Indicates the phase shift amount corresponding to each phase shift fringe pattern, 6. The three-dimensional reconstruction method based on line shift coding pattern according to claim 1, characterized in that: The step of combining the folded phase image with the plurality of Gray code projection images to perform phase unfolding to obtain an unfolded phase image comprises: Binarizing the Gray code projection image and reading the Gray code of each pixel; Convert the Gray code into a decimal value to obtain the level of each pixel; The folded phase image and the order after Gray code decoding are combined to perform a phase unwrapping operation to obtain an unwrapped phase image.
7. The three-dimensional reconstruction method based on line shift coding pattern according to claim 6, characterized in that: The binarization of the Gray code pattern comprises: Respectively collecting a full black projection image and a full white projection image of a full black pattern and a full white pattern projected onto the object to be measured; According to the collected all-black projection image and all-white projection image, the threshold value I of each pixel point is calculated according to the following formula: threshold : Among them, I w Indicates the gray value corresponding to the completely black projection image, I b Indicates the gray value corresponding to the all-white projection image; The grayscale value of each pixel is compared with the threshold, and the pixel values greater than the threshold are set to 1, and the pixel values less than the threshold are set to 0.
8. The three-dimensional reconstruction method based on line shift coding pattern according to claim 1, characterized in that: The reconstruction using the three-dimensional reconstruction principle includes: The three-dimensional reconstruction is performed using phase depth mapping to reconstruct the three-dimensional morphology of the object to be measured.
9. The three-dimensional reconstruction method based on line shift coding pattern according to claim 8, characterized in that: The three-dimensional reconstruction using phase depth mapping to reconstruct the three-dimensional appearance of the object includes: The three-dimensional reconstruction is performed according to the following formula: Among them, h is the height of the pixel point (x, y), C1 and C2 are the equation coefficients of the pixel point (x, y) obtained by calibration in advance, is the difference between the unfolded phase of the pixel point (x, y) and the unfolded phase of the reference plane.
10. A three-dimensional reconstruction system based on line shift coding pattern, characterized in that: include: A coding pattern generating unit is used to design a plurality of coding patterns from an original fringe pattern by line shifting, and use the plurality of coding patterns and a preset Gray code pattern to project and collect data on the object to be tested, thereby obtaining a plurality of fringe projection images and a plurality of Gray code projection images respectively; A phase-shift fringe pattern generating unit, configured to synthesize M phase-shift fringe patterns according to the collected multiple fringe projection patterns, wherein M is an integer greater than or equal to 3; A folded phase diagram generating unit is used to perform phase calculation on the M-amplitude phase-shifted fringe diagrams to obtain a folded phase diagram; The three-dimensional reconstruction unit is used to combine the folded phase image with the multiple Gray code projection images to perform phase unfolding to obtain an unfolded phase image, and reconstruct the object to be measured using the three-dimensional reconstruction principle.
Citation Information
Patent Citations
Structured light 3-dimensional measurement device and measurement method thereof
CN103033147A
Planarity measuring method and device
CN108253909A
Rapid three-dimensional measurement method based on sine fringe and multi-gray-level fringe projection
CN113155056A
Phase shift three-dimensional measurement method based on gray scale multiplexing Gray code
CN115451860A
Phase height mapping-based structured light three-dimensional reconstruction method, device and equipment for reference phase plane correction and medium
CN118429543A
Cited By
Phase solving method based on sequence pixel extreme value positioning
CN121297721A
A phase solving method based on sequence pixel extreme value positioning
CN121297721B
Binary fringe phase encoding and decoding method, device, equipment and medium
CN122066794A
Three-dimensional reconstruction method suitable for high dynamic range surface
CN122415913A
A three-dimensional reconstruction method suitable for high dynamic range surfaces
CN122415913B