CN112529891B - Method and device for identifying hollow holes and detecting contours based on point cloud and storage medium - Google Patents
Method and device for identifying hollow holes and detecting contours based on point cloud and storage medium Download PDFInfo
- Publication number
- CN112529891B CN112529891B CN202011520245.9A CN202011520245A CN112529891B CN 112529891 B CN112529891 B CN 112529891B CN 202011520245 A CN202011520245 A CN 202011520245A CN 112529891 B CN112529891 B CN 112529891B
- Authority
- CN
- China
- Prior art keywords
- point cloud
- point
- plane
- data
- hole
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000001514 detection method Methods 0.000 claims abstract description 16
- 239000011159 matrix material Substances 0.000 claims description 69
- 238000010276 construction Methods 0.000 claims description 34
- 101100030351 Schizosaccharomyces pombe (strain 972 / ATCC 24843) dis2 gene Proteins 0.000 claims description 11
- 238000000354 decomposition reaction Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 9
- 238000000605 extraction Methods 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 5
- 238000012163 sequencing technique Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000001914 filtration Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000000513 principal component analysis Methods 0.000 description 2
- 230000002035 prolonged effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000005094 computer simulation Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 208000029257 vision disease Diseases 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2135—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Computational Mathematics (AREA)
- Mathematical Optimization (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Analysis (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Length Measuring Devices By Optical Means (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the invention provides a method and a device for identifying hollow holes and detecting contours based on point clouds and a storage medium, belonging to the technical field of three-dimensional machine vision identification. In the hollow hole identification and contour detection method, device and storage medium based on point cloud, in the hollow hole detection process, ordered point cloud is built by utilizing the arrangement rule of image data, the connection between the built ordered point cloud and the point cloud projected to an XOY plane is directly built by means of KD tree, real-time and accurate hole point cloud and contour point cloud are built by judging Euclidean distance similarity, and then the size, area and positioning holes of the hollow holes are calculated according to the hole point cloud and the contour point cloud.
Description
Technical Field
The invention relates to the technical field of three-dimensional machine vision recognition, in particular to a method and a device for recognizing hollow holes and detecting outlines based on point clouds and a storage medium.
Background
The point cloud data contains three-dimensional coordinates (X, Y, Z) of the object, can provide accurate position and size information of the object, and plays an important role in the fields of unmanned aerial vehicle cruising, vision disorder auxiliary systems, industrial automation, robots, automatic driving, information management and control and the like.
As with the two-dimensional object contour acquisition method, three-dimensional object contour acquisition also requires contour information extraction by edge/boundary detection. Specifically, firstly, calculating the normal line of each point from the original point cloud, then judging which points are boundary points according to the included angle between the normal lines and the set angle threshold value, calculating the included angle between the normal line of each boundary point and the normal line is greatly influenced by the resolution of point cloud data, if the resolution is too small, a plurality of internal points can be judged as boundary points, and if the resolution is too large, the number of boundary points can be drastically reduced.
The existing boundary point determination technology generally comprises two steps: firstly, calculating the normal line of each point; and secondly, judging the boundary point through the normal included angle and the angle threshold value. Wherein the step of calculating the normal to each point generally comprises:
1. k neighbor searching is carried out on the data points, and a neighborhood is constructed; 2. constructing a covariance matrix for the neighborhood points;
3. solving eigenvalues and eigenvectors of the covariance matrix;
4. the feature vector corresponding to the minimum feature value is the normal direction.
And then judging the boundary point through the normal angle and the angle threshold value.
The two steps are sensitive to the neighborhood radius setting of point cloud search, the neighborhood radius is selected to be too small, noise is larger for normal line estimation, the estimated normal line is easy to be wrong, the neighborhood radius setting is too large, and the estimation speed is slower. For boundary estimation, a small point cloud searching neighborhood radius setting can enable a plurality of internal points to be judged as boundary points, a large searching neighborhood radius setting can enable boundary contours to become unclear, and meanwhile, the large searching neighborhood radius setting can lead to prolonged calculation time and cannot meet real-time requirements.
Disclosure of Invention
In view of the above, the invention aims to provide a method, a device and a storage medium for identifying hollow holes and detecting contours based on point clouds, which have the advantages of high accuracy and speed of contour detection and identification, insensitivity to the point cloud resolution and strong universality.
The technical scheme adopted by the invention for solving the technical problems is as follows:
the first aspect of the invention provides a method for identifying and detecting a hollow hole based on point cloud, which is characterized by comprising the following steps:
correcting a point cloud coordinate system by searching a plane in the original point cloud;
projecting the calibrated point cloud to an XOY plane;
constructing point cloud data similar to a picture arrangement rule;
and searching the outline point cloud and the point cloud of the hole position on the construction point cloud data on the point cloud projected onto the XOY plane by utilizing the KD tree and the constructed point cloud data.
In some embodiments, the constructing the point cloud data similar to the picture arrangement rule specifically includes:
acquiring the lengths W and H of the X axis and the Y axis of the point cloud projected on the XOY plane;
a new W 'value is built according to the characteristics of the data by utilizing the W value, a new H' value is built according to the characteristics of the data by utilizing the H value,
H'=H±M (8)
W'=W±N (9)
in the formulas (8) and (9), H and W are the range sizes of the X axis and the Y axis of the point cloud, M and N are positive integers, and H ', W' are the range sizes of the X axis and the Y axis of the ordered point cloud constructed after calculation;
and constructing mesh three-dimensional point cloud data similar to picture ordering by using the new W 'value and the new H' value.
In some embodiments, the correcting the point cloud coordinate system by searching for a plane in the original point cloud specifically includes:
extracting a plane from an original point cloud database;
calculating a plane normal vector;
acquiring a rotation matrix based on a plane normal vector;
and correcting the point cloud coordinate system by using the rotation matrix.
In some embodiments, the method for obtaining a rotation matrix based on a planar normal vector includes the steps of:
respectively calculating Ping Miandian cloud X, Y and Z axis direction average values;
calculating covariance matrixes of the point cloud along X, Y and Z axis directions;
performing eigenvalue decomposition matrix according to the covariance matrix;
a rotation matrix is acquired.
In some embodiments, the acquiring the rotation matrix specifically includes:
respectively calculating Ping Miandian cloud X, Y and Z axis direction mean values
The mean values of the triaxial directions are calculated according to Ping Miandian clouds respectively.
Calculating covariance matrix
The covariance in the X direction and Y direction is:
similarly, covariance Cov (X, Z) of X direction and Z direction, covariance Cov (X, X) of X direction and X direction, covariance Cov (Y, Y) of Y direction and Y direction, covariance Cov (Y, X) of Y direction and X direction, covariance Cov (Y, Z) of Y direction and Z direction, covariance Cov (Z, X) of Z direction and X direction, covariance Cov (Z, Y) of Z direction and Z direction, covariance Cov (Z, Z) of Z direction and Z direction, and covariance matrix for three-dimensional point cloud data is represented as a symmetric square of 3*3, expressed as follows:
eigenvalue decomposition matrix
Solving a feature vector:
Cv=λv (6)
in the expression (6), the vector v is one eigenvector of the matrix C, and λ is the eigenvalue corresponding to the eigenvector v.
Eigenvalue decomposition matrix:
C=Q∑Q -1 (7)
in the formula (7), Q is a matrix formed by eigenvectors of the matrix C, Σ is a diagonal matrix, and elements on the diagonal are eigenvalues.
Acquiring rotation matrices
Sequencing the feature values obtained in the previous step from large to small, wherein the feature vector corresponding to the minimum feature value is a vector in the Z-axis direction, namely a plane normal vectorThe feature vector corresponding to the next largest feature value is the vector +.>The feature vector corresponding to the largest feature value is the vector +.>The rotation matrix is +.>
In some embodiments, the searching the outline point cloud and the point cloud of the hole position on the construction point cloud data on the point cloud projected onto the XOY plane by using the KD-tree and the construction point cloud data specifically includes:
searching nearest neighbor points of each point on the mesh ordered point cloud on the point cloud data by utilizing the KD tree;
comparing the distance dis1 between the found neighbor point and the search point with the average distance dis2 between the neighbor point and the search point; when dis1 is larger than dis2, judging the searching point as a hole point, otherwise, judging the searching point as a non-hole point.
The second aspect of the invention also provides a hollow hole identification and contour detection device based on point cloud, which comprises a point cloud coordinate correction module, a point cloud projection module, a point cloud data construction module, a target point cloud searching module and a hole size acquisition module;
the point cloud coordinate correction module is used for correcting a point cloud coordinate system by searching a plane in the original point cloud;
the point cloud projection module is used for projecting the calibrated point cloud to an XOY plane;
the point cloud data construction module is used for constructing point cloud data similar to a picture arrangement rule;
the target point cloud searching module is used for searching a point cloud set of a contour point cloud and a hole position on the construction point cloud data on the point cloud projected to the XOY plane by utilizing the KD tree and the constructed point cloud data;
and the hole size acquisition module is used for acquiring hole size information and edge information according to the target point cloud set acquired by the target point cloud searching module.
In an embodiment, the point cloud data construction module includes a point cloud length acquisition unit, a data construction unit, and a three-dimensional point cloud construction unit;
the point cloud length acquisition unit is used for acquiring the X-axis and Y-axis direction lengths W and H of the point cloud projected onto the XOY plane;
the data construction unit is used for constructing a new W 'value according to the data characteristics by utilizing the W value and constructing a new H' value according to the data characteristics by utilizing the H value;
the three-dimensional point cloud construction unit is used for constructing mesh three-dimensional point cloud data similar to picture ordering by using the new W 'value and the new H' value.
In some embodiments, the point cloud coordinate correction module includes a point cloud extraction unit, a calculation plane unit, an acquisition rotation unit, and a coordinate correction unit;
the point cloud extraction unit is used for extracting a plane from the original point cloud database;
the calculating plane unit is used for calculating the normal vector of the extracting plane;
the rotation acquisition unit is used for acquiring a rotation matrix based on a plane normal vector;
the coordinate correction unit is used for correcting the point cloud coordinates by using the rotation matrix.
The present application also provides a computer readable storage medium comprising a processor, a computer readable storage medium and a computer program stored on the computer readable storage medium, which when executed by the processor, implements the steps of the method described above.
In the hollow hole identification and contour detection method and device based on the point cloud, in the process of detecting the hollow holes, the ordered point cloud is built by utilizing the arrangement rule of image data, the connection between the built ordered point cloud and the point cloud projected to the XOY plane is directly built by means of the KD tree, the real-time and accurate hole point cloud set and contour point cloud set are built by judging the Euclidean distance similarity, then the size and the area of the hollow holes and the position of the positioning holes are calculated according to the hole point cloud set and the contour point cloud set, and the contour detection identification accuracy is high, the speed is high, the point cloud resolution is insensitive, small holes can be accurately detected, threshold judgment conditions do not need to be set, and the method and device are more universal.
Drawings
FIG. 1 is a flow chart of an embodiment of a method for identifying and detecting a hollow hole based on a point cloud;
FIG. 2 is a flow chart of a method for correcting a point cloud coordinate system by finding a plane in an original point cloud according to an embodiment of the present invention;
FIG. 3 is a computer simulation diagram of a three-dimensional point cloud projected onto a two-dimensional plane according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for constructing point cloud data similar to a picture arrangement rule according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an ordered point cloud (z=0) with a 1-point-cloud space in accordance with an embodiment of the present invention;
FIG. 6 is a schematic view of an ordered point cloud and projected point cloud visualization according to an embodiment of the present invention;
FIG. 7 is a schematic view of extracted rough hole points according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of an embodiment of an aperture profile point cloud extracted from an original point cloud;
FIG. 9 is a block diagram illustrating an embodiment of a point cloud based hollow hole identification and contour detection apparatus according to an embodiment of the present invention;
fig. 10 is a block diagram of another embodiment of a device for identifying and detecting a hollow hole based on a point cloud according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical schemes and beneficial effects to be solved more clear and obvious, the invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Aiming at the fact that the setting of the neighborhood radius of the point cloud search in the object contour acquisition method in the prior art is sensitive, the neighborhood radius is selected to be too small, noise is larger for normal line estimation, errors are easy to occur in the estimated normal line, the setting of the neighborhood radius is too large, and the estimation speed is slower. For boundary estimation, a plurality of internal points can be judged as boundary points due to small point cloud searching neighborhood radius setting, boundary contours can become unclear due to large searching neighborhood radius setting, meanwhile, calculation time can be prolonged due to large searching neighborhood radius setting, and real-time requirements cannot be met. The following describes the embodiments of the present application in detail.
Embodiment one:
the invention provides a method for identifying hollow holes and detecting contours based on point clouds, referring to fig. 1, the method comprises the following steps:
s102, correcting a point cloud coordinate system by searching a plane in an original point cloud;
specifically, the correction of the point cloud coordinate system by searching for a plane in the original point cloud includes the steps of:
s1022, extracting a plane from the original point cloud database;
s1024, calculating a plane normal vector;
s1026, acquiring a rotation matrix based on a plane normal vector;
calculating a plane normal vector, correcting the extracted plane point cloud coordinate system based on the plane normal vector, enabling the X axis to be forward horizontal to the right, enabling the Y axis to be forward vertical to the ground upwards, and simultaneously obtaining a rotation matrix enabling the plane normal vector to be vertically upwards;
specifically, after a rotation matrix with a plane normal vector vertically upward is obtained, the rotation matrix is applied to an acquired original point cloud to obtain calibrated point cloud data (adjust_ps), and the rotation matrix is calculated according to the following principle:
the coordinate system where the principal component analysis construction plane is located specifically comprises:
(1) Respectively calculating Ping Miandian cloud X, Y and Z axis direction mean values
Respectively calculating the mean values of the triaxial directions according to Ping Miandian cloud;
n, N respectively represent the number of points in the point cloud, x i ,y i ,z i And coordinate values of X, Y and Z axes of the ith point in the point cloud are respectively represented.
(2) Calculating covariance matrix
The covariance in the X direction and Y direction is:
similarly, covariance Cov (X, Z) of X direction and Z direction, covariance Cov (X, X) of X direction and X direction, covariance Cov (Y, Y) of Y direction and Y direction, covariance Cov (Y, X) of Y direction and X direction, covariance Cov (Y, Z) of Y direction and Z direction, covariance Cov (Z, X) of Z direction and X direction, covariance Cov (Z, Y) of Z direction and Z direction, covariance Cov (Z, Z) of Z direction and Z direction, and covariance matrix for three-dimensional point cloud data is represented as a symmetric square of 3*3, expressed as follows:
(3) Eigenvalue decomposition matrix
Solving a feature vector:
Cv=λv (6)
in the expression (6), the vector v is one eigenvector of the matrix C, and λ is the eigenvalue corresponding to the eigenvector v.
Eigenvalue decomposition matrix:
C=Q∑Q -1 (7)
in the formula (7), Q is a matrix formed by eigenvectors of the matrix C, Σ is a diagonal matrix, and elements on the diagonal are eigenvalues.
(4) Acquiring rotation matrices
Sequencing the feature values obtained in the previous step from large to small, wherein the feature vector corresponding to the minimum feature value is a vector in the Z-axis direction, namely a plane normal vectorThe feature vector corresponding to the next largest feature value is the vector +.>The feature vector corresponding to the largest feature value is the vector +.>The rotation matrix is +.>
And S1028, correcting the point cloud coordinate system by using the rotation matrix, namely multiplying the point cloud by the rotation matrix.
S104, projecting the calibrated point cloud to an XOY plane;
specifically, the three-dimensional point cloud calibrated in step S102 is projected onto a two-dimensional plane, that is, the adjust_ps point cloud data is projected onto the XOY plane, so as to obtain point cloud data (adjust_ps_z) with all Z values of 0, as shown in fig. 3.
S106, constructing point cloud data (anchor point cloud) similar to a picture arrangement rule on the basis of the step S104;
referring to fig. 4, the construction of the point cloud data similar to the image arrangement rule specifically includes the steps of:
s1062, acquiring lengths W and H of X-axis and Y-axis directions of a point cloud projected onto an XOY plane;
s1064, constructing a new W 'value according to the data characteristics by using the W value, and constructing a new H' value according to the data characteristics by using the H value.
Specifically, a mesh ordered point cloud (adjust_ps_z_order) similar to a picture arrangement mode is constructed, wherein the length of the point cloud adjust_ps_ Z X in the axial direction is rounded up or subtracted by M (M is a positive integer), the length of the point cloud in the Y-axis direction is rounded up or subtracted by N (N is a positive integer), the Z value is 0, and the mesh ordered point cloud is as shown in fig. 5;
H'=H±M (8)
W'=W±N (9)
in the formulas (8) and (9), H and W are the range sizes of the X axis and the Y axis of the point cloud, M and N are positive integers, and H ', W' are the range sizes of the X axis and the Y axis of the ordered point cloud constructed after calculation.
The method for constructing the new values W 'and H' is obtained by using an operation method such as linear or exponential operation and the like; in the embodiment of the application, an ordered point cloud (z=0) with a distance between adjacent point clouds of 1 is constructed. As shown in fig. 6.
S1066, constructing mesh three-dimensional point cloud data similar to picture ordering by using new W 'values and H' values, wherein Z values are 0, the constructed point cloud space can be adjusted according to actual requirements, dense point clouds are constructed by default, and the distance between adjacent point clouds is 1. The distance unit is consistent with the original point cloud data unit.
S108, searching for a point cloud of a contour point cloud and a hole position on the construction point cloud data on the point cloud projected on the XOY plane by utilizing the KD tree and the constructed point cloud data, as shown in FIG. 6;
specifically, a KD (k-dimension) tree is utilized to search nearest neighbors of each point on the point cloud data adjust_ps_z, the distance (dis 1) between the found nearest neighbor point and the search point and the average distance (dis 2) between the found nearest neighbor point and the search point are compared, when dis1 is larger than dis2, the search point is judged to be a hole point, otherwise, the search point is judged to be a non-hole point. Obtaining a hole point set (set_holes) from mesh ordered point cloud adjustps z order after KD tree searching is finished, and obtaining a nearest neighbor point set (set_nn) of each point in the hole point set from point cloud data adjustps z by using a direct filtering method and the like after the hole point set is obtained, wherein the nearest neighbor point set (set_nn) corresponds to fig. 7 and 8; the formula is as follows:
dis1 is expressed as: the distance between the nearest neighbor point of each point on the ordered point cloud adjust ps z order and the search point;
dis2 is expressed as: the average inter-point distance, i.e., the average of each point's distance from its nearest neighbor.
S110, acquiring hole size information and edge information on the basis of the step S108.
Specifically, the distance (dis 1) between the found neighboring point and the search point is compared with the average distance (dis 2) between the neighboring points and the search point, and when dis1 is greater than dis2, the search point is judged to be a hole point, otherwise, the search point is judged to be a non-hole point. Obtaining a hole point set (set_holes) from mesh ordered point cloud adjust_ps_z_order and a nearest neighbor point set (set_nn) of each point in the hole point set from point cloud data adjust_ps_z after KD tree searching is completed, wherein the hole point sets (set_holes) and the nearest neighbor point sets (set_nn) correspond to fig. 7 and 8;
and calculating geometrical information such as the size and the area of the cavity by using the point cloud set in the last step.
According to the embodiment of the application, the hole point set (set_holes) and the nearest neighbor point set (set_nn) are used as data sources, the corrected original point cloud data set adjust_ps can be easily mapped back, hole areas and hole outlines of various sizes and shapes are measured and identified, and meanwhile the method disclosed by the embodiment of the invention is insensitive to point cloud resolution.
In the hollow hole identification and contour detection method based on the point cloud, in the process of detecting the hollow holes, ordered point clouds are built by utilizing an arrangement rule of image data, the connection between the built ordered point clouds and the point clouds projected to the XOY plane is directly built by means of KD trees, real-time and accurate hole point clouds and contour point clouds are built by judging Euclidean distance similarity, then the size and the area of the hollow holes and the position of the positioning holes are calculated according to the hole point clouds and the contour point clouds, and the contour detection identification accuracy is high, the speed is high, the point cloud resolution is insensitive, very small holes can be accurately detected, threshold judgment conditions are not required to be set, and the method is more universal.
Embodiment two:
the embodiment of the application also provides a device for identifying and detecting the hollow holes based on the point cloud, which is used for executing the specific implementation process for realizing the method for identifying and detecting the hollow holes based on the point cloud in the embodiment. Referring to fig. 9 and 10, the device 20 for identifying and detecting hollow holes based on point cloud comprises: the system comprises a point cloud coordinate correction module 201, a point cloud projection module 202, a point cloud data construction module 203, a target point cloud searching module 204 and a hole size acquisition module 205.
The point cloud coordinate correction module 201 is configured to correct a point cloud coordinate system by searching a plane in an original point cloud.
The point cloud coordinate correction module 201 includes a point cloud extraction unit 2011, a calculation plane unit 2012, an acquisition rotation unit 2013, and a coordinate correction unit 2014.
The point cloud extraction unit 2011 is configured to extract a plane from an original point cloud database;
the calculating plane unit 2012 is used for calculating the normal vector of the extracting plane;
the rotation acquisition unit 2013 is configured to acquire a rotation matrix based on a plane normal vector;
the coordinate correcting unit 2014 is configured to correct the point cloud coordinate by using the rotation matrix.
Specifically, after a rotation matrix with a plane normal vector vertically upward is obtained, the rotation matrix is applied to an acquired original point cloud to obtain calibrated point cloud data (adjust_ps), and the rotation matrix is calculated according to the following principle:
the coordinate system where the principal component analysis construction plane is located specifically comprises:
(1) Respectively calculating Ping Miandian cloud X, Y and Z axis direction mean values
The mean values of the triaxial directions are calculated according to Ping Miandian clouds respectively.
(2) Calculating covariance matrix
The covariance in the X direction and Y direction is:
the method can construct Cov (X, Z) of X direction and Z direction, cov (X, X) of X direction, cov (Y, Y) of Y direction and Y direction, cov (Y, X) of Y direction and X direction, cov (Y, Z) of Y direction and Z direction, cov (Z, X) of Z direction and X direction, cov (Z, Y) of Z direction and Y direction, cov (Z, Z) of Z direction and Z direction, and a symmetric square matrix of 3*3 for three-dimensional point cloud data covariance matrix, and the expression is as follows:
(3) Eigenvalue decomposition matrix
Solving a feature vector:
Cv=λv (6)
in the formula (6), the vector v is a eigenvector of the matrix C, and λ is an eigenvalue corresponding to the eigenvector v.
Eigenvalue decomposition matrix:
C=Q∑Q -1 (7)
in the formula (7), Q is a matrix formed by eigenvectors of the matrix C, Σ is a diagonal matrix, and elements on the diagonal are eigenvalues.
(4) Acquiring rotation matrices
Sequencing the feature values obtained in the previous step from large to small, wherein the feature vector corresponding to the minimum feature value is a vector in the Z-axis direction, namely a plane normal vectorFeature vector corresponding to the next largest feature valueVector of Y-axis direction +.>The feature vector corresponding to the largest feature value is the vector +.>The rotation matrix is +.>
The point cloud projection module 202 is configured to project the calibrated point cloud onto an XOY plane;
specifically, the three-dimensional point cloud corrected by the point cloud coordinate correction module 201 is projected onto a two-dimensional plane, that is, the adjust_ps point cloud data is projected onto the XOY plane, so as to obtain point cloud data (adjust_ps_z) with all Z values of 0.
The point cloud data construction module 203 is configured to construct point cloud data (anchor point cloud) similar to the picture arrangement rule.
Further, the point cloud data construction module 203 includes a point cloud length acquisition unit 2031, a data construction unit 2032, and a three-dimensional point cloud construction unit 2033.
The point cloud length obtaining unit 2031 is configured to obtain lengths W, H in X-axis and Y-axis directions of a point cloud projected onto an XOY plane;
the data construction unit 2032 is configured to construct a new W 'value according to the data characteristics by using the W value, and construct a new H' value according to the data characteristics by using the H value.
Specifically, a mesh ordered point cloud (adjust_ps_z_order) similar to a picture arrangement mode is constructed, wherein the length of the point cloud adjust_ps_ Z X in the axial direction is rounded up or subtracted by M (M is a positive integer), the length of the point cloud in the Y-axis direction is rounded up or subtracted by N (N is a positive integer), the width is wide, and the Z value is 0;
H'=H±M (8)
W'=W±N (9)
in the formulas (8) and (9), H and W are the range sizes of the X axis and the Y axis of the point cloud, M and N are positive integers, and H ', W' are the range sizes of the X axis and the Y axis of the ordered point cloud constructed after calculation.
The three-dimensional point cloud construction unit 2033 is configured to construct mesh three-dimensional point cloud data similar to picture ordering using new W 'values and H' values.
The target point cloud searching module 204 is configured to search, on the point cloud projected onto the XOY plane, a point cloud set of hole positions on the contour point cloud and the construction point cloud data by using the KD tree and the construction point cloud data.
Specifically, a KD (k-dimension) tree is utilized to search nearest neighbors of each point on the point cloud data adjust_ps_z, the distance (dis 1) between the found nearest neighbor point and the search point and the average distance (dis 2) between the found nearest neighbor point and the search point are compared, when dis1 is larger than dis2, the search point is judged to be a hole point, otherwise, the search point is judged to be a non-hole point. Obtaining a hole point set (set_holes) from mesh ordered point cloud adjust_ps_z_order after KD tree searching is finished, and obtaining a nearest neighbor point set (set_nn) of each point in the hole point set from point cloud data adjust_ps_z by using methods such as direct filtering;
the hole size obtaining module 205 obtains hole size information and edge information according to the target point cloud set obtained by the target point cloud searching module 204.
Specifically, the distance (dis 1) between the found neighboring point and the search point is compared with the average distance (dis 2) between the neighboring points and the search point, and when dis1 is greater than dis2, the search point is judged to be a hole point, otherwise, the search point is judged to be a non-hole point. After the KD tree search is completed, a hole point set (set_holes) from the mesh ordered point cloud adjust_ps_z_order and a nearest neighbor point set (set_nn) from each point in the hole point set of the point cloud data adjust_ps_z are obtained.
According to the point cloud-based hollow hole identification and contour detection device, a point cloud coordinate correction module 201 searches a plane in an original point cloud to correct a point cloud coordinate system, and a point cloud projection module 202 projects the corrected point cloud to an XOY plane; constructing, by the point cloud data construction module 203, point cloud data similar to a picture arrangement rule based on the point cloud projected to the XOY plane by the calibrated point cloud; and the target point cloud searching module 204 searches the point clouds of the outline point cloud and the hole positions on the construction point cloud data on the point clouds projected on the XOY plane by using the KD tree and the constructed point cloud data, and the hole size obtaining module 205 obtains hole size information and edge information according to the target point clouds obtained by the target point cloud searching module 204. When the device disclosed by the embodiment of the application is used for detecting the hollow holes, the outline detection and identification accuracy is high, the speed is high, and the point cloud resolution is insensitive.
In the process of detecting the hollow holes, the embodiment of the application utilizes the arrangement rule of image data to construct ordered point clouds, directly establishes the connection between the constructed ordered point clouds and the point clouds projected to the XOY plane by means of KD tree, establishes real-time and accurate hole point clouds and outline point clouds by judging Euclidean distance similarity, has high outline detection and identification accuracy and high speed, is insensitive to point cloud resolution, can accurately detect very small holes, does not need to set threshold judgment conditions, and has more universality.
Embodiment III:
according to an embodiment of the present invention, a computer readable storage medium is provided, on which a computer program is stored, where the computer program when executed by a processor implements the steps in the above-mentioned automatic adjustment method for wireless terminals, and specific steps are described in the first embodiment and are not repeated herein.
The memory in this embodiment can be used to store software programs as well as various data. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the cellular phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
According to an example of the present embodiment, all or part of the flow in the method of the above embodiment may be implemented by a computer program to instruct related hardware, where the program may be stored in a computer readable storage medium, such as a storage medium of a computer system, and the program may be stored in the storage medium of the computer system and executed by at least one processor in the computer system, to implement the flow including the embodiments of the methods as described above. The storage medium includes, but is not limited to, magnetic disks, flash disks, optical disks, read-Only Memory (ROM), and the like.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the present invention. Those skilled in the art will appreciate that many modifications are possible in which the invention is practiced without departing from its scope or spirit, e.g., features of one embodiment can be used with another embodiment to yield yet a further embodiment. Any modification, equivalent replacement and improvement made within the technical idea of the present invention should be within the scope of the claims of the present invention.
Claims (9)
1. The hollow hole identification and contour detection method based on the point cloud is characterized by comprising the following steps of:
correcting a point cloud coordinate system by searching a plane in the original point cloud;
projecting the calibrated original point cloud to an XOY plane; obtaining point cloud data with Z values of 0;
based on the point cloud data with the Z values of 0, constructing mesh ordered point cloud data similar to a picture arrangement rule;
determining a hole point on the point cloud data by utilizing the adjacent points of the KD tree and each point cloud in the mesh ordered point cloud data; the method specifically comprises the following steps:
searching adjacent points of each point cloud on the mesh ordered point cloud data by utilizing the KD tree;
comparing the distance dis1 between the found neighbor point and the search point with the average distance dis2 between the neighbor point and the search point; when dis1 is larger than dis2, judging the searching point as a hole point, otherwise, judging the searching point as a non-hole point.
2. The method for identifying and detecting the outline of the hollow hole based on the point cloud according to claim 1, wherein the construction of the mesh ordered point cloud data similar to the rule of picture arrangement specifically comprises the following steps:
acquiring the lengths W and H of the X axis and the Y axis of the point cloud projected on the XOY plane;
a new W 'value is built according to the characteristics of the data by utilizing the W value, a new H' value is built according to the characteristics of the data by utilizing the H value,
H'=H±M (8)
W'=W±N (9)
in the formulas (8) and (9), H and W are the range sizes of the X axis and the Y axis of the point cloud, M and N are positive integers, and H ', W' are the range sizes of the X axis and the Y axis of the ordered point cloud constructed after calculation;
and constructing mesh ordered point cloud data similar to a picture ordering rule by using the new W 'value and the new H' value.
3. The method for identifying and detecting the outline of the hollow hole based on the point cloud according to claim 1, wherein the correcting the point cloud coordinate system by searching the plane in the original point cloud specifically comprises:
extracting a plane from an original point cloud database;
calculating a plane normal vector;
acquiring a rotation matrix based on a plane normal vector;
and correcting the point cloud coordinate system by using the rotation matrix.
4. A method for identifying and detecting a hollow hole based on point cloud as claimed in claim 3, wherein said method for obtaining a rotation matrix based on a planar normal vector comprises the steps of:
respectively calculating Ping Miandian cloud X, Y and Z axis direction average values;
calculating covariance matrixes of the point cloud along X, Y and Z axis directions;
performing eigenvalue decomposition matrix according to the covariance matrix;
a rotation matrix is acquired.
5. The method for identifying and detecting the outline of the hollow hole based on the point cloud as claimed in claim 4, wherein the step of obtaining the rotation matrix comprises the following steps:
respectively calculating Ping Miandian cloud X, Y and Z axis direction mean values
Respectively calculating the mean values of the triaxial directions according to Ping Miandian cloud;
n, N respectively represent the number of points in the point cloud, x i ,y i ,z i Coordinate values of X, Y and Z axes of an ith point in the point cloud are respectively represented;
calculating covariance matrix
The covariance in the X direction and Y direction is:
similarly, covariance Cov (X, Z) of X direction and Z direction, covariance Cov (X, X) of X direction and X direction, covariance Cov (Y, Y) of Y direction and Y direction, covariance Cov (Y, X) of Y direction and X direction, covariance Cov (Y, Z) of Y direction and Z direction, covariance Cov (Z, X) of Z direction and X direction, covariance Cov (Z, Y) of Z direction and Z direction, covariance Cov (Z, Z) of Z direction and Z direction, and covariance matrix for three-dimensional point cloud data is represented as a symmetric square of 3*3, expressed as follows:
eigenvalue decomposition matrix
Solving a feature vector:
Cv=λv (6)
in the formula (6), the vector v is a feature vector of the matrix C, and lambda is a feature value corresponding to the feature vector v;
eigenvalue decomposition matrix:
C=Q∑Q -1 (7)
in the formula (7), Q is a matrix formed by eigenvectors of a matrix C, sigma is a diagonal matrix, and elements on the diagonal are eigenvalues;
acquiring rotation matrices
Sequencing the feature values obtained in the previous step from large to small, wherein the feature vector corresponding to the minimum feature value is a vector in the Z-axis direction, namely a plane normal vectorThe feature vector corresponding to the next largest feature value is the vector +.>The feature vector corresponding to the largest feature value is the vector +.>The rotation matrix is +.>
6. The hollow hole identification and contour detection device based on the point cloud is characterized by comprising a point cloud coordinate correction module, a point cloud projection module, a point cloud data construction module, a target point cloud searching module and a hole size acquisition module;
the point cloud coordinate correction module is used for correcting a point cloud coordinate system by searching a plane in the original point cloud;
the point cloud projection module is used for projecting the calibrated original point cloud to an XOY plane; obtaining point cloud data with Z values of 0;
the point cloud data construction module is used for constructing net ordered point cloud data similar to a picture arrangement rule based on the point cloud data with the Z value of 0;
the target point cloud searching module is used for determining a hole point on the point cloud data by utilizing the adjacent points of the KD tree and each point cloud in the mesh ordered point cloud data; comparing the distance dis1 between the found neighbor point and the search point with the average distance dis2 between the neighbor point and the search point; when dis1 is larger than dis2, judging the searching point as a hole point, otherwise, judging the searching point as a non-hole point;
and the hole size acquisition module is used for acquiring hole size information and edge information according to the hole points acquired by the target point cloud searching module.
7. The point cloud based hollow hole identification and contour detection device according to claim 6, wherein the point cloud data construction module comprises a point cloud length acquisition unit, a data construction unit and a three-dimensional point cloud construction unit;
the point cloud length acquisition unit is used for acquiring the X-axis and Y-axis direction lengths W and H of the point cloud projected onto the XOY plane;
the data construction unit is used for constructing a new W 'value according to the data characteristics by utilizing the W value and constructing a new H' value according to the data characteristics by utilizing the H value;
the three-dimensional point cloud construction unit is used for constructing mesh ordered point cloud data similar to a picture ordering rule by using new W 'values and H' values.
8. The method for identifying and detecting the outline of the hollow hole based on the point cloud as claimed in claim 7, wherein the point cloud coordinate correction module comprises a point cloud extraction unit, a calculation plane unit, an acquisition rotation unit and a coordinate correction unit;
the point cloud extraction unit is used for extracting a plane from the original point cloud database;
the calculating plane unit is used for calculating the normal vector of the extracting plane;
the rotation acquisition unit is used for acquiring a rotation matrix based on a plane normal vector;
the coordinate correction unit is used for correcting the point cloud coordinates by using the rotation matrix.
9. A computer readable storage medium, characterized by a computer program stored on the computer readable storage medium, which when executed by a processor, implements the steps of the method according to any of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011520245.9A CN112529891B (en) | 2020-12-21 | 2020-12-21 | Method and device for identifying hollow holes and detecting contours based on point cloud and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011520245.9A CN112529891B (en) | 2020-12-21 | 2020-12-21 | Method and device for identifying hollow holes and detecting contours based on point cloud and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112529891A CN112529891A (en) | 2021-03-19 |
CN112529891B true CN112529891B (en) | 2024-03-19 |
Family
ID=75002158
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011520245.9A Active CN112529891B (en) | 2020-12-21 | 2020-12-21 | Method and device for identifying hollow holes and detecting contours based on point cloud and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112529891B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113506211B (en) * | 2021-09-10 | 2022-01-07 | 深圳市信润富联数字科技有限公司 | Polishing method and device for hub rib window, terminal device and storage medium |
CN116753907B (en) * | 2023-08-18 | 2023-11-10 | 中国电建集团昆明勘测设计研究院有限公司 | Method, device, equipment and storage medium for detecting underground deep cavity |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012037490A (en) * | 2010-08-11 | 2012-02-23 | Pasuko:Kk | Data analysis device, data analysis method and program |
CN107590825A (en) * | 2017-07-31 | 2018-01-16 | 东南大学 | A kind of dot cloud hole method for repairing and mending based on SFM |
CN109147040A (en) * | 2018-08-28 | 2019-01-04 | 浙江大学 | Human body dot cloud hole method for repairing and mending based on template |
CN109993783A (en) * | 2019-03-25 | 2019-07-09 | 北京航空航天大学 | A kind of roof and side optimized reconstruction method towards complex three-dimensional building object point cloud |
CN110517193A (en) * | 2019-06-28 | 2019-11-29 | 西安理工大学 | A kind of bottom mounted sonar Processing Method of Point-clouds |
CN111145345A (en) * | 2019-12-31 | 2020-05-12 | 山东大学 | Tunnel construction area three-dimensional model construction method and system |
CN111222516A (en) * | 2020-01-06 | 2020-06-02 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | Method for extracting key outline characteristics of point cloud of printed circuit board |
CN111325837A (en) * | 2020-01-23 | 2020-06-23 | 江西理工大学 | Side slope DEM generation method based on ground three-dimensional laser point cloud |
CN111832582A (en) * | 2019-04-15 | 2020-10-27 | 中国矿业大学(北京) | Method for classifying and segmenting sparse point cloud by using point cloud density and rotation information |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9189862B2 (en) * | 2010-06-10 | 2015-11-17 | Autodesk, Inc. | Outline approximation for point cloud of building |
-
2020
- 2020-12-21 CN CN202011520245.9A patent/CN112529891B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012037490A (en) * | 2010-08-11 | 2012-02-23 | Pasuko:Kk | Data analysis device, data analysis method and program |
CN107590825A (en) * | 2017-07-31 | 2018-01-16 | 东南大学 | A kind of dot cloud hole method for repairing and mending based on SFM |
CN109147040A (en) * | 2018-08-28 | 2019-01-04 | 浙江大学 | Human body dot cloud hole method for repairing and mending based on template |
CN109993783A (en) * | 2019-03-25 | 2019-07-09 | 北京航空航天大学 | A kind of roof and side optimized reconstruction method towards complex three-dimensional building object point cloud |
CN111832582A (en) * | 2019-04-15 | 2020-10-27 | 中国矿业大学(北京) | Method for classifying and segmenting sparse point cloud by using point cloud density and rotation information |
CN110517193A (en) * | 2019-06-28 | 2019-11-29 | 西安理工大学 | A kind of bottom mounted sonar Processing Method of Point-clouds |
CN111145345A (en) * | 2019-12-31 | 2020-05-12 | 山东大学 | Tunnel construction area three-dimensional model construction method and system |
CN111222516A (en) * | 2020-01-06 | 2020-06-02 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | Method for extracting key outline characteristics of point cloud of printed circuit board |
CN111325837A (en) * | 2020-01-23 | 2020-06-23 | 江西理工大学 | Side slope DEM generation method based on ground three-dimensional laser point cloud |
Non-Patent Citations (4)
Title |
---|
Learning-Based Hole Detection in 3D Point Cloud Towards Hole Filling;Ramesh Ashok Tabib等;《Procedia Computer Science》;20200604;第171卷;475-482 * |
一种有序点云快速去飞点算法;罗国强等;《控制工程》;20200820;1-8 * |
一种用于点云配准的改进迭代最近点算法;李运川;《软件导刊》;20200930;第19卷(第09期);175-179 * |
三维点云模型孔洞边界识别的研究综述;王春香等;《现代制造工程》;20190731(第07期);157-162 * |
Also Published As
Publication number | Publication date |
---|---|
CN112529891A (en) | 2021-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111915677B (en) | Ship pose estimation method based on three-dimensional point cloud characteristics | |
CN108885791B (en) | Ground detection method, related device and computer readable storage medium | |
CN109752701B (en) | Road edge detection method based on laser point cloud | |
CN112529891B (en) | Method and device for identifying hollow holes and detecting contours based on point cloud and storage medium | |
EP2887315B1 (en) | Camera calibration device, method for implementing calibration, program and camera for movable body | |
CN111765882B (en) | Laser radar positioning method and related device thereof | |
CN107862735B (en) | RGBD three-dimensional scene reconstruction method based on structural information | |
Cheng et al. | Building boundary extraction from high resolution imagery and lidar data | |
CN110766719A (en) | Target tracking method, device and storage medium | |
CN113156407B (en) | Vehicle-mounted laser radar external parameter joint calibration method, system, medium and device | |
CN116255992A (en) | Method and device for simultaneously positioning and mapping | |
CN115937226A (en) | Fruit tree single tree segmentation method based on unmanned aerial vehicle Lidar point cloud data | |
CN111783722B (en) | Lane line extraction method of laser point cloud and electronic equipment | |
CN116188544A (en) | Point cloud registration method combining edge features | |
CN110736456A (en) | Two-dimensional laser real-time positioning method based on feature extraction in sparse environment | |
CN113487631A (en) | Adjustable large-angle detection sensing and control method based on LEGO-LOAM | |
CN111985507A (en) | Rock three-dimensional point cloud joint trace extraction method | |
CN117218350A (en) | SLAM implementation method and system based on solid-state radar | |
CN117495891B (en) | Point cloud edge detection method and device and electronic equipment | |
CN114187246A (en) | Focal length measuring method of laser marking machine | |
CN113985435A (en) | Mapping method and system fusing multiple laser radars | |
CN111104861B (en) | Method and apparatus for determining wire position and storage medium | |
CN111986299B (en) | Point cloud data processing method, device, equipment and storage medium | |
CN117197245A (en) | Pose restoration method and device | |
CN114283199B (en) | Dynamic scene-oriented dotted line fusion semantic SLAM method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |