Disclosure of Invention
In view of the above, the invention aims to provide a low-overlapping-rate warhead point cloud registration method based on line feature detection, so as to solve the problem of poor registration accuracy of warhead point cloud data with low overlapping rate.
In order to achieve the above purpose, the technical scheme of the invention is realized as follows:
a low-overlap-ratio warhead point cloud registration method based on line feature detection comprises the following steps:
s1, carrying out voxel downsampling on a source point cloud and a target point cloud;
S2, respectively carrying out central axis fitting on the source point cloud and the target point cloud after voxel downsampling, and registering the two fitted central axes to realize coarse registration of the source point cloud and the target point cloud;
s3, extracting linear bullet mark features of the source point cloud and the target point cloud after coarse registration by using a Hough transformation method;
s4, searching an optimal rotation angle based on linear bullet mark features extracted from a source point cloud and a target point cloud;
And S5, aligning the optimal rotation angle of the rotation of the source point cloud with the target point cloud, and finishing the fine registration of the source point cloud and the target point cloud.
Further, in step S1, the specific process of voxel downsampling the source point cloud and the target point cloud includes:
And constructing a three-dimensional voxel grid by using a cyclic voxel filtering method, gridding the source point cloud and the target point cloud, wherein each cube after gridding is a voxel, and all points in each voxel are replaced by gravity center points, so that voxel downsampling is completed.
Further, in step S2, the specific process of performing central axis fitting on the source point cloud and the target point cloud after voxel downsampling includes:
s21, layering a source point cloud and a target point cloud along a Y axis in the vertical direction, and then arbitrarily selecting four non-coplanar points for each layer 、、、Calculation points、、、Spherical center coordinates of the outer ball of (2)The calculation equation is as follows:
;
Wherein r represents the radius of the outer ball;
S22, fitting the spherical center coordinates obtained by calculation of each layer into a straight line, and centering all point coordinates of the source point cloud and the target point cloud based on the fitted straight line to form a new point set So that the point setEach point coordinate of (3),The coordinates of the i-th point are indicated,Representing the center point coordinates of the point cloud;
s23, solving covariance matrix Is to find a direction vector based on the eigenvalues and eigenvectors of (a)So that the point setAt the position ofThe variance of the projection in the direction is maximized, wherein,N represents a point setThe number of midpoint coordinates,Representing a set of pointsIn finding the direction of the first principal componentThereafter, alongSelecting a series of point coordinates in the direction, and calculating the position of each centralized point coordinate in the directionProjection in direction,Representing a set of pointsCoordinates of the ith point in (a) at maximum and minimumUniformly select a series ofValues corresponding to each of the fitted straight lines are obtainedPoint coordinates of values。
Further, in step S2, the fitted two central axes are registered, and the specific process for implementing coarse registration of the source point cloud and the target point cloud includes:
s24, determining the direction vectors and the center points of the two central axes;
S25, calculating a rotation matrix by using the direction vectors of the two central axes;
s26, obtaining a translation vector according to the difference between the center point of the central axis of the source point cloud and the center point of the central axis of the target point cloud after rotation by rotating the central axis of the source point cloud;
and S27, combining the rotation matrix and the translation vector into a transformation matrix to realize rough registration of the source point cloud and the target point cloud.
Further, in step S3, the specific process of extracting the linear bullet mark features from the source point cloud and the target point cloud after the coarse registration by using the hough transform method includes:
s31, each point in the source point cloud and the target point cloud after voxel downsampling The value of (2) is defined asCalculated by the following formula:
wherein, 、、Representation pointsK field covariance matrix eigenvalues;
If it is calculated that Greater than or equal to the set threshold value tau, then the point is identifiedIs a sharp characteristic point and is attributed to the target point cloudOr source point cloud;
S32, discretizing the parameter space of the Hough transformation into a regular icosahedron;
S33, cloud target points Or source point cloudThe voting result of each sharp feature point in the regular icosahedron is mapped to each face of the regular icosahedron to form a voting matrix of the parameter space;
And S34, performing linear bullet mark feature detection by using a modified Hough transform algorithm.
Further, in step S34, the specific process of performing the linear bullet feature detection using the modified hough transform algorithm includes:
S341, representing a straight line as a parameter (rho, theta, phi) in a voting matrix, wherein rho is the shortest distance from a point to the straight line, and theta and phi are direction angles;
s342, establishing an accumulator, voting each point in the source point cloud and the target point cloud in the accumulator according to the normal vector or the local characteristic of the point cloud, and finding out the combination of parameters (rho, theta, phi) higher than the set ballot number through peak detection to obtain the bullet mark linear characteristic or the bullet mark curve characteristic.
Further, in the process of detecting the linear bullet mark features by using the improved Hough transform algorithm, an iteration method is utilized to optimize the estimation of the linear parameters, and in the process of each iteration, least square is adopted as an error function to perform linear fitting, so that the current linear parameters are corrected.
Further, in step S4, the specific process of finding the optimal rotation angle based on the linear bullet mark features extracted from the source point cloud and the target point cloud includes:
s41 using a three-dimensional rotation matrix To the source point cloudRotating to obtain a rotated source point cloudWherein, the method comprises the steps of,Indicating the rotation angle;
s42, according to the target point cloud With rotated source point cloudsCalculating fitness functionThe calculation formula is as follows:
wherein, The point-of-view is indicated,Representing vectorsSum vectorThe dot product absolute value of (2), vectorAndRespectively belong to target point cloudsAnd source point cloud,AndThe parameters representing the gaussian function are represented by,AndRepresenting cloud at target pointAnd source point cloudFeature descriptors of corresponding point coordinates in the model;
s43, repeating the steps S41 and S42, and finding the maximum fitness function in the iteration times Corresponding rotation angleAs the optimum rotation angle.
Compared with the prior art, the invention has the following beneficial effects:
According to the method, filtering is performed on the source point cloud and the target point cloud, coarse registration of the source point cloud and the target point cloud is achieved through fitting of the central axis, then detection of linear bullet mark features is achieved through a Hough transformation method, finally an optimal rotation angle is found based on the detected linear bullet mark features, fine registration of the source point cloud and the target point cloud is achieved based on the optimal rotation angle, and based on the operation, accurate registration of bullet mark point cloud data can be achieved under the condition that the overlapping rate of the source point cloud and the target point cloud is 20% -60%.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not to be construed as limiting the invention.
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other.
In the description of the invention, it should be understood that the terms "center," "longitudinal," "transverse," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate orientations or positional relationships that are based on the orientation or positional relationships shown in the drawings, merely to facilitate describing the invention and simplify the description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be configured and operate in a particular orientation, and therefore should not be construed as limiting the invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", etc. may explicitly or implicitly include one or more such feature. In the description of the invention, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present invention, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, mechanically connected, electrically connected, directly connected, indirectly connected via an intervening medium, or in communication between two elements. The specific meaning of the above terms in the creation of the present invention can be understood by those of ordinary skill in the art in a specific case.
The invention will be described in detail below with reference to fig. 1-4 in connection with embodiments.
As shown in fig. 1 and fig. 2, the low overlap rate warhead point cloud registration method based on line feature detection provided by the inventive embodiment of the present invention includes the following steps:
And S1, carrying out voxel downsampling on the source point cloud and the target point cloud.
Because the acquired point cloud data on the surface of the bullet is more, the data quality of the point cloud data with noise can be reduced, the running time can be greatly increased due to the more point cloud data, in order to reduce the data of the point cloud data and filter the noise, a cyclic voxel filtering method is used for constructing a three-dimensional voxel grid, the source point cloud and the target point cloud are gridded, each cube after gridding is a voxel, the maximum value and the minimum value of the source point cloud and the target point cloud X, Y, Z axes (which are a conventional three-dimensional coordinate system in the point cloud, the Y axis is a coordinate axis in the vertical direction, and the X axis and the Z axis are two coordinate axes in the horizontal direction) are calculated, a three-dimensional boundary box is established according to the maximum value and the minimum value, the boundary box is divided into cubes with the size of the designated voxels, and all points in the cubes are replaced by the center of gravity point of each cube, so that the voxel downsampling of the source point cloud and the target point cloud is reduced.
A large amount of isolated point noise occupies operation and storage resources of a data processor, noise point filtering is carried out on bullet point cloud data, the calculated amount of data processing is greatly reduced, data blocking is prevented, and the subsequent point cloud processing efficiency is improved.
And S2, respectively carrying out central axis fitting on the source point cloud and the target point cloud after voxel downsampling, and registering the two fitted central axes to realize coarse registration of the source point cloud and the target point cloud.
As shown in fig. 3, a specific process of performing central axis fitting on the source point cloud and the target point cloud after voxel downsampling includes:
S21, layering a source point cloud and a target point cloud along a Y axis, and then arbitrarily selecting four non-coplanar points for each layer 、、、Calculation points、、、Spherical center coordinates of the outer ball of (2)The calculation equation is as follows:
;
Wherein r represents the radius of the outer ball.
By constructing a linear equation, the optimal sphere center solving coordinate in the least square sense is found by SVD。
S22, fitting the spherical center coordinates obtained by calculation of each layer into a straight line, and centering all point coordinates of the source point cloud and the target point cloud based on the fitted straight line to form a new point setSo that the point setEach point coordinate of (3),The coordinates of the i-th point are indicated,Representing the center point coordinates of the point cloud.
Centering all point coordinates of the source point cloud and the target point cloud by taking the end points of the fitted straight lines as origin points (0, 0), and actually moving the distribution of all point coordinates of the source point cloud and the target point cloud into a coordinate system taking the origin points (0, 0) as the center to form a new point set。
S23, solving covariance matrixIs to find a direction vector based on the eigenvalues and eigenvectors of (a)So that the point setAt the position ofThe variance of the projection in the direction is maximized, wherein,N represents a point setThe number of midpoint coordinates, i.e. the point setComprising a number n of coordinates of the points,Representing a set of pointsIn finding the direction of the first principal componentThereafter, alongSelecting a series of point coordinates in the direction, and calculating the position of each centralized point coordinate in the directionProjection in direction,Representing a set of pointsCoordinates of the ith point in (a) at maximum and minimumUniformly select a series ofValues corresponding to each of the fitted straight lines are obtainedPoint coordinates of values。
And finally, registering the central axis fitted by the source point cloud with the central axis fitted by the target point cloud to obtain a rough registration position of the source point cloud and the target point cloud with low overlapping rate on the coaxial line, wherein the specific process is as follows:
And S24, determining the direction vectors and the center points of the two central axes.
S25, calculating a rotation matrix by using the direction vectors of the two central axes.
S26, obtaining a translation vector according to the difference between the center point of the central axis of the source point cloud and the center point of the central axis of the target point cloud after rotation by rotating the central axis of the source point cloud.
And S27, combining the rotation matrix and the translation vector into a transformation matrix to realize rough registration of the source point cloud and the target point cloud.
And S3, extracting linear bullet mark features of the source point cloud and the target point cloud after coarse registration by using a Hough transformation method.
The specific process of step S3 includes:
s31, each point in the source point cloud and the target point cloud after voxel downsampling The value of (2) is defined asCalculated by the following formula:
wherein, 、、Representation pointsK field covariance matrix eigenvalues;
If it is calculated that Greater than or equal to the set threshold value tau, then the point is identifiedIs a sharp characteristic point and is attributed to the target point cloudOr source point cloudIf it is calculated thatIs smaller than the set threshold value tau, the point is identifiedTo smooth characteristic points, not attributable to the cloud of target pointsOr source point cloudTherefore, the purpose of enhancing sharp characteristics of bullet mark point clouds is achieved.
And S32, discretizing the parameter space of the Hough transform into a regular icosahedron.
This step can effectively find linear bullet features.
S33, cloud target pointsOr source point cloudThe voting result of each sharp feature point in (a) is mapped to each face of the positive icosahedron to form a voting matrix of the parameter space.
And S34, performing linear bullet mark feature detection by using a modified Hough transform algorithm.
In step S34, the specific process of performing linear bullet feature detection using the modified hough transform algorithm includes:
S341, representing a straight line as a parameter (ρ, θ, φ) in the voting matrix, wherein ρ is the shortest distance from the point to the straight line, and θ and φ are direction angles.
S342, establishing an accumulator, voting each point in the source point cloud and the target point cloud in the accumulator according to the normal vector or the local characteristic of the point cloud, finding out the combination of parameters (rho, theta, phi) higher than the set ballot number through peak detection, obtaining the bullet mark linear characteristic or bullet mark curve characteristic, mapping the bullet mark linear characteristic or bullet mark curve characteristic back to a three-dimensional space, and finishing the detection of the linear bullet mark characteristic.
In the process of detecting the linear bullet mark features by using an improved Hough transform algorithm, an iteration method is utilized to optimize the estimation of the linear parameters, and in the process of each iteration, the least square is adopted as an error function to perform linear fitting, so that the current linear parameters are corrected, and the detection accuracy is improved.
The fine bullet mark features on the surface of the bullet can be accurately identified by using the Hough transformation method.
And S4, searching an optimal rotation angle based on linear bullet mark features extracted from the source point cloud and the target point cloud.
The specific process of step S4 includes:
s41 using a three-dimensional rotation matrix To the source point cloudRotating to obtain a rotated source point cloudWherein, the method comprises the steps of,Indicating the rotation angle.
S42, according to the target point cloudWith rotated source point cloudsCalculating fitness functionThe calculation formula is as follows:
wherein, Representing dot product; Representing vectors Sum vectorDot product absolute value, vectorAndRespectively belong to target point cloudsAnd source point cloudHas been normalized; And Representing cloud at target pointAnd source point cloudFeature descriptors of corresponding point coordinates in the model; And The parameters of the Gaussian function are represented, the form of the function is regulated, the index part inside the function is the square of the difference value of vector point multiplication, the index part is Gaussian item, certain 'rewards' are given to the matched pair of vectors, and meanwhile, the matched pair of vectors are hardly influenced.
S43, repeating the steps S41 and S42, and finding the maximum fitness function in the iteration timesCorresponding rotation angleAs the optimum rotation angle.
According to the flow shown in FIG. 4, the largest fitness function is found within the number of iterationsCorresponding toThe angle is the optimal rotation angle.
And S5, aligning the optimal rotation angle of the rotation of the source point cloud with the target point cloud, and finishing the fine registration of the source point cloud and the target point cloud.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.