Three-dimensional imaging method, device, computer equipment and computer readable storage medium

By generating structured light patterns with sparse coding lines and dense projection lines, and combining digital image processing and system parameters, the problems of insufficient point cloud density and decoding stability in existing technologies are solved, and efficient 3D information reconstruction is achieved.

CN115752291BActive Publication Date: 2026-04-14SHENZHEN INSTITUTE OF INFORMATION TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN INSTITUTE OF INFORMATION TECHNOLOGY
Filing Date
2022-11-15
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing structured light coding schemes have shortcomings in reconstructing point cloud density and decoding stability, especially in 3D scenes with large surface undulations where decoding fails or is inefficient.

Method used

The structured light pattern generated at a preset period includes sparse coded lines and dense projection lines. The pattern is projected by a projection device and acquired by a collection device. The matching relationship and system parameters are determined by digital image processing algorithms to achieve three-dimensional information reconstruction.

Benefits of technology

It improves the decoding stability and efficiency of structured light coding, and can accurately reconstruct 3D point clouds, taking into account both the coding sequence length and decoding accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115752291B_ABST
    Figure CN115752291B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a three-dimensional imaging method, a three-dimensional imaging device, computer equipment and a computer readable storage medium. The method comprises the following steps: generating a first structured light pattern according to an encoding rule, and projecting the first structured light pattern on the surface of an object to be measured by a projection device according to a preset period to form a second structured light pattern; the structured light pattern comprises an encoding line and a projection line; acquiring the second structured light pattern collected by a collection device; decoding the second structured light pattern according to a decoding rule to determine the matching relationship between the first structured light pattern and the second structured light pattern; acquiring system parameters obtained in a system calibration process of an imaging system, and obtaining three-dimensional information of the object to be measured according to the matching relationship and the system parameters. Therefore, the present application can determine the matching relationship between the first structured light pattern and the second structured light pattern through the preset encoding rule and decoding rule, thereby realizing a three-dimensional restoration technical solution, taking into account the length of the structured light encoding sequence and the decoding stability, and more efficiently and accurately acquiring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of three-dimensional measurement technology, and in particular relates to a three-dimensional imaging method, a three-dimensional imaging device, a computer device, and a computer-readable storage medium. Background Technology

[0002] Structured light 3D imaging technology, based on binocular stereo vision, projects coded structured light onto the surface of the object being measured. Using images captured by a camera and combined with structural parameters from a stereo vision system, it calculates the 3D shape information of the object's surface. Compared to phase-coded 3D reconstruction, it offers higher stripe contrast and has unique advantages in 3D reconstruction of partially reflective surfaces. Structured light coding can be divided into spatial and temporal coding methods. Common spatial coding schemes include De-Bruijn sequence coding rules and RGB color line coding schemes; common temporal coding schemes include Gray code coding schemes and stripe boundary coding.

[0003] However, the above-mentioned common encoding schemes all have their own drawbacks. For example, spatial encoding utilizes image spatial neighborhood information, affecting the density of the reconstructed point cloud, and is prone to decoding failure in 3D scenes with large surface undulations. Temporal structured light encoding can avoid the influence of adverse factors such as the color and shape undulations of the measured object on the decoding, but it requires projecting multiple encoded patterns, which limits its application in high-efficiency scenarios. Therefore, how to balance accuracy and efficiency and improve the stability of structured light encoding and decoding is a technical problem that urgently needs to be solved by those skilled in the art.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention

[0005] Based on this, it is necessary to propose a three-dimensional imaging method, a three-dimensional imaging device, a computer device, and a computer-readable storage medium to address the above problems.

[0006] The technical problem solved by this application is achieved by the following technical solution:

[0007] This application provides a three-dimensional imaging method, comprising the following steps: generating a first structured light pattern according to an encoding rule, and projecting the first structured light pattern onto the surface of the object under test using a projection device at a preset period to form a second structured light pattern; the structured light pattern includes encoding lines and projection lines; acquiring the second structured light pattern acquired by an acquisition device; decoding the second structured light pattern according to a decoding rule to determine the matching relationship between the first and second structured light patterns; acquiring system parameters obtained during the imaging system calibration process, and obtaining the three-dimensional information of the object under test based on the matching relationship and the system parameters.

[0008] In an optional embodiment of this application, generating a first structured light pattern according to encoding rules includes: determining an encoding period, wherein the encoding period includes multiple projection periods, and each projection period includes two sub-periods; generating N encoding lines according to the projection period, assigning a first code value to each encoding line, and the encoding lines are spaced apart by a first distance; generating M projection lines according to the sub-periods, assigning a first encoding value to each projection line, and the projection lines within the sub-periods are independent of each other, and the projection lines are spaced apart by a second distance; wherein N and M are integers greater than zero, and N is less than M; the first distance is greater than the second distance; and summing the encoding lines of multiple projection periods and the projection lines of multiple sub-periods within one encoding period to obtain the first structured light pattern within one encoding period.

[0009] In an optional embodiment of this application, a second structured light pattern is formed by projecting a first structured light pattern onto the surface of the object under test using a projection device at a preset cycle. This includes: after the projection of N coding lines in each projection cycle is completed, controlling the projection device to move a first distance and then projecting N coding lines onto the object under test again; after the projection of M projection lines in each small cycle is completed, controlling the projection device to move a third distance and then projecting M projection lines onto the object under test again, wherein the third distance is less than the second distance.

[0010] In an optional embodiment of this application, before acquiring the second structured light pattern acquired by the acquisition device, the method further includes: calibrating the imaging range of the second structured light pattern on the object under test within a preset period using measurement spatial constraints.

[0011] In an optional embodiment of this application, decoding the second structured light pattern according to decoding rules to determine the matching relationship between the first and second structured light patterns includes: acquiring all second structured light patterns within one encoding period, arranging encoding lines according to the projection period, and arranging projection lines according to a small period; determining the code value and encoding line area range of the encoding lines within the second structured light pattern using a preset digital image processing algorithm; determining the second encoding value of all projection lines within the encoding line area range based on the correlation between the first projection line and other projection lines within the small period; and matching the first code value and the second code value, and the first encoding value and the second encoding value, respectively, to determine the matching relationship between the first and second structured light patterns.

[0012] In an optional embodiment of this application, the code value and coding line region range of the coding line within the second structured light pattern are determined by a preset digital image processing algorithm, including: determining multiple coding line region ranges and corresponding first coding lines by image subtraction, and assigning second code values ​​to all first coding lines within the coding line region range in the order of projection period.

[0013] In an optional embodiment of this application, obtaining the three-dimensional information of the object under test according to the matching relationship and system parameters includes: acquiring the first pixel position information of the first structured light pattern in the projection device and the second pixel position information of the second structured light pattern in the acquisition device; matching the first pixel position information and the second pixel position information according to the matching relationship to obtain the three-dimensional coordinates; and correcting the three-dimensional coordinates according to the system parameters to obtain the obtained three-dimensional information.

[0014] This application also provides a three-dimensional imaging device, comprising: an encoding projection module for generating a first structured light pattern according to encoding rules, and projecting the first structured light pattern onto the surface of the object under test through a projection device at a preset period to form a second structured light pattern; the structured light pattern includes encoding lines and projection lines; an acquisition module for acquiring the second structured light pattern acquired by the acquisition device; a decoding module for decoding the second structured light pattern according to decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern; and an imaging module for acquiring system parameters obtained during the imaging system calibration process, and obtaining the three-dimensional information of the object under test based on the matching relationship and the system parameters.

[0015] This application also provides a computer device including a processor and a memory: the processor is used to execute a computer program stored in the memory to implement the method as described above.

[0016] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described above.

[0017] The embodiments of this application have the following beneficial effects:

[0018] This application is capable of sequentially projecting a first structured light image generated according to a preset encoding rule onto the object under test at a preset cycle. After the first structured light image is projected onto the surface of the object under test to form a second structured light pattern, the second structured light pattern is decoded according to a preset decoding rule, thereby realizing a three-dimensional reconstruction technical solution. This solution takes into account both the length of the structured light encoding sequence and the stability of the decoding, and can complete the three-dimensional point cloud reconstruction based on the parameters of the binocular stereo vision system composed of camera and projection.

[0019] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it according to the contents of the specification, and to make the above and other objects, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit this application. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] in:

[0022] Figure 1 This is a flowchart illustrating a three-dimensional imaging method in one embodiment;

[0023] Figure 2 This is a schematic diagram illustrating an application scenario of a three-dimensional imaging method in one embodiment;

[0024] Figure 3 This is a schematic diagram of a structured light pattern in one embodiment;

[0025] Figure 4.1 This is a schematic diagram of a second structured light pattern acquired by the acquisition device in one embodiment;

[0026] Figure 4.2 This is a schematic diagram of the first coded line obtained after decoding the second structured light according to the decoding rules in one embodiment;

[0027] Figure 4.3 This is a schematic diagram of the second coded line obtained after decoding the second structured light according to the decoding rules in one embodiment;

[0028] Figure 4.4 This is a schematic diagram of the third encoding line obtained after decoding the second structured light according to the decoding rules in one embodiment;

[0029] Figure 4.5 This is a schematic diagram of the fourth coded line obtained after decoding the second structured light according to the decoding rules in one embodiment;

[0030] Figure 4.6 This is a schematic diagram of the fifth coding line obtained after decoding the second structured light according to the decoding rules in one embodiment;

[0031] Figure 5 This is a structural block diagram of a three-dimensional imaging device in one embodiment;

[0032] Figure 6 This is a structural block diagram of a computer device in one embodiment. Detailed Implementation

[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0034] Figure 1 This is a flowchart illustrating a three-dimensional imaging method in one embodiment; Figure 2 This is a schematic diagram illustrating an application scenario of a three-dimensional imaging method in one embodiment. (Refer to...) Figure 2 This 3D imaging method primarily involves a projection device projecting a structured light pattern onto the object under test; and a data acquisition device capturing the structured light pattern on the object. The structured light pattern is generated by a predetermined encoding scheme of this method. For clarity and ease of description, in this embodiment, the structured light pattern generated according to the predetermined encoding scheme and projected onto the object under test by the projection device is called the first structured light pattern; the structured light pattern formed on the object under test by the first structured light pattern and captured by the data acquisition device is called the second structured light pattern. Figure 2 As can be seen, the structured light pattern includes multiple lines because the structured light pattern generated according to the preset encoding scheme includes coded lines and projection lines: the coded lines are relatively sparse and used to assist in determining the coded values ​​of the projection lines; the projection lines are relatively dense and, combined with the code values ​​of the coded lines, are used for 3D reconstruction. Furthermore, in a preferred embodiment, the coded lines and projection lines proposed in this application are specifically formed by several adjacent straight lines. It is understood that in the projection device, each coded line or projection line has its corresponding position information and code value, used to distinguish each line. When the structured light pattern is projected onto the object being measured, the line pattern will be distorted due to the unevenness of the surface structure of the object, thus causing the second structured light pattern acquired by the acquisition device to fail to match the first structured light pattern. Determining the matching relationship between the first and second structured light patterns is the decoding process according to preset decoding rules. After determining the matching relationship between the first and second structured light patterns, the pixel correspondence between the projection lines or coded lines in the projection device and the acquisition device can be established, realizing the reconstruction of the 3D coordinates of the object being measured. As can be seen, the encoding rules and decoding rules are the key technical solutions preset in the scheme. Therefore, the three-dimensional imaging method provided in the embodiments of this application is proposed, including steps S110 to S140.

[0035] Step S110: Generate a first structured light pattern according to the encoding rules, and project the first structured light pattern onto the surface of the object to be measured through a projection device at a preset period to form a second structured light pattern; the structured light pattern includes encoding lines and projection lines.

[0036] In one embodiment, step S110: generating a first structured light pattern according to encoding rules includes: determining an encoding period, wherein the encoding period includes multiple projection periods, and each projection period includes two sub-periods; generating N encoding lines according to the projection period, assigning a first code value to each encoding line, and the encoding lines are spaced apart by a first distance; generating M projection lines according to the sub-periods, assigning a first encoding value to each projection line, and the projection lines within the sub-periods are independent of each other, and the projection lines are spaced apart by a second distance; wherein N and M are integers greater than zero, and N is less than M; the first distance is greater than the second distance; and summing the encoding lines of multiple projection periods and the projection lines of multiple sub-periods within one encoding period to obtain the first structured light pattern within one encoding period.

[0037] In one embodiment, for ease of understanding, please refer to Figure 3 , Figure 3 This is a schematic diagram of a structured light pattern in one embodiment. The generation rule for the first structured light pattern is based on an encoding rule. In the preset encoding rule, the first step is to determine each period. This involves identifying the encoding period, which can be subdivided into several projection periods based on actual conditions, such as the size of the projected object. Each projection period includes two smaller periods. This setup ensures that the projected lines are unique within each smaller period, thereby enabling the encoding of all lines in the structured light pattern and guaranteeing correct decoding. (Reference) Figure 3 In a preferred embodiment of the present invention, it can be composed of 3 coded patterns ( Figure 3 (T1-T3) and 4 projected patterns ( Figure 3 The coding sequence is composed of three coding diagrams (T4-T7), from which the code values ​​of the five coding lines in each coding period can be obtained. Specifically, T1-T3 represent different periods: for example, T1-T3 represent the projection period of the coding lines; T4-T7 represent the smaller periods of the projection lines. Therefore, according to... Figure 3The relationship between the projection period and the small period shown is that one encoding period includes five projection periods. In this application, N can be 3 and M can be 10, meaning that one encoded line image includes 3 encoded lines and one projection line image includes 10 projection lines. It can be understood that the pattern formed by all encoded lines within one projection period is the encoded line pattern; the pattern formed by all projection lines within one small period is also the projection line pattern. Specifically, the generation details of the first structured light pattern in this embodiment are as follows: the encoded line pattern consists of three encoded lines spaced 40 pixels apart, arranged in the pattern "1, 1, 1, 0, 0"; the projection line pattern consists of ten projection lines spaced 20 pixels apart. Further, the encoded line images can form three encoded line patterns, T1, T2, and T3, where the difference between T1, T2, and T3 is that each encoded line moves 40 pixels in a cycle each time to form the next encoded line image. Further, the encoded line image can also consist of only one T1. Then, four projection line patterns T4-T7 are formed by 10 projection lines spaced 20 pixels apart. Similarly, a single projection line image consisting of 10 projection lines, as shown in T4, can also be used. That is, in this embodiment, the first distance is 40 pixels, and the second distance is 20 pixels. In this embodiment, the focus is on the relationship between the number of encoded lines and the number of projection lines in the first structured light image generated according to the encoding rules, rather than the quantity of encoded line images or projection line images. The difference between the two can be eliminated by adjusting the projection method during the projection process, which will be detailed later and will not be elaborated here. Furthermore, for ease of understanding, in Figure 3 In this process, all coding lines in a projection period are assigned a first code value. All projection lines are assigned a first code value. A projection period consists of coding lines with code values ​​of 1-5. Each coding line repeats this period to complete the entire encoding. Two adjacent coding lines constitute a projection period. For example, coding lines with code values ​​of 1-2 constitute a projection period in the encoding period.

[0038] In one embodiment, step S110: the projection device projects the first structured light pattern onto the surface of the object under test to form the second structured light pattern according to a preset cycle, including: after the projection of N coding lines in each projection cycle is completed, the projection device is controlled to move a first distance and then project N coding lines onto the object under test again; after the projection of M projection lines in each small cycle is completed, the projection device is controlled to move a third distance and then project M projection lines onto the object under test again, the third distance being less than the second distance.

[0039] In one embodiment, after generating the first structured light pattern, projection can be performed according to a preset projection method. The projection order of the encoding lines or structure lines in the first structured light pattern does not affect subsequent decoding; therefore, the projection order is not limited. It is important to note the projection changes between different cycles. In one embodiment of this application, as mentioned above, multiple encoding line patterns or projection line patterns can be pre-generated. These multiple generated encoding line patterns or projection line patterns can then be projected onto the object under test sequentially. The projection process involves projecting one pattern per projection cycle, and then projecting the next pattern in the next projection cycle, thus completing one encoding cycle. In another embodiment, only one projection line pattern and / or one encoding line pattern can be generated. During the projection process, the structured light image can be moved in a manner similar to the encoding rule generation method. For example, similarly... Figure 3 For example, assuming there is only one coded line pattern (T1), it can be moved during the projection process. To achieve the effect of T2 with T1, that is, after projecting the three coded lines in one projection cycle, the projection device is moved 40 pixels and then the three coded lines are projected onto the object being measured again. Alternatively, during projection, T1 can be projected 40 pixels in a predetermined direction, so that the first coded line in the second coded line pattern can be aligned with the second coded line in the first coded line image. For the projection lines, the projection method is the same as for the coded lines. If there are multiple images, they are projected sequentially according to the generation order generated by the coding rules and in small cycles. If there is only one image, after the projection of each small cycle is completed, it is moved a third distance before being projected in the next small cycle. For specific implementation methods, please refer to the description of the coded line projection method above, which will not be repeated here. It is also worth noting that the projection lines are used to reconstruct the three-dimensional information of the projection lines. That is, the smaller the third distance moved, the denser the point cloud information obtained in the final reconstruction, and the more accurate the reconstructed model. Therefore, in a preferred embodiment, the third distance for moving the encoding line is 1 pixel; at the same time, in order to ensure the uniqueness of the projection line within a small period, the third distance should be smaller than the second distance, which satisfies the requirement of a denser point cloud and avoids the technical problem of projection lines repeating within a small period, so as to accurately restore the three-dimensional information of the measured object and ensure the accuracy of the decoding process.

[0040] Step S120: Acquire the second structured light pattern acquired by the acquisition device.

[0041] In one embodiment, before step S120: acquiring the second structured light pattern acquired by the acquisition device, the method further includes: calibrating the imaging range of the second structured light pattern on the object under test within a preset period using measurement spatial constraints.

[0042] In one embodiment, to ensure the uniqueness of the encoded lines within the encoding period, it is necessary to utilize measurement space constraints to pre-calibrate the area range of each encoded line on the imaging surface of the acquisition device during the projection period, so as to ensure that the encoded line area ranges acquired by the acquisition device do not overlap. Furthermore, during the acquisition of the second structured light pattern, the acquisition device also needs to correspond to each period determined by the encoding rules; that is, for example, within one encoding period, multiple encoded lines are acquired according to the frequency corresponding to the projection period, and multiple projection lines are acquired according to the frequency corresponding to the smaller period, etc.

[0043] Step S130: Decode the second structured light pattern according to the decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern.

[0044] In one embodiment, step S130: decoding the second structured light pattern according to the decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern includes: acquiring all second structured light patterns within one encoding period, arranging the encoding lines according to the projection period, and arranging the projection lines according to the small period; determining the code value and encoding line area range of the encoding lines within the second structured light pattern through a preset digital image processing algorithm; determining the second encoding value of all projection lines within the encoding line area range according to the correlation between the first projection line and other projection lines within the small period; and matching the first code value and the second code value, and the first encoding value and the second encoding value respectively to determine the matching relationship between the first structured light pattern and the second structured light pattern.

[0045] In one embodiment, the code value and coding line region range of the coding line within the second structured light pattern are determined by a preset digital image processing algorithm, including: determining multiple coding line region ranges and corresponding first coding lines by image subtraction, and assigning second code values ​​to all first coding lines within the coding line region range in the order of projection period.

[0046] In one embodiment, the process of decoding the second structured light pattern according to the decoding rules is also the process of determining the matching relationship between the first and second structured light patterns. For ease of understanding, let's first... Figure 3 The provided structured light pattern diagram is used as an example, and references are also provided. Figures 4.1 to 4.6 .in, Figure 4.1 This is a schematic diagram of the second structured light pattern acquired by the acquisition device. Figure 4.1The diagram shows a schematic of the coded line pattern. One coding cycle includes five projection cycles, with the coded lines displayed as "1, 1, 1, 0, 0". Correspondingly, three second structured light patterns, I1, I2, and I3, are obtained, with each projection cycle containing five coded lines. In this embodiment, the range of multiple coded line regions and the corresponding first coded lines are preferably determined by image subtraction. It should be noted that in this discussion of image subtraction, differences less than 0 are assigned a value of 0. For example, taking the first coded line as uniquely obtained by subtracting the first image from the second image, the coded line in I1 corresponds to T1, which is "1, 1, 1, 0, 0"; the corresponding coded line in I2 corresponds to T2, and because it has been shifted, it is "0, 1, 1, 1, 0". Subtracting I2 from I1 yields "1, 0, 0, -1, 0", where values ​​less than 0 are assigned the value 0. Therefore, the final result is "1, 0, 0, 0, 0". Since the first value is 1 and the rest are 0, it can be determined that the projection line image obtained by subtracting (I1-I2) from the first image and the second image represents the region corresponding to the first coded line in the coded line pattern. The resulting image of the first coded line can be referenced. Figure 4.2 , Figure 4.2 This is a schematic diagram of the first coded line obtained after decoding the second structured light according to the decoding rules in one embodiment. The first coded line can be assigned a second code value of 5×i+1, where i is the current encoding period. The encoding period can be determined during the measurement of spatial constraints. Similarly, the second coded line is uniquely obtained by subtracting (I2-I3) from the second and third images. The resulting image of the second coded line can be referenced. Figure 4.3 , Figure 4.3 This is a schematic diagram of the second coded line obtained after decoding the second structured light according to the decoding rules in one embodiment, and the second code value is assigned to 5×i+2; the fourth coded line is uniquely obtained by subtracting (I2-I1) from the second image and the first image. The resulting image of the fourth coded line can be referenced. Figure 4.5 , Figure 4.5 This is a schematic diagram of the fourth coded line obtained after decoding the second structured light according to the decoding rules in one embodiment, and the second code value 5×i+4 is assigned to it; the fifth coded line is uniquely obtained by subtracting the second image (I3-I2) from the third image, and the resulting image of the fifth coded line can be referenced. Figure 4.6 , Figure 4.6This is a schematic diagram of the fifth coded line obtained after decoding the second structured light according to the decoding rules in one embodiment, and assigned a second code value of 5×i+5. Furthermore, for the third coded line that cannot be obtained through image subtraction, after obtaining the above encoding, the remaining coded lines with a code value of 5×i+3 all exist in the coded image. In the second image, two auxiliary lines with codes of 5×i+2 and 5×i+4 are used to constrain its imaging range in the acquisition device. The pattern of the coded line that cannot be obtained through image subtraction in the middle is determined by using two adjacent images. The resulting image of the third coded line can be referenced. Figure 4.2 , Figure 4.2 This is a schematic diagram of the first coded line obtained after decoding the third structured light according to the decoding rules in one embodiment, to improve the stability of decoding. After all coded lines are located, the acquisition device acquires projection line images I4-I7 (not shown in the attached diagram), corresponding to projection patterns T4-T7 respectively. According to the encoding rules, half of the projection lines in I4 coincide with the center position of the coded lines, and their encoding can be obtained based on the coded line results; for the other half, between two known coded lines, their second coded values ​​are obtained according to this design principle. In I4, each bright line is both a projection line used for 3D reconstruction and a coded line, with a small period determined by two adjacent lines, such as the first small period determined between the first and second lines. T5, T6, and T7 are constructed by moving the bright lines of T4 sequentially by 1 / 4, 1 / 2, and 3 / 4 small periods, respectively. Therefore, the second coded values ​​of the projection lines in I5, I6, and I7 are determined by their small periods in the first projection line image I4. Furthermore, as described above, when generating coded lines and projection lines according to the encoding rules, each coded line has already been assigned a corresponding first code value, and each projection line has been assigned a corresponding first encoded value. In this application, the second code value of each coded line and the second encoded value of each projection line in the second structured light image can be determined according to the decoding rules. It is understood that by determining the matching relationship between the first code value and the second code value, and the matching relationship between the first encoded value and the second encoded value, the matching relationship between the first structured light pattern and the second structured light pattern can ultimately be determined.

[0047] Step S140: Obtain the system parameters obtained during the imaging system calibration process, and obtain the three-dimensional information of the object under test based on the matching relationship and the system parameters.

[0048] In one embodiment, step S140: obtaining the three-dimensional information of the object under test according to the matching relationship and system parameters includes: acquiring the first pixel position information of the first structured light pattern in the projection device and the second pixel position information of the second structured light pattern in the acquisition device; matching the first pixel position information and the second pixel position information according to the matching relationship to obtain the three-dimensional coordinates; and correcting the three-dimensional coordinates according to the system parameters to obtain the obtained three-dimensional information.

[0049] In one embodiment, after determining the matching relationship between the first structured light pattern and the second structured light pattern, the first pixel position information and the second pixel position information of the second structured light pattern in the acquisition device can be matched based on the first pixel position information of the first structured light pattern in the projection device and the second pixel position information of the second structured light pattern in the acquisition device, thereby obtaining the three-dimensional coordinates of the object under test. These three-dimensional coordinates are not accurate relative to world coordinates. Therefore, to eliminate potential error effects, system parameters determined during system calibration can be obtained, and the three-dimensional coordinates can be corrected using these system parameters to obtain the three-dimensional information of the object under test.

[0050] Therefore, this application can sequentially project a first structured light image generated according to a preset encoding rule onto the object under test according to a preset cycle, control the acquisition device to acquire the first structured light image and project it onto the surface of the object under test to form a second structured light pattern, and then decode the second structured light pattern through a preset decoding rule to achieve a three-dimensional reconstruction technical solution. This solution takes into account both the length of the structured light encoding sequence and the stability of the decoding, and can complete the three-dimensional point cloud reconstruction based on the parameters of the binocular stereo vision system composed of camera and projection.

[0051] Figure 5 A structural block diagram of a three-dimensional imaging device in one embodiment is shown. The three-dimensional imaging device 50 includes: an encoding projection module 51, used to generate a first structured light pattern according to encoding rules, and project the first structured light pattern onto the surface of the object under test through a projection device at a preset period to form a second structured light pattern; the structured light pattern includes encoding lines and projection lines; an acquisition module 52, used to acquire the second structured light pattern acquired by the acquisition device; a decoding module 53, used to decode the second structured light pattern according to decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern; and an imaging module 54, used to acquire system parameters obtained during the imaging system calibration process, and obtain the three-dimensional information of the object under test based on the matching relationship and the system parameters.

[0052] Figure 6 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. Figure 6As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a three-dimensional imaging method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement an age recognition method. Those skilled in the art will understand that... Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0053] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the following steps: Step S110: Generate a first structured light pattern according to an encoding rule, and project the first structured light pattern onto the surface of the object under test using a projection device at a preset period to form a second structured light pattern; the structured light pattern includes encoding lines and projection lines; Step S120: Acquire the second structured light pattern acquired by the acquisition device; Step S130: Decode the second structured light pattern according to a decoding rule to determine the matching relationship between the first and second structured light patterns; Step S140: Acquire system parameters obtained during the imaging system calibration process, and obtain the three-dimensional information of the object under test based on the matching relationship and the system parameters.

[0054] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the steps of the three-dimensional imaging method as described in Embodiment 1.

[0055] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0056] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above 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.

[0057] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A three-dimensional imaging method, characterized in that, Includes the following steps: A first structured light pattern is generated according to the encoding rules, and the first structured light pattern is projected onto the surface of the object under test by a projection device at a preset period to form a second structured light pattern; the structured light pattern includes encoding lines and projection lines. Acquire the second structured light pattern captured by the acquisition device; The second structured light pattern is decoded according to the decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern; The system parameters obtained during the imaging system calibration process are acquired, and the three-dimensional information of the object under test is obtained based on the matching relationship and the system parameters. The step of generating the first structured light pattern according to the encoding rules includes: The encoding period is determined, wherein the encoding period includes multiple projection periods, and each projection period includes two sub-periods; N coding lines are generated according to the projection period, and a first code value is assigned to each coding line, with a first distance between each pair of coding lines; M projection lines are generated according to the small period, and each projection line is assigned a first encoding value. The projection lines are independent of each other within the small period, and the projection lines are separated by a second distance. Wherein, N and M are integers greater than zero, and N is less than M. The first distance is greater than the second distance. The encoding lines of multiple projection cycles within one encoding cycle and the projection lines of multiple small cycles are combined to obtain the first structured light pattern within one encoding cycle. The step of decoding the second structured light pattern according to the decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern includes: Obtain all the second structured light patterns within one encoding period, and arrange the encoding lines according to the projection period, and arrange the projection lines according to the small period; The code value and encoding line region range of the encoding line within the second structured light pattern are determined by a preset digital image processing algorithm. Based on the correlation between the first projection line and other projection lines within the small period, determine the second encoding value of all projection lines within the encoding line area; The first code value and the second code value, the first encoded value and the second encoded value are matched respectively to determine the matching relationship between the first structured light pattern and the second structured light pattern; The step of determining the code value and encoding line region range of the encoding line within the second structured light pattern using a preset digital image processing algorithm includes: The range of multiple coding line regions and the corresponding first coding lines are determined by image subtraction, and the second code value is assigned to all the first coding lines within the range of the coding line regions in the order of the projection period.

2. The three-dimensional imaging method as described in claim 1, characterized in that, The step of projecting the first structured light pattern onto the surface of the object under test using a projection device at a preset period to form a second structured light pattern includes: After the projection of N coded lines in each projection cycle is completed, the projection device is controlled to move the first distance and then project N coded lines onto the object under test again. After each small cycle of M projection lines is completed, the projection device is controlled to move a third distance and then project M more projection lines onto the object being measured. The third distance is less than the second distance.

3. The three-dimensional imaging method as described in claim 1, characterized in that, Before acquiring the second structured light pattern acquired by the acquisition device, the method further includes: The imaging range of the second structured light pattern on the object under test within the preset period is calibrated using measurement spatial constraints.

4. The three-dimensional imaging method as described in claim 1, characterized in that, The step of obtaining the three-dimensional information of the object under test based on the matching relationship and the system parameters includes: Acquire the first pixel position information of the first structured light pattern in the projection device and the second pixel position information of the second structured light pattern in the acquisition device; Based on the matching relationship, the first pixel position information and the second pixel position information are matched to obtain the three-dimensional coordinates; The three-dimensional coordinates are corrected according to the system parameters to obtain the three-dimensional information.

5. A three-dimensional imaging device, characterized in that, include: The encoding projection module is used to generate a first structured light pattern according to encoding rules, and to project the first structured light pattern onto the surface of the object under test through a projection device at a preset period to form a second structured light pattern. Structured light patterns include coded lines and projection lines; The acquisition module is used to acquire the second structured light pattern acquired by the acquisition device; The decoding module is used to decode the second structured light pattern according to the decoding rules to determine the matching relationship between the first structured light pattern and the second structured light pattern; The imaging module is used to acquire system parameters obtained during the imaging system calibration process, and to obtain the three-dimensional information of the object under test based on the matching relationship and the system parameters. An encoding projection module is used to determine an encoding period, wherein the encoding period includes multiple projection periods, and each projection period includes two smaller periods; N encoding lines are generated according to the projection period, each encoding line is assigned a first code value, and the encoding lines are spaced apart by a first distance; M projection lines are generated according to the smaller periods, each projection line is assigned a first code value, and the projection lines within each smaller period are independent of each other, and the projection lines are spaced apart by a second distance; wherein N and M are integers greater than zero, and N is less than M; the first distance is greater than the second distance; the encoding lines of multiple projection periods and the projection lines of multiple smaller periods within one encoding period are combined to obtain the first structured light pattern within one encoding period; A decoding module is configured to acquire all the second structured light patterns within one encoding period, arrange the encoding lines according to the projection period, and arrange the projection lines according to the small period; determine the code value and encoding line area range of the encoding lines within the second structured light pattern using a preset digital image processing algorithm; determine the second encoding value of all the projection lines within the encoding line area range based on the correlation between the first projection line and other projection lines within the small period; and match the first code value and the second code value, and the first encoding value and the second encoding value, respectively, to determine the matching relationship between the first structured light pattern and the second structured light pattern. The decoding module is used to determine the range of multiple coding line regions and the corresponding first coding lines by image subtraction, and to assign the second code value to all the first coding lines within the range of the coding line regions in the order of the projection period.

6. A computer device, characterized in that, Including processor and memory: The processor is configured to execute a computer program stored in the memory to implement the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Structure light 3D measuring technology based on edge gray code and line movement

    CN101303229A

  • Fast three-dimensional appearance measuring method and device

    CN101482398A