Background
Some portable scanners that have in the market at present are only small, portable, but measure at every turn and need multiframe continuous exposure to gather the deformation stripe map just can reconstruct the three-dimensional point cloud, and the operation mode generally is: selecting a position, fixing an instrument, measuring, moving the position, fixing and measuring. The working mode has low measuring efficiency, cannot realize handheld continuous scanning, and is not suitable for scanning dynamic objects. Some portable scanners can use a handheld scanning method and a stereoscopic vision technique, but mark points need to be marked on a measured object before measurement, which results in low measurement efficiency and large workload, and how many points are reconstructed by a machine vision method and marked points? Location? Correlation and therefore reconstruction of dense point clouds is not possible. The laser three-dimensional scanner can also be made into a portable scanner, which also requires the scanner to be kept still during the measurement process, so that the handheld scanning cannot be realized, and in addition, the laser scanner is point scanning or line scanning, so that the scanning efficiency is low.
Multi-angle stitching of handheld three-dimensional scanners is also an important issue with respect to several of the above techniques. On one hand, splicing can be achieved by calibrating the position of the multiple measurement scanner or the position of the measured object, but calibration requires auxiliary equipment, such as a displacement table, which increases cost and limits application occasions. On the other hand, the splicing is assisted by attaching some mark points on the surface of the measured object, which can cause the measurement period to be lengthened and the measurement to be complicated.
In view of the above, there is an urgent need for a scanning method that can meet the requirements of handheld measurement and dynamic measurement, and can well splice the measurement results of various angles.
Disclosure of Invention
The invention aims to realize a portable and convenient-to-operate handheld scanning method, which is suitable for most measuring objects, does not need a large number of mark points and well realizes the splicing problem of multi-angle measurement.
The free moving three-dimensional scanning method includes one color camera, one color projecting device, one controller, etc. and features the camera and the projecting device in acute angle, the control button to control the start and stop of measurement, the projecting device to project three-frequency color sine stripes onto the surface of the measured object, and the controller to control the camera to trigger the shooting and to shoot color deformed stripe pattern via single frame exposure. On one hand, the deformed fringe pattern calculates a high-frequency carrier frequency unwrapping phase by adopting a three-frequency phase unwrapping method, and three-dimensional point cloud of the measured object is obtained by system calibration parameters. On the other hand, the deformed fringe pattern obtains three frequencies by adopting a frequency domain minimization methodAnd (4) a sinusoidal fringe component, and subtracting the three-frequency sinusoidal fringe component from the color deformed fringe pattern to recover the texture pattern of the surface of the measured object. Two adjacent frames of texture maps can obtain two pairwise corresponding sparse angular points by using a SIFT intersection point extraction method, an initial coordinate transformation matrix p1 between two adjacent frames of measurement point clouds is calculated by using space points corresponding to the angular points, and two three-dimensional point clouds are unified under a former point cloud coordinate system through coordinate transformation; dividing a triangular surface patch of each measured three-dimensional point cloud of a measured object, calculating the curvature and the normal of each triangular surface patch, solving a coordinate transformation matrix p2 for further splicing the two point clouds by adopting the maximum global curvature correlation and the maximum normal direction correlation of the three-dimensional curved surface after unifying the coordinate system, and carrying out coordinate transformation; iterating the two point clouds after coordinate transformation by adopting an ICP (iterative closed Point) method to find a coordinate transformation matrix p3 for more accurately splicing the two point clouds together; therefore, the three-dimensional point cloud left-multiplication matrix pi of the i +1 th frame is p1 p2 p3, and the three-dimensional point cloud left-multiplication matrix pi and the three-dimensional point cloud obtained by the exposure of the i +1 th frame are spliced together to be left-multiplied by HiSplicing the 1 st frame measurement result together with the P1. P2. P3. Pi, splicing all the measured point clouds with the 1 st frame measurement result, and completing the complete splicing of the measurement.
A mobile three dimensional scanning method according to claim 1, a hand held 3d real time scanner according to claim 1, wherein the camera exposure is automatically adjusted according to the degree of fringe modulation. Specifically, the high-frequency component of the three-frequency color stripe is obtained by empirical mode decomposition and two-dimensional Hilbert transformation, the two-dimensional amplitude of the high-frequency component is extracted by the two-dimensional Hilbert, the maximum value and the minimum value of the two-dimensional amplitude are calculated, the difference between the maximum value and the minimum value and a set value is calculated, and the exposure time is adjusted to enable the difference to be minimum. Thereby achieving the purpose of adjusting exposure.
A mobile three-dimensional scanning method according to claim 1, wherein the scanner is triggered only within a predetermined measuring distance, the operator should reasonably control the distance between the scanner and the object to be measured, and the indicator lights 1 and 2 respectively indicate whether the measuring distance is within the measuring range. Meanwhile, the measurement can be classified into a jog measurement and a continuous measurement.
(1) The measurement button is inching, namely, the measurement is finished once when the button is pressed once, and if the measurement results of multiple times need to be spliced, an operator needs to ensure that the superposition rate of the two adjacent measurements of the measured object is more than 60%.
(2) Continuous measurement is realized, the controller continuously triggers the camera, and an operator continuously moves the scanner; the frame rate can be adjusted according to the size of the visual field and the speed of the mobile person so as to ensure the coincidence rate of more than 60 percent. For example, for a field size of 0.5m × 0.5m, assuming that the moving speed of the operator is 1m/s and the trigger speed of the signal generator is 4 frames/s, it is able to ensure that the coincidence rate between two adjacent measurements is above 60%. In order to avoid overlarge data amount caused by excessive overlapped parts, when a person carries out handheld measurement, the trigger speed is set to be 5-10 frames/s.
(3) Can be triggered only within the calibrated measuring distance, an operator needs to reasonably control the distance between the scanner and the measured object,
the method of claim 1, wherein the invention can realize dynamic object measurement, the measured object is in the measuring range, the scanner is fixed, the frame rate is set, the position and shape of the measured curved surface at each moment can be recorded by using the continuous measuring mode, and the data can be used for motion state analysis and motion deformation analysis.
The freely movable three-dimensional scanning method as claimed in claim 1, wherein the projection device projects a three-frequency color fringe pattern, the color fringe pattern is generated by the computer, the three RGB color channels are generated by the sine fringes of the low, middle and high carrier frequencies, respectively, and the frequency ratio of the three-frequency color sine fringes is 1: 4: 12.
The handheld 3d real-time scanner of claim 1, wherein the decomposition of the high, medium and low frequency components is performed by subtracting a color channel containing high frequency fringes from a color channel containing medium frequency fringes in the deformed color fringe pattern to reduce background light intensity, thereby obtaining a high and low frequency composite fringe pattern. The high and intermediate carrier frequency components are then separated by fourier transform. And in the same way, decomposing to obtain medium and low carrier frequency components. And finally, sequentially completing wrapping phase expansion according to the low, medium and high carrier frequency components by a variable-precision de-wrapping algorithm to obtain the expansion phase of the high-frequency carrier frequency item. The unwrapping phase can thus recover the object height based on the calibration result.
The invention has the advantages that:
1) three-dimensional point cloud measurement can be completed by realizing single-frame exposure by using a method of projecting a three-frequency color sine fringe pattern, and the measurement result point cloud is dense and high in precision;
2) automatically adjusting the exposure time of the camera according to the information such as color, texture, reflectivity and the like of the measured object;
3) the two measurement modes of inching measurement and continuous measurement can be realized, and in the continuous measurement mode, the scanner can continuously expose at a certain frame rate to realize continuous measurement;
4) the single-angle three-dimensional measurement of the motion curved surface can be realized;
5) obtaining a three-frequency sine stripe component by a frequency domain minimization method, and subtracting the three-frequency sine stripe component from the color deformation stripe graph to recover the texture graph of the surface of the measured object;
6) and realizing the splicing of multi-angle and multi-frame exposure measurement according to the texture map recovered from the deformed stripe map, the curvature of the curved surface, the normal direction and other information.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings.
1. General technical route map
The handheld three-dimensional scanning method described in this patent is a method applied to a mobile, handheld, and portable three-dimensional scanner, which scans and splices a measured object from multiple angles to generate a complete three-dimensional model. The handheld three-dimensional scanning method described in the patent has two measurement modes, namely a jog measurement and a continuous measurement. Under the two measurement modes, the measurement process and the technical scheme are the same, and the general technical route is shown as the attached figure 1.
(1) Selecting a measurement mode, and performing inching measurement or continuous measurement; wherein, the inching measurement is carried out, the measurement angle is selected, and the measurement is carried out once when the measurement is triggered; continuous measurement, continuous exposure of a camera and continuous movement of a scanner are realized, for example, for a field size of 0.5m by 0.5m, assuming that the movement speed of an operator is 4 frames/s, the trigger speed of a signal generator is 4 frames/s, and thus the coincidence rate between two adjacent measurements can be ensured to be more than 60%. In order to avoid overlarge data amount caused by excessive overlapped parts, when a person carries out handheld measurement, the trigger speed is set to be 5-10 frames/s.
(2) Selecting a measurement angle of a measured object, wherein the coincidence rate of adjacent angles is more than 60%;
(3) the camera automatically adjusts the exposure time according to the information of illumination, reflectivity and the like at different angles, and the adjustment method is described in detail in the following 2;
(4) selecting a good angle in the step (1) to carry out scanning measurement, and obtaining a three-dimensional point cloud and a texture map of each angle by adopting a three-frequency color phase-shift profilometry and color fringe decoupling method, wherein the detailed steps are shown as an attached figure 3;
(5) and (3) splicing the three-dimensional point clouds with different angles obtained in the step (2) into a complete model, wherein the splicing method is shown in the attached drawings 4 and 5.
2. Automatic exposure adjustment
The method comprises the steps of obtaining a high-frequency component of the tri-frequency color stripe by empirical mode decomposition and two-dimensional Hilbert transformation, extracting two-dimensional amplitude of the high-frequency component by the two-dimensional Hilbert, calculating the maximum value and the minimum value of the two-dimensional amplitude, calculating the difference value between the maximum value and the minimum value and a set value, and adjusting exposure time to enable the difference value to be the minimum value. Thereby achieving the purpose of adjusting exposure.
3. Tri-frequency color phase shift profilometry and texture recovery
The hand-held three-dimensional scanning method described in this patent adopts a color grating projection technology to project a three-frequency color sine fringe pattern as shown in fig. 2 onto the surface of a measured object, the ratio of RGB three-channel frequencies is 1: 4: 12, a color camera is used to shoot a deformed fringe pattern projected on the surface of the object, three carrier frequencies of high, medium and low are separated by fourier transform, then three-frequency phases are respectively unfolded, phase unwrapping is carried out, a high-frequency carrier phase is recovered, and finally, three-dimensional point cloud is obtained through parameters calibrated by a system. And the deformed fringe pattern obtains a three-frequency sine fringe component by adopting a frequency domain minimization method, and subtracts the three-frequency sine fringe component from the color deformed fringe pattern to recover the texture pattern of the surface of the measured object. The specific steps for obtaining the three-dimensional point cloud are shown in the attached figure 3:
(1) the projection equipment projects the color tri-frequency color stripes onto the surface of the measured object, as shown in the attached figure 2;
(2) shooting a deformed stripe image of the surface of a measured object by a color camera;
(3) separating high, medium and low three carrier frequencies by Fourier change to obtain high, medium and low three-amplitude deformation fringe patterns;
(4) adopting HHT (Hilbert-Huang transform) to perform stripe self-adaptive analysis and phase extraction to obtain high, medium and low three-frequency wrapping phases;
(5) obtaining a high-precision absolute phase by a time domain variable precision unwrapping method;
(6) and (5) obtaining the three-dimensional point cloud of the measured object by using the system calibration parameters according to the absolute phase obtained in the step (5).
The steps for obtaining the texture map are as follows:
(7) subtracting the high, medium and low three-frequency components obtained in the step (3) from the color deformation fringe pattern obtained in the step (2) to obtain a background component;
and (5) separating and recovering the background component obtained in the step (7) through texture illumination to obtain the original texture image of the measured object.
4. Embodiments of automated splicing
The handheld three-dimensional scanning method described by the invention can realize automatic seamless splicing without mark points, the splicing mainly depends on texture information recovered from a deformed fringe pattern, the curvature and the normal direction of a point cloud dividing curved surface are measured as constraints, the position relation between two adjacent frames of measurement results is searched, and the global splicing is finally realized.
The coordinate system of the point cloud scanned at each angle is superposed with the camera coordinate system of the scanning position at that time, so that the point cloud coordinates scanned at different angles are not in the same coordinate system, and the process of converting the point clouds in different coordinate systems into the same coordinate system is the splicing of the point clouds. And (3) assuming that a world coordinate system is superposed with a camera coordinate system under the 1 st angle, and converting the point beans obtained by n angles measured each time into the world coordinate system, so that multi-angle splicing is realized. The world coordinate system is expressed as (X)
w,Y
w,Z
w,O
w) The camera coordinate system at each angle is represented as (X)
i,Y
i,Z
i,O
i) Simultaneously (X)
w,Y
w,Z
w,O
w)=(X
1,Y
1,Z
1,O
1) (ii) a The representation of the point cloud is
Wherein i represents the point cloud obtained by the ith measurement, j represents j points in the point cloud, and l represents coordinates under the ith angular coordinate system.
(1) Splicing results of two adjacent angle scans
For the splicing of exposure measurement results of two adjacent angles, the splicing algorithm of the point clouds obtained by two adjacent scans is described in detail below by taking the splicing of the three-dimensional point clouds measured at the ith angle and the (i + 1) th angle as an example. Wherein the point cloud obtained by the ith measurement is represented as
k represents the number of points of the point cloud i; the point cloud obtained from the (i + 1) th measurement is represented as
s represents the number of points of the point cloud i + 1; the algorithm flow is shown in fig. 4:
a) using SIFT (Scale-invariant Feature Transform), a Feature point extraction method to find sparse corresponding Feature points in texture maps i and i +1, and marking the sparse corresponding Feature points as { a1, a2 ·, am } and { b1, b2 ·, bm }, wherein m is the corresponding point number found in the texture maps;
b) using RANSAC (Random Sample Consensus) method to remove points with larger limit errors, which are recorded as { a1, a2 ·, ar } and { b1, b2 ·, br } and r is the reserved corresponding points found in the texture map; and finding the spatial point coordinates { A1, A2,. Ar } and { B1, B2,. Br } corresponding to the matching feature points, wherein,
representing the feature points in the ith point cloud,
and (3) representing the corresponding point in the (i + 1) th point cloud, wherein r is less than or equal to s, k.
c) Iteratively solving the equation (formula 1) to obtain p1, wherein p1 represents the (i + 1) th coordinate system (X)
i+1,Y
i+1,Z
i+1,O
i+1) In the i-th coordinate system (X)
i,Y
i,Z
i,Q
i) Pose potential matrix of (X)
0,Y
0,Z
0) The position is indicated by a position indication,
representing the attitude, i.e. the (i + 1) th coordinate system (X)
i+1,Y
i+1,Z
i+1,O
i+1) With the i-th coordinate system (X)
i,Y
i,Z
i,O
i) The included angle of each coordinate axis.
Wherein p1 ═ R T],R=RotX·RotY·RotZ,
d) All the points in the point cloud i +1 are multiplied by the matrix p1 to transform them into the coordinate system of the point cloud i, i.e. the point cloud i
e) Solving a space coordinate matrix p2 based on the curvature consistency correlation in the normal direction, wherein the meaning represented by p2 is the same as that represented by p1, and the steps are as follows:
step one, initializing p2 to be 0;
secondly, respectively carrying out triangular patch mesh division on the point cloud i and the point cloud i +1, namely constructing a triangular patch mesh model with a connected topological relation; the point cloud i and its divided patches are denoted as model i, denoted as MiSimilarly, point cloud i +1 and its divided patch are denoted as model i +1, denoted as Mi+1。
Step three, the model i +1, namely Mi+1Performing a coordinate transformation with a transformation matrix of p2, i.e. Mi+1=p2·Mi+1And calculating the curvature and normal direction of each point after coordinate transformation, and expressing as { ri,1,ri,2,ri,3,···,ri,k},{ri+1,1,ri+1,2,ri+1,3,···,ri+1,sAnd { N }i,1,Ni,2,Ni,3,···,Ni,k},{Ni+1,1,Ni+1,2,Ni+1,3,···,Ni+1,s};
Step four, each point of the curved surface model i +1 is according to the normal direction { N }
i+1,1,N
i+1,2,N
i+1,3···,N
i+1,sFind the corresponding point on the surface model i. We define Q as a point on the surface model i +1
If a point Q' on the surface model is found to satisfy the following condition, it is the corresponding point on the surface model i.
The connecting direction of Q' and Q and the normal direction N of Qn+1,jThe included angle is very small, i.e. angle [ | Q' -Q |, N |)n+1,j]≤ω;
The distance between Q 'and Q is less than a certain range, namely distance | Q' -Q | is less than or equal to d;
among the points satisfying the conditions of i and ii, a point having the closest curvature is selected as a matching point, i.e., f (Q') ═ min | rQ′-ri+1,j|;
If the point meeting the conditions i and ii is not found, the point Q is considered to not find a matching point;
we will represent the corresponding points on model i found by model i +1 as a set of points { Q } respectively
1,Q
2,...,Q
vAnd { Q }
1′,Q
2′,...,Q
v' }, v denotes the number of found corresponding point pairs, the curvatures of which are expressed as
And
step five, calculating the curvature variance of the corresponding points
Step six, if g is less than or equal to sigma, outputting p 2; if g > σ, change p2 and repeat steps two through six.
f) Iterative optimization is carried out on the splicing result by adopting an ICP (iterative closed Point) iterative method, an optimization parameter in the formula 2 is solved to be p3, wherein the meaning of p3 is the same as that of p1, and coordinate transformation is carried out on the point cloud i +1 obtained in e) again;
f(p3)=∑||Mi,j-p3·Mi+1,j||2not min (formula 2)
To this end, we have a transformation matrix p (i) ═ p3 · p2 · p1 that splices the i +1 th point cloud with the i-th point cloud
(2) Stitching of multiple exposure measurements
The implementation steps are as shown in figure 5
According to the method described in (1), we can obtain P (1), P (2), P (3),.. multidot.P (n-1), and for the ith point cloud, the ith point cloud is spliced with the 1 st point cloud obtained by the first exposure measurement, and the coordinate transformation needed to be carried out is converted into
Wherein the content of the first and second substances,
representing transformation of the i +1 th angle measurement to the world coordinate system (X)
w,Y
w,Z
w,O
w) (i.e., the 1 st measurement angle coordinate system),
represents the coordinates of the (i + 1) th angle measurement result in the original coordinate system (i + 1) th measurement angle coordinate system), wherein H is recorded
i=P(1)·P(2)·P(3)·····P(i-1)。
And (5) converting the 2 nd to n th angle measurement results into a world coordinate system according to the steps, completing the splicing of multi-angle measurement, and reconstructing a complete three-dimensional model.
Experimental cases:
the hand-held three-dimensional scanning equipment described by the invention is used for scanning the human face, and the human face has uneven reflectivity due to complex color, so that the problem is well solved by using the automatic exposure adjustment technology of the invention. Fig. 6 is a three-dimensional scan of a person with six angles, and fig. 7 is a multi-angle presentation of the results of the automatic stitching after scanning.