Three-dimensional scanning reconstruction method and system
By generating and processing high-frequency binary images and Gray code images, the incomplete image data caused by the reflective area when scanning objects is solved, and a high-precision three-dimensional reconstruction effect is achieved.
Patent Information
- Application Number
- CN202410876692.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-07-02
AI Technical Summary
In the prior art, the collected coded pattern quality is poor due to the reflective area when scanning an object, which seriously affects the decoding processing effect of the image and cannot obtain complete image data.
By generating high-frequency binary images and Gray code images, projecting and collecting images, global processing is performed to eliminate invalid areas, extracting the encoding characteristics of high-frequency binary images, calculating unique encoding values, and using structured light triangular imaging method for three-dimensional reconstruction.
Overcoming the influence of high reflection and strong scattering, acquiring a complete and high-precision image data model is realized, and the problem of not being able to obtain complete image data in the prior art is solved.
Smart Images

Figure CN118657885B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional model reconstruction of a projector, and in particular to a three-dimensional scanning reconstruction method and system. Background Art
[0002] With the development of computer technology, scanners are playing an increasingly important role in digital dental care and various types of reverse engineering. Among them, scanners based on the principle of structured light triangulation imaging technology are widely used.
[0003] Structured light triangulation imaging technology requires projecting a coding map onto the surface of the scanned object, and then collects the coding pattern on the surface of the object and decodes it to achieve three-dimensional reconstruction. Therefore, the quality of the collected coding pattern directly affects the effect of three-dimensional reconstruction. In actual work, we often encounter some reflective models that need to be scanned, and the collected coding pattern has poor quality in the high-reflective area of the model, which seriously affects the decoding effect of the image and makes it impossible to obtain complete image data. Generally, it is necessary to apply a developer to these reflective models for normal scanning, but in some usage scenarios (such as intraoral environment), it is impossible to apply a developer to the model.
[0004] Therefore, it is necessary to propose a three-dimensional reconstruction method to solve the problem of difficulty in scanning highly reflective models. Summary of the invention
[0005] The purpose of the present invention is to provide a three-dimensional scanning and reconstruction method and system to solve the problem in the prior art that when scanning an object, due to the presence of reflective areas in the scanned object, the quality of the collected coding pattern in the reflective area is poor, which seriously affects the decoding processing effect of the image and makes it impossible to obtain complete image data.
[0006] To achieve the above objectives, in a first aspect, the present invention further provides a three-dimensional scanning and reconstruction method, the method comprising:
[0007] Generate a high-frequency binary image and a Gray code image based on the size of the target image to be generated;
[0008] Controlling a projector to project the high-frequency binary image and the Gray code image onto a target object, and controlling two image collectors to synchronously collect the high-frequency binary image and the Gray code image projected by the projector;
[0009] Performing global processing on the high-frequency binary image and the Gray code image acquired by the image acquisition device to exclude invalid areas, and performing binarization processing on the Gray code image after global processing to extract coding features of the high-frequency binary image after global processing;
[0010] The unique code value of the coding feature is calculated based on the binary Gray code image, so as to perform three-dimensional reconstruction according to corresponding points of the unique code values of the left and right images using a structured light triangulation imaging method.
[0011] As a further improvement of the present invention, generating a Gray code image based on the size of the target image to be generated includes:
[0012] Based on the size of the target image to be generated, the Gray code structured light is divided into 2 N pixel area;
[0013] Each pixel area is represented by a binary sequence, and the i-th binary bit corresponds to the pixel area of the i-th image of the Gray code structured light to form N Gray code images;
[0014] Among them, the N-bit binary sequences of two adjacent areas have only one binary bit different, and the N-bit binary sequences of the first area and the last area have only one binary bit different. The binary bit of 0 represents a black area, and the binary bit of 1 represents a white area.
[0015] As a further improvement of the present invention, generating a high-frequency binary image based on the size of the target image to be generated includes:
[0016] The high-frequency binary structured light is divided into 2 corresponding to the pixel areas of N Gray code images. N pixel area;
[0017] Each pixel area of the high-frequency binary structured light is divided into q sub-areas to form n high-frequency binary images, where q is a positive even number.
[0018] As a further improvement of the present invention, if the high-frequency binary image is a black-and-white stripe image, the binary bits of the first q / 2 sub-regions of the first high-frequency binary image are the same and opposite to the binary bits of the last q / 2 sub-regions.
[0019] As a further improvement of the present invention, the binary bits of the high-frequency binary image are the binary bits of the previous high-frequency binary image adjacent to it which are shifted left by one bit.
[0020] As a further improvement of the present invention, adjacent high-frequency binary images are inverse images of each other, and the binary bits of the 2a+1th high-frequency binary image are the binary bits of the 2a-1th high-frequency binary image shifted left by one bit, a∈[1,2,…,q / 2-1].
[0021] As a further improvement of the present invention, if the high-frequency binary image is an image whose sub-region center line is a white line, then the center line of the i-th sub-region of the i-th high-frequency binary image is a white line.
[0022] As a further improvement of the present invention, the high-frequency binary image and the Gray code image acquired by the image collector are globally processed to exclude invalid areas, including:
[0023] Obtaining a pixel grayscale mean value of a black-and-white image or all high-frequency binary images, and obtaining a mask image based on comparison results of the pixel grayscale mean value with an over-dark threshold value and an over-bright threshold value;
[0024] Based on the comparison results of the high-frequency binary image and the Gray code image with the mask image, invalid areas of the high-frequency binary image and the Gray code image are eliminated.
[0025] As a further improvement of the present invention, the gray code image after global processing is binarized, including:
[0026] Comparing each Gray code image after global processing with the target image pixel by pixel;
[0027] The pixels in the Gray code image that are higher than the pixel area of the target image are recorded as black, and the pixels in the Gray code image that are not higher than the pixel area of the target image are recorded as white.
[0028] As a further improvement of the present invention, the encoding features of the high-frequency binary image after global processing are extracted, including:
[0029] If the high-frequency binary image is a black and white stripe image, the stripe boundary is extracted as a feature line and the coded pixel point is obtained based on the stripe boundary;
[0030] If the high-frequency binary image is an image in which the center line of the sub-region is a white line, the center coordinates of the white line are used as the encoding feature.
[0031] As a further improvement of the present invention, extracting the stripe boundary as a feature line includes:
[0032] Get the pixel difference between the pixel coordinates of the positive and negative black and white stripe images;
[0033] If the adjacent horizontal coordinates corresponding to the pixel differences have different signs, the boundary between the adjacent horizontal coordinates is used as the feature line, and the pixel coordinates of the positive and negative black and white stripes are used as the coded pixel points.
[0034] As a further improvement of the present invention, the unique coding value of the coding feature is calculated based on the Gray code image after binarization, including:
[0035] Based on the binary Gray code image, find the pixel area color corresponding to each coding feature to obtain the binary sequence corresponding to each coding pixel point;
[0036] Find the region number of the coded pixel based on the binary sequence corresponding to each coded pixel;
[0037] A target code value is determined based on a grayscale rising edge or a grayscale falling edge or a center line of each feature line, so as to determine a unique code value of the coding feature based on the target code value and the area number.
[0038] In a second aspect, the present invention further provides a three-dimensional scanning and reconstruction system, comprising:
[0039] An image generating unit, generating a high-frequency binary image and a Gray code image based on the size of a target image to be generated;
[0040] A control unit, used to control the projector to project the high-frequency binary image and the Gray code image onto the target object, and control the image collector to synchronously collect the high-frequency binary image and the Gray code image projected by the projector;
[0041] An image processing unit performs global processing on the high-frequency binary image and the Gray code image acquired by the image collector to exclude invalid areas, and performs binarization processing on the Gray code image after global processing, extracts the coding features of the high-frequency binary image after global processing, and calculates a unique coding value of the coding features based on the Gray code image after binarization processing;
[0042] The image reconstruction unit is used to perform three-dimensional reconstruction according to corresponding points of the unique coding values of the left and right images using a structured light triangulation imaging method.
[0043] In a third aspect, the present invention provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.
[0044] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0045] The beneficial effects of the present invention are:
[0046] The three-dimensional scanning and reconstruction method of the present invention generates a high-frequency binary image and a Gray code image according to the size of the target image to be generated, and then controls the projector to project the high-frequency binary image and the Gray code image to the target object, and controls the image collector to synchronously collect the high-frequency binary image and the Gray code image projected by the projector, and then globally processes the high-frequency binary image and the Gray code image collected by the image collector to exclude invalid areas, and binarizes the Gray code image after global processing, extracts the coding features of the high-frequency binary image after global processing, and calculates the unique coding value of the coding features according to the Gray code image after binarization processing, so as to use the structured light triangulation imaging method to perform three-dimensional reconstruction according to the corresponding points of the unique coding values of the left and right images. In this way, by using high-frequency binary stripes for structured light reconstruction, the influence of high reflection and strong scattering when scanning objects can be overcome to achieve the purpose of obtaining a complete and high-precision image data model, and solves the problem in the prior art that when scanning objects, due to the presence of reflective areas in the scanned objects, the quality of the collected coding pattern in the reflective area is poor, which seriously affects the decoding processing effect of the image and leads to the inability to obtain complete image data. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic flow chart of a three-dimensional scanning and reconstruction method according to an embodiment of the present invention;
[0048] Figure 2 A schematic flow chart of a three-dimensional scanning and reconstruction method according to another embodiment of the present invention;
[0049] Figure 3 A schematic flow chart of a three-dimensional scanning and reconstruction method according to another embodiment of the present invention;
[0050] Figure 4 A schematic coding diagram of subdivided areas of each area of a high-frequency binary image according to an embodiment of the present invention;
[0051] Figure 5 A schematic coding diagram of subdivided areas of each area of a high-frequency binary image according to another embodiment of the present invention;
[0052] Figure 6 A high-frequency binary image is a schematic coding diagram of a black-and-white alternating block image;
[0053] Figure 7 is a schematic coding diagram of an image in which a high-frequency binary image is an image in which a center line of a sub-region is a white line;
[0054] Figure 8 A schematic flow chart of a three-dimensional scanning and reconstruction method according to another embodiment of the present invention;
[0055] Fig. 9 A schematic flow chart of a three-dimensional scanning and reconstruction method according to another embodiment of the present invention;
[0056] Fig.10 A schematic flow chart of a three-dimensional scanning and reconstruction method according to another embodiment of the present invention;
[0057] Fig.11 A schematic flow chart of a three-dimensional scanning and reconstruction method according to another embodiment of the present invention;
[0058] Fig.12 Find representations for Gray code values;
[0059] Fig.13 Schematic diagram of the corresponding relationship between the complementary Gray code and the conventional Gray code;
[0060] Fig.14 C is a high-frequency binary image with alternating black and white blocks line Coding schematics;
[0061] Fig.15 C is the high-frequency binary image with bright lines line Coding diagram;
[0062] Fig.16 A schematic structural block diagram of a three-dimensional scanning and reconstruction system according to an embodiment of the present invention;
[0063] Fig.17 A topological structure diagram of a computer-readable storage medium disclosed in the present invention. DETAILED DESCRIPTION
[0064] The present invention is described in detail below in conjunction with the various embodiments shown in the accompanying drawings, but it should be noted that these embodiments are not limitations of the present invention, and any equivalent transformations or substitutions in functions, methods, or structures made by ordinary technicians in the field based on these embodiments are all within the scope of protection of the present invention.
[0065] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0066] Embodiment 1:
[0067] Figure 1 A three-dimensional scanning and reconstruction method (hereinafter referred to as the "method") is provided to solve the problem in the prior art that when scanning an object, due to the presence of a reflective area on the scanned object, the quality of the collected coding pattern in the reflective area is poor, which seriously affects the decoding processing effect of the image and makes it impossible to obtain complete image data. The method includes:
[0068] Step 101. Generate a high-frequency binary image and a Gray code image based on the size of the target image to be generated. That is, the general generated image may include N Gray code images G1 to G2. N, n high-frequency binary images I1~I n . May also include all white images I W And all black picture I B , you can add an additional Gray code image G N+1 , used to assist decoding, in some cases, the function of the black and white image can be replaced and does not need to be used.
[0069] Among them, Figure 2 As shown, the specific operation of "generating a Gray code image based on the size of the target image to be generated" in step 101 includes:
[0070] Step 201: Based on the size of the target image to be generated, divide the Gray code structured light into two N pixel area.
[0071] Step 202: Represent each pixel region with a binary sequence, and correspond the i-th binary bit to the pixel region of the i-th image of the Gray code structured light to form N Gray code images.
[0072] Among them, the N-bit binary sequences of two adjacent areas have only one binary bit different, and the N-bit binary sequences of the first area and the last area have only one binary bit different. The binary bit of 0 represents a black area, and the binary bit of 1 represents a white area.
[0073] Among them, Figure 3 As shown, the specific operation of "generating a high-frequency binary image based on the size of the target image to be generated" in step 101 includes:
[0074] Step 301: Divide the high-frequency binary structured light into 2 corresponding pixel regions of N Gray code images. N In this embodiment, the “2 corresponding to the pixel areas of the N Gray code images” N The "pixel area" is also called the "Gray code marked area".
[0075] Step 302: Divide each pixel area of the high-frequency binary structured light into q sub-areas to form n high-frequency binary images, wherein the high-frequency binary image can be a black and white stripe image or an image whose sub-area center line is a white line.
[0076] If the edge of the stripe is used as the extracted feature, the high-frequency binary structured light needs to be projected with q / 2 frames; if the edge of the stripe is used as the extracted feature and contains an inverse image, the high-frequency binary structured light needs to be projected with q frames; if the center of the stripe is used as the extracted feature, the high-frequency binary structured light needs to be projected with q frames.
[0077] If the high-frequency binary image is a black-and-white stripe image, the binary bits of the first q / 2 sub-regions of the first high-frequency binary image are the same, and opposite to the binary bits of the last q / 2 sub-regions (e.g., the first q / 2 regions are represented by 0, and the last q / 2 regions are represented by 1). In addition, in one of the schemes, the binary bits of the high-frequency binary image are the binary bits of the previous high-frequency binary image adjacent to it shifted left by one position, and the subdivision area of each region of the high-frequency binary image is as follows: Figure 4 As shown (since the high-frequency binary image in this scheme does not contain an inverse image, the number of projected images is 2 (i.e., q / 2). In another scheme, adjacent high-frequency binary images are inverse images of each other, and the binary bits of the 2a+1th high-frequency binary image are the binary bits of the 2a-1th high-frequency binary image shifted left by one bit, a is an integer, and a∈[1,2,…,q / 2-1], as Figure 5 As shown. Figure 4 and Figure 5 In the figure, the area with slash lines refers to the black area, indicating binary bit 0, and the blank area refers to the white area, indicating binary bit 1. For high-frequency binary images, the black and white stripes are the corresponding encoding diagrams. Figure 6 shown.
[0078] Take q=4 as an example, that is, each region of the high-frequency binary image is subdivided into 4 regions. If the generated image of the high-frequency binary image is a black and white stripe image with equal spacing, then in one embodiment, Figure 4 As shown, the 4-bit binary sequence in the I1 image is 0011, and the I2 image is the I1 image shifted left by one binary (the binary sequence after the left shift is 0110), and so on. In another embodiment, as Figure 5 As shown, the 4-bit binary sequence in the I1 image is 0011, and in the I3 image, the 4-bit binary sequence is 0110. I2 is the black and white reverse image of I1, and I4 is the black and white reverse image of I3.
[0079] If the high-frequency binary image is an image whose sub-region center line is a white line, then the center line of the i-th sub-region of the i-th high-frequency binary image is a white line. Figure 7 As shown, in the I1 image, the center line of the first sub-region is a white line, in the I2 image, the center line of the second sub-region is a white line, and so on.
[0080] Generate a completely black image I B And all white picture I W , mainly used to generate all the encoding Figure 2 The threshold value of each pixel required for valuing can also be used to filter out the valid pixel areas in all images to avoid operating on invalid areas. Optionally, in some embodiments, the black and white image may not be used.
[0081] Step 102. Control the projector to project the high-frequency binary image and the Gray code image onto the target object, and control two image collectors to synchronously collect the high-frequency binary image and the Gray code image projected by the projector. Specifically, store the high-frequency binary image and the Gray code image sequence diagram in the projection device. When projecting each encoded diagram, control the two cameras to synchronously collect each frame of image.
[0082] Step 103. Perform global processing on the high-frequency binary image and the Gray code image collected by the image collector to exclude invalid regions, and perform binarization processing on the globally processed Gray code image to extract the encoding features of the globally processed high-frequency binary image.
[0083] As Figure 8 shown, the specific operations of "performing global processing on the high-frequency binary image and the Gray code image collected by the image collector to exclude invalid regions" in Step 103 include:
[0084] Step 801. Obtain the pixel gray-scale mean value of the black-and-white image or all high-frequency binary images, and obtain a mask image based on the comparison results of the pixel gray-scale mean value with the over-dark threshold and the over-bright threshold respectively.
[0085] When each generated high-frequency binary image has its corresponding inverse image (i.e., the black area corresponds to the white area in the inverse image, and the white area corresponds to the black area in the inverse image), calculate the pixel average gray-scale value of all high-frequency binary images to obtain the image I corresponding to the pixel gray-scale mean value. If the generated high-frequency binary image does not generate a corresponding inverse image, a black-and-white image (all-white image I W and all-black image I B ) is needed to assist in the binarization of the Gray code structured light. Collect the all-white image I W and the all-black image I B , calculate the pixel average gray-scale value of the two images, and obtain the image I corresponding to the pixel gray-scale mean value.
[0086] Specifically, in a specific embodiment, the all-white image I W and the all-black image I B can be collected, and the pixel gray-scale mean values of the two images are calculated to obtain the image I corresponding to the pixel gray-scale mean value. Set the over-dark threshold t1 (t>0). If I(i,j)<t1, then I(i,j) is recorded as an invalid region; set the high-brightness threshold t2. If I(i,j)>t2, then I(i,j) is recorded as an invalid region. In this way, the mask image T is calculated.
[0087] In another specific embodiment, when each generated high-frequency binary image has its corresponding inverse image, that is, the black area corresponds to the white area in the inverse image, and the white area corresponds to the black area in the inverse image, then use a similar method as above (that is, calculate the all-white image I W and the all-black image I BThe average grayscale value of pixels of all high-frequency binary images is calculated by using the pixel grayscale mean of the two images to calculate the mask image T using the above method.
[0088] Step 802: Eliminate invalid areas of the high-frequency binary image and the Gray code image based on the comparison results between the high-frequency binary image and the Gray code image and the mask image, respectively.
[0089] like Fig. 9 As shown, the specific operation of "binarizing the gray code image after global processing" in step 103 includes:
[0090] Step 901: Compare each Gray code image after global processing with the target image pixel by pixel.
[0091] Step 902: Pixels in the Gray code image that are higher than the pixel area of the target image are recorded as black, and pixels in the Gray code image that are not higher than the pixel area of the target image are recorded as white.
[0092] After obtaining the image I corresponding to the pixel grayscale mean, the globally processed Gray code image G i Compare pixel by pixel with I corresponding to the pixel grayscale mean. When Gi(x,y)>I(x,y), the (x,y) pixel is recorded as a white area; when G i When (x, y)<=I(x, y), the (x, y) pixel is recorded as a black area, and the gray code pattern is binarized pixel by pixel.
[0093] The specific operation of "extracting the coding features of the high-frequency binary image after global processing" in step 103 includes:
[0094] If the high-frequency binary image is a black and white stripe image, the stripe boundary is extracted as a feature line and a coded pixel point is obtained based on the stripe boundary (the coded pixel point can be a physical pixel point or a sub-pixel point). Specifically, the coded feature can be obtained by extracting the boundary of each stripe, and using a boundary extraction algorithm such as Canny to find the sub-pixel coordinates of the boundary position.
[0095] If the high-frequency binary image is an image in which the center line of the sub-region is a white line, the center coordinates of the white line are used as the encoding feature. The center of the white line is extracted by using the grayscale centroid method, the secondary grayscale centroid method, or the light stripe based on the Hessian matrix, or the light stripe based on the direction template.
[0096] like Fig.10 As shown, extracting the stripe boundary as the feature line may specifically include:
[0097] Step 1001. Obtain the pixel difference between the pixel coordinates of the positive and negative black and white stripe images.
[0098] Step 1002: If the adjacent horizontal coordinates corresponding to the pixel differences have different signs, the boundary between the adjacent horizontal coordinates is used as the feature line, and the pixel coordinates of the positive and negative black and white stripes are used as the coded pixel points.
[0099] For each high-frequency binary image I i , projecting its corresponding black and white opposite stripe pattern I inv , the pixel difference I is obtained by subtracting the positive and negative fringe images delta =I i -I inv , to extract the stripe boundary. For an integer pixel (x, y), if I delta (x,y) and I delta If (x+1, y) have different signs, then (x, y) is considered to be an integer pixel (i.e., a physical pixel) of the feature point. If a sub-pixel point is required, the value is found to be 0 by using the interpolation method based on the points around the integer pixel.
[0100] Step 104: Calculate the unique code value of the coding feature based on the binary Gray code image, and use the structured light triangulation imaging method to perform three-dimensional reconstruction according to the corresponding points of the unique code values of the left and right images.
[0101] Among them, Fig.11 As shown, the specific operation of calculating the unique coding value of the coding feature based on the Gray code image after binarization processing includes:
[0102] Step 1101. Based on the binary-processed Gray code image, find out the pixel area color corresponding to each coding feature to obtain a binary sequence corresponding to each coding pixel point.
[0103] Specifically, for each feature point pixel (i.e., coded pixel), in the corresponding G1~G N In any image, we can find the color of the area where it is located, that is, black or white, which is represented by binary as 0 or 1. Then each feature point pixel will get an N-bit binary sequence.
[0104] Step 1102: Find the region number of each coded pixel based on the binary sequence corresponding to each coded pixel.
[0105] Use the N-bit binary sequence to find the corresponding area number through the lookup table, such as Fig.12 As shown, this number is the first code value C at the feature point Gray , if the binary sequence of a feature point is 00111, the C of this pixel can be obtained by looking up the table Gray The value is 5.
[0106] Step 1103. Determine the target code value based on the grayscale rising edge or grayscale falling edge or center line of each feature line to determine the unique coding value of the coding feature based on the target code value and the area number.
[0107] It should be noted that this embodiment actually provides a robust Gray code sequence decoding method, that is, the projection image G N+1 This pattern is called complementary Gray code by scholars, which is used to eliminate the code value ambiguity of boundary feature points, that is, the feature point is located at the boundary of the region and cannot be passed through G1~G N The specific code value is determined by the area division. At this time, this graph G N+1 The area is divided into 2 N+1 The code value of the feature point can be further determined by the area.
[0108] The complementary Gray code eliminates ambiguity principle as follows Fig.13 As shown, for a feature point, the first N frames are binarized and decoded to obtain the first code value C Gray , temporarily recorded as K1. The N+1th frame is binarized to obtain the auxiliary code C N+1 , if the feature point pixel is black, then C N+1 is 0, otherwise C N+1 is 1. As shown in formula 3:
[0109]
[0110] Among them, K2 is the complementary Gray code value. It can be seen that K1 and K2 are staggered by half a period. When the feature point is near the boundary of the stripe block in the Gray code pattern, the first code value K1 is ambiguous. Using K2 will eliminate the ambiguity. When the feature point is not near the boundary of the stripe block in the Gray code pattern, K1 is directly used as the first code value C Gray , otherwise use K2 as the second code value C Gray .
[0111] Specifically, when the coding feature extracted by step 103 is a boundary line, it is specified that i ∈(I1~I q / 2 ), the grayscale rising edge value is shown in Formula 1, and the grayscale falling edge value is shown in Formula 2.
[0112] C Line =i+offsetCode (1)
[0113] C Line =q / 2+i+offsetCode (2)
[0114] Wherein, offsetCode is the custom code value offset, which is an arbitrary integer.
[0115] like Fig.14As shown, still taking q = 4 as an example, offsetCode = 0, that is, there are 4 boundaries. It is stipulated that the grayscale rising edge C in I1 Line =1, grayscale falling edge C Line =3. It specifies the grayscale rising edge C in I2 Line =2, grayscale falling edge C Line =4. Finally, one of the values of the rising and falling edges of each grayscale can be manually selected as the target code value C Line .
[0116] The coding feature may also be a center line. In this embodiment, it is specified that i ∈(I1~I n ), the center line C Line =i+offsetCode. like Fig.15 As shown, still taking q = 4 as an example, offsetCode = 0, that is, there are 4 center lines, and the center line code value of I1 is C Line =1, the center line code value of I2 is C Line =2, and so on. Therefore, the center line code value is the target code value C Line .
[0117] In this way, the unique code value of the coding feature is determined according to the target code value and the area number. That is, each feature point pixel captured by the two cameras can obtain a corresponding unique code value, which is shown in Formula 4.
[0118] C all =C Gray *q + C Line (4)
[0119] For 3D scanning equipment based on stereo vision, the final code values (i.e., unique code values) of the left and right images obtained by the two cameras are used to find the corresponding points of the left and right images for matching, and then the 3D model reconstruction is completed according to the principle of structured light triangulation imaging technology. Specifically, the corresponding points of the left and right images are matched and the 3D reconstruction is completed. Since the left and right images respectively obtain sub-pixel coordinates with unique code values, these code values are unique in the row direction, so the corresponding point matching is completed; the 3D reconstruction is completed according to the principle of structured light triangulation imaging technology.
[0120] The three-dimensional scanning and reconstruction method of this embodiment generates a high-frequency binary image and a Gray code image according to the size of the target image to be generated, and then controls the projector to project the high-frequency binary image and the Gray code image onto the target object, and at the same time controls the image collector to synchronously collect the high-frequency binary image and the Gray code image projected by the projector, and then globally processes the high-frequency binary image and the Gray code image collected by the image collector to exclude invalid areas, and binarizes the globally processed Gray code image to extract the coding features of the globally processed high-frequency binary image, so as to calculate the unique coding value of the coding features according to the binarized Gray code image, so as to use the structured light triangulation imaging method to perform three-dimensional reconstruction according to the corresponding points of the unique coding values of the left and right images. In this way, by using high-frequency binary stripes for structured light reconstruction, it is possible to overcome the effects of high reflection and strong scattering when scanning objects, so as to achieve the purpose of obtaining a complete and high-precision image data model (for example, due to the presence of highly reflective areas in the intraoral environment, the decoding process of the image is seriously affected, making it impossible to obtain complete intraoral data). This solves the problem in the prior art that when scanning objects, due to the presence of reflective areas in the scanned objects, the quality of the collected coding pattern in the reflective area is poor, which seriously affects the decoding process of the image and makes it impossible to obtain complete image data.
[0121] Embodiment 2:
[0122] like Fig.16 As shown, the present embodiment further provides a three-dimensional scanning and reconstruction system 1600 (hereinafter referred to as the "system"), which includes an image generation unit 1601, which generates a high-frequency binary image and a Gray code image based on the size of a target image to be generated; a control unit 1602, which is used to control a projector to project the high-frequency binary image and the Gray code image onto a target object, and to control an image collector to synchronously collect the high-frequency binary image and the Gray code image projected by the projector; an image processing unit 1603, which performs global processing on the high-frequency binary image and the Gray code image collected by the image collector to exclude invalid areas, and performs binarization processing on the globally processed Gray code image, extracts coding features of the globally processed high-frequency binary image, and calculates a unique coding value of the coding feature based on the binarized Gray code image; an image reconstruction unit 1604, which performs three-dimensional reconstruction according to corresponding points of the unique coding values of the left and right images using a structured light triangulation imaging method.
[0123] The three-dimensional scanning and reconstruction system 1600 of this embodiment generates a high-frequency binary image and a Gray code image according to the size of the target image to be generated through the image generation unit 1601, and then controls the projector through the control unit 1602 to project the high-frequency binary image and the Gray code image to the target object, and controls the image collector to synchronously collect the high-frequency binary image and the Gray code image projected by the projector. After that, the high-frequency binary image and the Gray code image collected by the image collector are globally processed by the image processing unit 1603 to exclude invalid areas, and the Gray code image after global processing is binarized to extract the coding features of the high-frequency binary image after global processing, so as to calculate the unique coding value of the coding features according to the Gray code image after binarization, so as to perform three-dimensional reconstruction according to the corresponding points of the unique coding values of the left and right images by using the structured light triangulation imaging method through the image reconstruction unit 1604. In this way, the three-dimensional scanning and reconstruction system 1600 of this embodiment can overcome the influence of high reflection and strong scattering when scanning objects by using high-frequency binary stripes for structured light reconstruction, so as to achieve the purpose of obtaining a complete and high-precision image data model. It solves the problem in the prior art that when scanning objects, due to the presence of reflective areas in the scanned objects, the quality of the collected coding pattern in the reflective area is poor, which seriously affects the decoding processing effect of the image and makes it impossible to obtain complete image data.
[0124] It should be noted that, for the technical solutions of the three-dimensional scanning and reconstruction system of this embodiment and the same parts as those in the first embodiment, please refer to the description in the first embodiment, which will not be repeated here.
[0125] Embodiment three:
[0126] The embodiment of the present invention further provides a terminal device, which may include a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program is executed by the processor to implement the above Figure 1 The various processes of the three-dimensional scanning and reconstruction method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0127] Embodiment 4:
[0128] Combination Fig.17 As shown, this embodiment also discloses a specific implementation of a computer-readable storage medium 1700. The computer-readable storage medium 1700 can be configured in whole or in part in a physical computer, server, cluster server or data center.
[0129] In this embodiment, the computer-readable storage medium 1700 stores computer program instructions 1701. When the computer program instructions 1701 are read and executed by a processor 1702, the steps in the three-dimensional scanning and reconstruction method disclosed in the first embodiment are executed.
[0130] Optionally, the computer-readable storage medium 1700 may be configured as a server, and the server runs on a physical device for building a private cloud, a hybrid cloud, or a public cloud. At the same time, the computer-readable storage medium 1700 may also be configured as a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0131] The computer-readable storage medium 1700 is used to store programs, and the processor 1702 executes the three-dimensional scanning and reconstruction method disclosed in the first embodiment after receiving the execution instruction.
[0132] At the same time, the processor 1702 disclosed in this embodiment may be an integrated circuit chip with signal processing capabilities. The processor 1702 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or the general-purpose processor may also be any conventional processor.
[0133] For the technical solutions of the computer-readable storage medium 1700 disclosed in this embodiment that are the same as those in Embodiment 1 and / or Embodiment 2, please refer to Embodiment 1 and / or Embodiment 2, which will not be repeated here.
[0134] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
[0135] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0136] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A three-dimensional scanning and reconstruction method, characterized in that: The method comprises: Generate a high-frequency binary image and a Gray code image based on the size of the target image to be generated; Controlling the projector to project the high-frequency binary image and the Gray code image onto the target object, and controlling two image collectors to synchronously collect the high-frequency binary image and the Gray code image projected by the projector; Performing global processing on the high-frequency binary image and the Gray code image acquired by the image acquisition device to exclude invalid areas, and performing binarization processing on the Gray code image after global processing to extract coding features of the high-frequency binary image after global processing; Calculating the unique code value of the coding feature based on the binary Gray code image, so as to perform three-dimensional reconstruction according to corresponding points of the unique code values of the left and right images using a structured light triangulation imaging method; The high-frequency binary image and Gray code image acquired by the image collector are globally processed to exclude invalid areas, including: Obtaining a pixel grayscale mean value of a black-and-white image or all high-frequency binary images, and obtaining a mask image based on comparison results of the pixel grayscale mean value with an over-dark threshold value and an over-bright threshold value; Eliminating invalid areas of the high-frequency binary image and the Gray code image based on comparison results of the high-frequency binary image and the Gray code image with the mask image respectively; Calculating the unique encoding value of the encoding feature based on the binary Gray code image includes: Based on the binary Gray code image, find the pixel area color corresponding to each coding feature to obtain the binary sequence corresponding to each coding pixel point; Find the region number of the coded pixel based on the binary sequence corresponding to each coded pixel; The target code value is determined based on the grayscale rising edge or grayscale falling edge of each feature line or the sub-region center line of the high-frequency binary image, so as to determine the unique coding value of the coding feature based on the target code value and the region number.
2. The method according to claim 1, characterized in that Generate a Gray code image based on the size of the target image to be generated, including: Based on the size of the target image to be generated, the Gray code structured light is divided into 2 N pixel area; Each pixel area is represented by a binary sequence, and the i-th binary bit corresponds to the pixel area of the i-th image of the Gray code structured light to form N Gray code images; Among them, the N-bit binary sequences of two adjacent areas have only one binary bit different, and the N-bit binary sequences of the first area and the last area have only one binary bit different. The binary bit of 0 represents a black area, and the binary bit of 1 represents a white area.
3. The method according to claim 1, characterized in that Generate a high-frequency binary image based on the size of the target image to be generated, including: The high-frequency binary structured light is divided into 2 corresponding to the pixel areas of N Gray code images. N pixel area; Each pixel area of the high-frequency binary structured light is divided into q sub-areas to form n high-frequency binary images, where q is a positive even number.
4. The method according to claim 3, characterized in that: If the high-frequency binary image is a black-and-white stripe image, the binary bits of the first q / 2 sub-regions of each Gray code mark region of the first high-frequency binary image are the same and opposite to the binary bits of the last q / 2 sub-regions.
5. The method according to claim 4, characterized in that The binary bits of the high-frequency binary image are the binary bits of the previous high-frequency binary image adjacent to it shifted left by one bit.
6. The method according to claim 4, characterized in that Adjacent high-frequency binary images are inverse images of each other. The binary bits of the 2a+1th high-frequency binary image are the binary bits of the 2a-1th high-frequency binary image shifted left by one bit, a∈[1,2,…,q / 2-1].
7. The method according to claim 3, characterized in that If the high-frequency binary image is an image whose sub-region center line is a white line, then the center line of the i-th sub-region of the i-th high-frequency binary image is a white line.
8. The method according to claim 1, characterized in that The gray code image after global processing is binarized, including: Comparing each Gray code image after global processing with the target image pixel by pixel; The pixels in the Gray code image that are higher than the pixel area of the target image are recorded as white, and the pixels in the Gray code image that are not higher than the pixel area of the target image are recorded as black.
9. The method according to claim 1, characterized in that: Extract the encoding features of the high-frequency binary image after global processing, including: If the high-frequency binary image is a black and white stripe image, the stripe boundary is extracted as a feature line and the coded pixel point is obtained based on the stripe boundary; If the high-frequency binary image is an image in which the center line of the sub-region is a white line, the center coordinates of the white line are used as the encoding feature.
10. The method according to claim 9, characterized in that Extracting stripe boundaries as feature lines includes: Get the pixel difference between the pixel coordinates of the positive and negative black and white stripe images; If the adjacent horizontal coordinates corresponding to the pixel difference have different signs, the boundary between the adjacent horizontal coordinates is used as the feature line, and the coordinate point where the pixel difference is located is used as the coded pixel point.
11. A three-dimensional scanning and reconstruction system, characterized in that: include: An image generating unit, generating a high-frequency binary image and a Gray code image based on the size of a target image to be generated; A control unit, used to control the projector to project the high-frequency binary image and the Gray code image onto the target object, and control the image collector to synchronously collect the high-frequency binary image and the Gray code image projected by the projector; An image processing unit performs global processing on the high-frequency binary image and the Gray code image acquired by the image collector to exclude invalid areas, and performs binarization processing on the Gray code image after global processing, extracts the coding features of the high-frequency binary image after global processing, and calculates a unique coding value of the coding features based on the Gray code image after binarization processing; An image reconstruction unit, used for performing three-dimensional reconstruction according to corresponding points of unique coding values of left and right images by using a structured light triangulation imaging method; The high-frequency binary image and the gray code image acquired by the image acquisition device are globally processed to exclude invalid areas, specifically including: obtaining the pixel grayscale mean of the black-and-white image or all high-frequency binary images, and obtaining a mask image based on the comparison results of the pixel grayscale mean with the too dark threshold and the too bright threshold; excluding invalid areas of the high-frequency binary image and the gray code image based on the comparison results of the high-frequency binary image and the gray code image with the mask image; Calculating the unique coding value of the coding feature based on the gray code image after binarization specifically includes: finding the pixel area color corresponding to each coding feature based on the gray code image after binarization to obtain the binary sequence corresponding to each coding pixel; finding the area number of the coding pixel based on the binary sequence corresponding to each coding pixel; determining the target code value based on the grayscale rising edge or grayscale falling edge of each feature line or the center line of the sub-area of the high-frequency binary image, so as to determine the unique coding value of the coding feature based on the target code value and the area number.
Citation Information
Patent Citations
Stripe reflection three-dimensional measurement method and system and storage medium
CN114166150A
Three-dimensional object reconstruction method and terminal device
WO2022021678A1