Fully automatic 3D scanning method and system based on turntable

By combining a depth camera and a color camera with a turntable, and using stereoscopic target and triangular array technology, fully automatic 3D scanning is realized, which solves the problems of cumbersome and poor quality of traditional 3D scanning technology, and improves scanning efficiency and imaging quality.

CN114119703BActive Publication Date: 2024-09-17HUNAN XINGLAN ZHIYUAN NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111470122.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2024-09-17
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

Traditional 3D scanning technology is cumbersome and of poor quality. Handheld operation can easily lead to discontinuous patterns, making it difficult to accurately obtain the three-dimensional outline and surface color information of colored objects.

Method used

Using a fully automatic 3D scanning method based on a turntable, a depth camera and a color camera are used in conjunction with the turntable to construct a three-dimensional target for calibration. The triangle array and encoding pattern are used to index the triangle corner point ID to achieve fully automatic 3D scanning of the object. Through the PnP algorithm and Nonlinear optimization algorithms calculate camera poses and generate color depth maps and 3D point clouds.

Benefits of technology

It realizes fully automatic 3D scanning without hand-held operation, retains the color information of objects, improves the efficiency and imaging quality of 3D scanning, and can repeatedly scan different objects with a single calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119703B
    Figure CN114119703B
Patent Text Reader

Abstract

A fully automatic 3D scanning method and device based on a turntable, wherein a coding pattern is preset inside a designated triangle of a three-dimensional target triangle array, and the coding pattern corner points are indexed to obtain a unique corner point ID; a depth camera and a color camera are used to shoot a designated position of a three-dimensional target, and the 2D pixel coordinates of the indexed corner points are detected, and the 3D coordinates corresponding to the corner points under each 2D pixel are obtained according to the predefined physical size; the 3D coordinates of the corner points of the indexed three-dimensional target in the camera coordinate system are obtained according to the data collected by the depth camera each time, and the rotation center of the turntable is obtained according to the 3D coordinates of the corner points of the three-dimensional target; the object to be scanned is placed on a calibrated turntable, and each rotation process triggers the depth camera and the color camera to collect data once, and the color depth map of the object is converted into a 3D point cloud of the object. The present invention realizes fully automatic three-dimensional scanning of an object, and improves the efficiency and imaging quality of three-dimensional scanning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a full-automatic 3D scanning device based on a turntable, belonging to the technical field of 3D scanning. Background Art

[0002] In computer vision, 3D reconstruction refers to the process of reconstructing 3D information based on single-view or multi-view images. Since the information in a single video is incomplete, 3D reconstruction requires empirical knowledge. Multi-view 3D reconstruction (similar to human binocular positioning) is relatively easy. The method is to first calibrate the camera, that is, calculate the relationship between the camera's image coordinate system and the world coordinate system, and then use the information in multiple 2D images to reconstruct 3D information.

[0003] 3D scanners project stripes onto the surface of an object, and then use a black and white camera to capture images. By calculating the deformation of the stripes on the surface of the object, the three-dimensional contour information of the object is obtained. Traditional 3D scanning technology usually includes image acquisition, camera calibration, feature extraction, stereo matching and three-dimensional reconstruction. The processing process is relatively cumbersome and the quality of three-dimensional reconstruction is poor. In addition, the 3D scanning of the reconstructed object requires the collector to hold the 3D scanner to scan the stereo object. The handheld scanning method often causes discontinuous collection patterns, incomplete scanning, deformation and other poor scanning problems due to hand tremors during the collection process, which in turn causes a long repair time after collection and the problem of not being able to completely restore the original shape. In reality, most of the objects required to be measured are colored, such as some colored cultural relics. It is not only required to accurately obtain the three-dimensional contour information of the object, but also to retain the surface color and texture information as realistic as possible. Simply changing the camera of the three-dimensional scanner to a color camera will increase noise and deteriorate the data quality. How to achieve fully automatic three-dimensional scanning of the scanned object with the help of a depth camera and a color camera without using a 3D scanner is a technical problem that needs to be solved urgently. Summary of the invention

[0004] To this end, the present invention provides a fully automatic 3D scanning method and system based on a turntable, which realizes fully automatic, high-quality three-dimensional scanning of the scanned object by combining a depth camera and a color camera with a turntable.

[0005] In order to achieve the above object, the present invention provides the following technical solution: a fully automatic 3D scanning method based on a turntable, comprising the following steps:

[0006] Constructing a three-dimensional target, each surface of the three-dimensional target having a triangle array, a coding pattern is preset inside a designated triangle of the triangle array, and a triangle corner point in the triangle array is indexed by the coding pattern to obtain a unique triangle corner point ID;

[0007] Depth camera and color camera calibration, fix the positions of the depth camera and color camera, use the depth camera and color camera to shoot the specified position of the stereo target, detect the 2D pixel coordinates of the triangle corner points with indexes, and obtain the 3D coordinates corresponding to the triangle corner points under each 2D pixel according to the predefined physical size;

[0008] Turntable calibration, placing the stereo target on a turntable at a fixed position, rotating the turntable according to a first preset number of times, collecting data once through the depth camera during each rotation, obtaining the 3D coordinates of the triangular corner points of the indexed stereo target in the camera coordinate system according to the data collected by the depth camera each time, and obtaining the rotation center of the turntable according to the 3D coordinates of the triangular corner points of the stereo target;

[0009] Automated 3D scanning, placing the object to be scanned on the calibrated turntable, rotating the turntable according to a second preset number of times, each rotation process triggers the depth camera and the color camera to collect data once, and obtaining a color depth map of the object according to the calibration results of the depth camera and the color camera, and converting the color depth map of the object into a 3D point cloud of the object.

[0010] As a preferred solution of the turntable-based fully automatic 3D scanning method, the postures of the depth camera and the color camera relative to the stereo target are calculated by the 3D coordinates corresponding to the corner points of the triangle;

[0011] According to the posture relationship between the depth camera and the color camera, a corresponding color image is generated for the depth image by projection.

[0012] As a preferred solution of the turntable-based fully automatic 3D scanning method, a PnP algorithm is used to calculate the posture of the depth camera and the color camera relative to the stereo target;

[0013] The reprojection error is minimized using a nonlinear optimization algorithm to obtain the final depth camera and color camera poses.

[0014] As a preferred solution of the fully automatic 3D scanning method based on the turntable, during the multiple rotations of the turntable, multiple 3D points corresponding to the same triangle corner point are located on the same 3D ring, and the center of the 3D ring is located on the rotation axis of the turntable;

[0015] A turntable rotation center is calculated by each triangle corner point, all the turntable rotation centers are fitted into a straight line, and the fitted straight line is used as the turntable rotation axis.

[0016] As a preferred solution of the turntable-based fully automatic 3D scanning method, the 3D transformation of each turntable rotation is calculated through the rotation axis and rotation angle of the turntable, and the 3D transformation is applied to each collected point cloud to obtain a 3D point cloud with rough alignment of the object.

[0017] As a preferred solution of the turntable-based fully automatic 3D scanning method, on the basis of the roughly aligned 3D point cloud of the object, an ICP point cloud registration algorithm with color information is used to perform 3D point cloud registration.

[0018] The present invention also provides a fully automatic 3D scanning device based on a turntable, comprising:

[0019] A three-dimensional target, each side of which has a triangle array, a coding pattern is preset inside a designated triangle of the triangle array, and a triangle corner point in the triangle array is indexed by the coding pattern to obtain a unique triangle corner point ID;

[0020] A depth camera and a color camera are used to photograph the specified position of the stereo target by fixing the positions of the depth camera and the color camera; the 2D pixel coordinates of the triangle corner points with indexes are detected, and the 3D coordinates corresponding to the triangle corner points under each 2D pixel are obtained according to the predefined physical size;

[0021] A turntable, wherein the stereo target is placed on the turntable at a fixed position, and the turntable is rotated according to a first preset number of times. During each rotation, data is collected by the depth camera once, and the 3D coordinates of the triangular corner points of the indexed stereo target in the camera coordinate system are obtained according to the data collected by the depth camera each time, and the rotation center of the turntable is obtained according to the 3D coordinates of the triangular corner points of the stereo target; the object to be scanned is placed on the calibrated turntable;

[0022] The automated 3D scanning module is used to rotate the turntable according to a second preset number of times, each rotation process triggers the depth camera and the color camera to collect data once, obtain a color depth map of the object object according to the calibration results of the depth camera and the color camera, and convert the color depth map of the object object into a 3D point cloud of the object object.

[0023] As a preferred solution of the fully automatic 3D scanning device based on the turntable, it also includes a posture processing module, which is used to calculate the posture of the depth camera and the color camera relative to the stereo target through the 3D coordinates corresponding to the triangle corner points;

[0024] It also includes a projection processing module, which is used to generate a corresponding color image for the depth image by projection according to the posture relationship between the depth camera and the color camera;

[0025] Calculate the posture of the depth camera and the color camera relative to the stereo target using a PnP algorithm;

[0026] The reprojection error is minimized using a nonlinear optimization algorithm to obtain the final depth camera and color camera poses.

[0027] As a preferred solution of the fully automatic 3D scanning device based on the turntable, during the multiple rotations of the turntable, multiple 3D points corresponding to the same triangle corner point are located on the same 3D ring, and the center of the 3D ring is located on the rotation axis of the turntable;

[0028] It also includes a fitting processing module, which is used to calculate a turntable rotation center through each triangle corner point, fit all the turntable rotation centers into a straight line, and use the fitted straight line as the rotation axis of the turntable.

[0029] As a preferred solution of the fully automatic 3D scanning device based on a turntable, in the automatic 3D scanning module, the 3D transformation of each turntable rotation is calculated through the rotation axis and rotation angle of the turntable, and the 3D transformation is applied to each collected point cloud to obtain a 3D point cloud of the object with rough alignment;

[0030] It also includes a point cloud registration module, which is used to perform 3D point cloud registration based on the roughly aligned 3D point cloud of the object using an ICP point cloud registration algorithm with color information.

[0031] The present invention has the following advantages: by constructing a three-dimensional target, each side of the three-dimensional target has a triangle array, and a coding pattern is preset inside a designated triangle of the triangle array, and the triangle corner points in the triangle array are indexed by the coding pattern to obtain a unique triangle corner point ID; the positions of the depth camera and the color camera are fixed, and the depth camera and the color camera are used to shoot the designated position of the three-dimensional target, and the 2D pixel coordinates of the indexed triangle corner points are detected, and the 3D coordinates corresponding to the triangle corner points under each 2D pixel are obtained according to the predefined physical size; the three-dimensional target is placed on a turntable at a fixed position, and the turntable is rotated according to a first preset number of times. During each rotation, data is collected once by the depth camera, and the 3D coordinates of the triangle corner points of the indexed three-dimensional target in the camera coordinate system are obtained according to the data collected by the depth camera each time, and the rotation center of the turntable is obtained according to the 3D coordinates of the triangle corner points of the three-dimensional target; the object to be scanned is placed on a calibrated turntable, and the turntable is rotated according to a second preset number of times. Each rotation process triggers the depth camera and the color camera to collect data once, and a color depth map of the object is obtained according to the calibration results of the depth camera and the color camera, and the color depth map of the object is converted into a 3D point cloud of the object. The present invention does not require handheld operation. Through the cooperation of a depth camera and a color camera with a turntable, it can realize fully automatic three-dimensional scanning of objects, while retaining the color information of the scanned objects. A single calibration can be used to repeatedly perform three-dimensional scanning of different objects, thereby improving the efficiency and imaging quality of three-dimensional scanning. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0033] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0034] Figure 1 A schematic diagram of a flow chart of a fully automatic 3D scanning method based on a turntable provided in an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of a stereoscopic target used in a turntable-based fully automatic 3D scanning provided in an embodiment of the present invention;

[0036] Figure 3 Schematic diagram of a turntable-based fully automatic 3D scanning device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] Example 1

[0039] See also Figure 1 and Figure 2 , a turntable-based fully automatic 3D scanning method is provided, comprising the following steps:

[0040] S1. Construct a three-dimensional target, wherein each surface of the three-dimensional target has a triangle array, a coding pattern is preset inside a designated triangle of the triangle array, and a triangle corner point in the triangle array is indexed by the coding pattern to obtain a unique triangle corner point ID;

[0041] S2, calibrating the depth camera and the color camera, fixing the positions of the depth camera and the color camera, using the depth camera and the color camera to shoot the specified position of the stereo target, detecting the 2D pixel coordinates of the triangle corner points with indexes, and obtaining the 3D coordinates corresponding to the triangle corner points under each 2D pixel according to the predefined physical size;

[0042] S3, turntable calibration, placing the stereo target on a turntable at a fixed position, rotating the turntable according to a first preset number of times, collecting data once through the depth camera during each rotation, obtaining the 3D coordinates of the triangular corner points of the indexed stereo target in the camera coordinate system according to the data collected by the depth camera each time, and obtaining the rotation center of the turntable according to the 3D coordinates of the triangular corner points of the stereo target;

[0043] S4, automated 3D scanning, placing the object to be scanned on the calibrated turntable, rotating the turntable according to a second preset number of times, each rotation process triggers the depth camera and the color camera to collect data once, and obtaining a color depth map of the object according to the calibration results of the depth camera and the color camera, and converting the color depth map of the object into a 3D point cloud of the object.

[0044] In this embodiment, the triangle corner points in the triangle array are indexed by the coding pattern to obtain a unique triangle corner point ID, and a one-to-one correspondence between 2D pixel coordinates and 3D physical coordinates can be obtained using a stereo target detection algorithm.

[0045] Specifically, let f(x) be the triangle mesh angle x found nearby * , where the alternating black and white regions meet at the intersection of the three triangles. Given the critical point position x 0 The initial value is obtained by using a series of t Construct a sequence x by approximating the local surface with a third-order polynomial centered on 0 , the critical points of these polynomials converge to x * Instead of using a Taylor series expansion, directly fit a third-order polynomial that contains the third-order derivative at x t To point x t The intensity surface function f nearby.

[0046] Among them, the third-order polynomial is expressed as:

[0047] f(x,c)=c1x 3 +c2x 2 y+c3xy 2 +c4y 3 +c5x 2

[0048] The polynomial surface fit can be expressed as:

[0049]

[0050] c = [c1, c2, ....] is the vector of polynomial coefficients, N is a set of n sampling points Δ i =(u i , v i ), and select on the grid with distance r. In practical applications, this least squares fitting problem can solve the extraction of m triangle corner points at the same time.

[0051] Assume that each convergence point x in the previous iteration * is a precisely located saddle point, the polynomial surface f(x * ) can be approximated as the multiplication of three hyperplanes (intensity ramps) that intersect at the origin:

[0052] f(x * )≈k(xsinθ1-xcosθ1)(xsinθ2-xcosθ2)(xsinθ3-xcosθ3)+l

[0053] The angles θ of these hyperplanes iExpressed as polarity, it describes the direction and shape of the surface, which can be further used for grid indexing by relating the above two formulas:

[0054] c1=ksinθ1sinθ2sinθ3;

[0055] c2=-ksinθ1sinθ2cosθ3-ksinθ1cosθ2sinθ3-kcosθ1sinθ2sinθ3;

[0056] c3=ksinθ1cosθ2cosθ3+kcosθ1sinθ2cosθ3+kcosθ1cosθ2sinθ3;

[0057] c4=-kcosθ1cosθ2cosθ3;

[0058] The three angles θ1, θ2, and θ3 are the three solutions to the following third-order equation:

[0059] c4tan3θ+c3tan2θ+c2tanθ+c1=0.

[0060] c4tan3θ+c3tan2θ+c2tanθ+c 1= Two of the three roots of 0 may be complex. Using the real part as the azimuth and the imaginary part as the elevation, embed the roots into a unit sphere and then use cosine distance to find similar adjacent angles on the triangle mesh.

[0061] The above process can be used to index each triangle corner point in the triangle array to obtain a unique triangle corner point ID.

[0062] In this embodiment, the posture of the depth camera and the color camera relative to the stereo target is calculated by the 3D coordinates corresponding to the corner points of the triangle; according to the posture relationship between the depth camera and the color camera, a corresponding color map is generated for the depth map by projection. The posture of the depth camera and the color camera relative to the stereo target is calculated using the PnP algorithm; the reprojection error is minimized using a nonlinear optimization algorithm to obtain the final posture of the depth camera and the color camera.

[0063] Specifically, this embodiment is based on the optimized PnP algorithm, and the specific implementation process is as follows:

[0064] Consider n three-dimensional space points P and their projections p, and calculate the camera pose R,t, whose Lie algebra is represented by ξ. Assume that the coordinates of a space point are P i =[X i , Y i , Z i ] T , the pixel coordinate of its projection is ui =[u i , v i ] T The relationship between the pixel position and the spatial point position is as follows:

[0065]

[0066] Among them, s i represents the scale factor, K is the camera calibration intrinsic matrix intrinsic parameter, and the complete form of K is:

[0067]

[0068] Among them, f x , f y is the focal length, c x , c y For the heart of light.

[0069] The camera posture expressed by the ξ Lie algebra is written in matrix form as: i u i =K exp(ξ^)P i , due to the unknown camera pose and the noise of the observation points, there is an error in this equation. Therefore, it is necessary to sum the errors, construct a least squares problem, and then find the best camera pose to minimize it:

[0070]

[0071] The error term of this problem is the error obtained by comparing the pixel coordinates (the observed projected position) with the position of the 3D point projected according to the current estimated pose, so it is called the reprojection error. Using Lie algebra, we can construct unconstrained optimization problems, which can be easily solved by optimization algorithms such as GN and LM. We need to know the derivative of each error term with respect to the optimization variable, that is, linearization:

[0072] e(x+Δx)≈e(x)+JΔx

[0073] Let the coordinates of the space point transformed to the camera coordinate system be P′, and take out its first three dimensions:

[0074] P′=(exp(ξ^)P) 1:3 =[X′|Y′|Z′] T

[0075] When e is the pixel coordinate error (2D) and x is the camera pose (6D), J will be a 2×6 Jacobian matrix. It can be derived that J:

[0076]

[0077] Therefore, the pose can be solved using the optimized PnP algorithm.

[0078] In this embodiment, during the multiple rotations of the turntable, multiple 3D points corresponding to the same triangle corner point are located on the same 3D ring, and the center of the 3D ring is located on the rotation axis of the turntable;

[0079] A turntable rotation center is calculated by each triangle corner point, all the turntable rotation centers are fitted into a straight line, and the fitted straight line is used as the turntable rotation axis.

[0080] Specifically, in the turntable calibration process, the position of the turntable is fixed, and then the stereo target is placed on the turntable. The turntable rotates 30 degrees at a time. Each time it rotates, the depth camera collects data once, and it rotates a total of 12 times. The data collected each time can be used to obtain the indexed 3D coordinates of the target in the camera coordinate system through the PnP algorithm. Due to occlusion problems, the same triangular corner point on the target may not be photographed 12 times. Without loss of generality, it is assumed that the same corner point will be photographed 6 times. Therefore, for a certain triangular corner point, 6 3D coordinates will be obtained. These 3D coordinates are caused by the rotation of the turntable, so the multiple 3D points corresponding to the same triangular corner point are located on the same 3D ring, and the center of the ring is located on the rotation axis of the turntable. The center of rotation can be calculated for each corner point, and all rotation centers can be fitted with a straight line, which is the rotation axis of the turntable.

[0081] In this embodiment, the 3D transformation of each turntable rotation is calculated through the rotation axis and rotation angle of the turntable, and the 3D transformation is applied to each collected point cloud to obtain a 3D point cloud with rough alignment of the object.

[0082] Specifically, place the object to be scanned on the turntable and start scanning. Set the number of rotations to N, and each rotation is 360 / N degrees. After each rotation, the depth camera and color camera are triggered by hardware to collect data once. According to the calibration results, a color depth map is obtained, and then converted into a point cloud. According to the rotation axis and rotation angle, the 3D transformation of each turntable rotation is calculated, and this 3D transformation is applied to each collected point cloud to obtain a coarsely aligned complete 3D point cloud.

[0083] In this embodiment, based on the roughly aligned 3D point cloud of the object, an ICP point cloud registration algorithm with color information is used to perform 3D point cloud registration.

[0084] Specifically, based on the roughly aligned point cloud, the ICP point cloud registration algorithm with color information is used for fine registration. During the registration, not only the point cloud distance is penalized, but also the similarity is calculated based on the color difference, making the registration more stable.

[0085] Specifically, based on the rough alignment of the point cloud, the calibration information between the color camera and the depth camera is used to match the RGB color information with the 3D camera point cloud information, so that the point cloud that originally only had 3D coordinate point information also has color information. The fine registration adopts the method of fusion calculation of maximum color similarity and calculation of minimum point cloud distance. When the point cloud distance simultaneously meets the minimum distance and has the maximum color similarity, fine registration is performed, which can effectively improve the accuracy and registration stability.

[0086] In summary, the present invention constructs a three-dimensional target, each side of the three-dimensional target has a triangular array, and a coding pattern is preset inside a designated triangle of the triangular array, and the triangular corner points in the triangular array are indexed by the coding pattern to obtain a unique triangular corner point ID; the positions of the depth camera and the color camera are fixed, and the depth camera and the color camera are used to shoot the designated position of the three-dimensional target, and the 2D pixel coordinates of the indexed triangular corner points are detected, and the 3D coordinates corresponding to the triangular corner points under each 2D pixel are obtained according to the predefined physical size; the three-dimensional target is placed on a turntable at a fixed position, and the turntable is rotated according to a first preset number of times. During each rotation, data is collected once by the depth camera, and the 3D coordinates of the triangular corner points of the indexed three-dimensional target in the camera coordinate system are obtained according to the data collected by the depth camera each time, and the rotation center of the turntable is obtained according to the 3D coordinates of the triangular corner points of the three-dimensional target; the object to be scanned is placed on a calibrated turntable, and the turntable is rotated according to a second preset number of times. Each rotation process triggers the depth camera and the color camera to collect data once, and a color depth map of the object is obtained according to the calibration results of the depth camera and the color camera, and the color depth map of the object is converted into a 3D point cloud of the object. The present invention does not require handheld operation. Through the cooperation of a depth camera and a color camera with a turntable, it can realize fully automatic three-dimensional scanning of objects, while retaining the color information of the scanned objects. A single calibration can be used to repeatedly perform three-dimensional scanning of different objects, thereby improving the efficiency and imaging quality of three-dimensional scanning.

[0087] Example 2

[0088] See also Figure 3 Embodiment 2 of the present invention further provides a fully automatic 3D scanning device based on a turntable, comprising:

[0089] A three-dimensional target, each side of which has a triangle array, a coding pattern is preset inside a designated triangle of the triangle array, and a triangle corner point in the triangle array is indexed by the coding pattern to obtain a unique triangle corner point ID;

[0090] A depth camera and a color camera are used to photograph the specified position of the stereo target by fixing the positions of the depth camera and the color camera; the 2D pixel coordinates of the triangle corner points with indexes are detected, and the 3D coordinates corresponding to the triangle corner points under each 2D pixel are obtained according to the predefined physical size;

[0091] A turntable, wherein the stereo target is placed on the turntable at a fixed position, and the turntable is rotated according to a first preset number of times. During each rotation, data is collected by the depth camera once, and the 3D coordinates of the triangular corner points of the indexed stereo target in the camera coordinate system are obtained according to the data collected by the depth camera each time, and the rotation center of the turntable is obtained according to the 3D coordinates of the triangular corner points of the stereo target; the object to be scanned is placed on the calibrated turntable;

[0092] The automated 3D scanning module 1 is used to rotate the turntable according to a second preset number of times, each rotation process triggers the depth camera and the color camera to collect data once, obtain a color depth map of the object object according to the calibration results of the depth camera and the color camera, and convert the color depth map of the object object into a 3D point cloud of the object object.

[0093] In this embodiment, a posture processing module 2 is also included, which is used to calculate the posture of the depth camera and the color camera relative to the stereo target through the 3D coordinates corresponding to the triangle corner points;

[0094] It also includes a projection processing module 3, which is used to generate a corresponding color image for the depth image by projection according to the posture relationship between the depth camera and the color camera;

[0095] Calculate the posture of the depth camera and the color camera relative to the stereo target using a PnP algorithm;

[0096] The reprojection error is minimized using a nonlinear optimization algorithm to obtain the final depth camera and color camera poses.

[0097] In this embodiment, during the multiple rotations of the turntable, multiple 3D points corresponding to the same triangle corner point are located on the same 3D ring, and the center of the 3D ring is located on the rotation axis of the turntable;

[0098] It also includes a fitting processing module 4, which is used to calculate a turntable rotation center through each triangle corner point, fit all the turntable rotation centers into a straight line, and use the fitted straight line as the rotation axis of the turntable.

[0099] In this embodiment, the automated 3D scanning module 5 calculates the 3D transformation of each turntable rotation through the rotation axis and rotation angle of the turntable, and applies the 3D transformation to each collected point cloud to obtain a roughly aligned 3D point cloud of the object.

[0100] It also includes a point cloud registration module 5, which is used to perform 3D point cloud registration based on the roughly aligned 3D point cloud of the object using an ICP point cloud registration algorithm with color information.

[0101] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned system are based on the same concept as the method embodiment in Example 1 of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown in the previous part of the present application, and will not be repeated here.

[0102] Example 3

[0103] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, in which program code of a turntable-based fully-automatic 3D scanning method is stored, and the program code includes instructions for executing embodiment 1 or any possible implementation method of the turntable-based fully-automatic 3D scanning method.

[0104] The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0105] Example 4

[0106] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;

[0107] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the turntable-based fully automatic 3D scanning method of Example 1 or any possible implementation thereof.

[0108] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor implemented by reading software codes stored in a memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.

[0109] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.

[0110] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0111] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A fully automatic 3D scanning method based on a turntable, characterized in that: The following steps are involved: Constructing a three-dimensional target, each surface of the three-dimensional target having a triangle array, a coding pattern is preset inside a designated triangle of the triangle array, and a triangle corner point in the triangle array is indexed by the coding pattern to obtain a unique triangle corner point ID; Depth camera and color camera calibration, fix the positions of the depth camera and color camera, use the depth camera and color camera to shoot the specified position of the stereo target, detect the 2D pixel coordinates of the triangle corner points with indexes, and obtain the 3D coordinates corresponding to the triangle corner points under each 2D pixel according to the predefined physical size; Turntable calibration, placing the stereo target on a turntable at a fixed position, rotating the turntable according to a first preset number of times, collecting data once through the depth camera during each rotation, obtaining the 3D coordinates of the triangular corner points of the indexed stereo target in the camera coordinate system according to the data collected by the depth camera each time, and obtaining the rotation center of the turntable according to the 3D coordinates of the triangular corner points of the stereo target; Automated 3D scanning, placing the object to be scanned on the calibrated turntable, rotating the turntable according to a second preset number of times, each rotation process triggers the depth camera and the color camera to collect data once, and obtaining a color depth map of the object according to the calibration results of the depth camera and the color camera, and converting the color depth map of the object into a 3D point cloud of the object.

2. The turntable-based fully automatic 3D scanning method according to claim 1, characterized in that: Calculating the posture of the depth camera and the color camera relative to the stereo target through the 3D coordinates corresponding to the corner points of the triangle; According to the posture relationship between the depth camera and the color camera, a corresponding color image is generated for the depth image by projection.

3. The turntable-based fully automatic 3D scanning method according to claim 2, characterized in that: Calculate the posture of the depth camera and the color camera relative to the stereo target using a PnP algorithm; The reprojection error is minimized using a nonlinear optimization algorithm to obtain the final depth camera and color camera poses.

4. The turntable-based fully automatic 3D scanning method according to claim 3, characterized in that: During the multiple rotations of the turntable, multiple 3D points corresponding to the same triangle corner point are located on the same 3D ring, and the center of the 3D ring is located on the rotation axis of the turntable; A turntable rotation center is calculated by each triangle corner point, all the turntable rotation centers are fitted into a straight line, and the fitted straight line is used as the turntable rotation axis.

5. The turntable-based fully automatic 3D scanning method according to claim 4, characterized in that: The 3D transformation of each turntable rotation is calculated through the rotation axis and rotation angle of the turntable, and the 3D transformation is applied to each collected point cloud to obtain a 3D point cloud with rough alignment of the object.

6. The turntable-based fully automatic 3D scanning method according to claim 5, characterized in that: Based on the roughly aligned 3D point cloud of the object, an ICP point cloud registration algorithm with color information is used to perform 3D point cloud registration.

7. A fully automatic 3D scanning device based on a turntable, characterized in that: include: A three-dimensional target, each side of which has a triangle array, a coding pattern is preset inside a designated triangle of the triangle array, and a triangle corner point in the triangle array is indexed by the coding pattern to obtain a unique triangle corner point ID; A depth camera and a color camera are used to photograph the specified position of the stereo target by fixing the positions of the depth camera and the color camera; the 2D pixel coordinates of the triangle corner points with indexes are detected, and the 3D coordinates corresponding to the triangle corner points under each 2D pixel are obtained according to the predefined physical size; A turntable, wherein the stereo target is placed on the turntable at a fixed position, and the turntable is rotated according to a first preset number of times. During each rotation, data is collected once by the depth camera, and the 3D coordinates of the triangular corner points of the indexed stereo target in the camera coordinate system are obtained according to the data collected by the depth camera each time. The rotation center of the turntable is obtained according to the 3D coordinates of the triangular corner points of the stereo target; the object to be scanned is placed on the calibrated turntable; The automated 3D scanning module is used to rotate the turntable according to a second preset number of times, each rotation process triggers the depth camera and the color camera to collect data once, obtain a color depth map of the object object according to the calibration results of the depth camera and the color camera, and convert the color depth map of the object object into a 3D point cloud of the object object.

8. The fully automatic 3D scanning device based on a turntable according to claim 7, characterized in that: It also includes a posture processing module, which is used to calculate the posture of the depth camera and the color camera relative to the stereo target through the 3D coordinates corresponding to the triangle corner points; It also includes a projection processing module, which is used to generate a corresponding color image for the depth image by projection according to the posture relationship between the depth camera and the color camera; Calculate the posture of the depth camera and the color camera relative to the stereo target using a PnP algorithm; The reprojection error is minimized using a nonlinear optimization algorithm to obtain the final depth camera and color camera poses.

9. The fully automatic 3D scanning device based on a turntable according to claim 7, characterized in that: During the multiple rotations of the turntable, multiple 3D points corresponding to the same triangle corner point are located on the same 3D ring, and the center of the 3D ring is located on the rotation axis of the turntable; It also includes a fitting processing module, which is used to calculate a turntable rotation center through each triangle corner point, fit all the turntable rotation centers into a straight line, and use the fitted straight line as the rotation axis of the turntable.

10. The fully automatic 3D scanning device based on a turntable according to claim 7, characterized in that: In the automated 3D scanning module, the 3D transformation of each turntable rotation is calculated through the rotation axis and rotation angle of the turntable, and the 3D transformation is applied to each collected point cloud to obtain a roughly aligned 3D point cloud of the object; It also includes a point cloud registration module, which is used to perform 3D point cloud registration based on the roughly aligned 3D point cloud of the object using an ICP point cloud registration algorithm with color information.