CN115235375A - Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece - Google Patents
Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece Download PDFInfo
- Publication number
- CN115235375A CN115235375A CN202210838512.XA CN202210838512A CN115235375A CN 115235375 A CN115235375 A CN 115235375A CN 202210838512 A CN202210838512 A CN 202210838512A CN 115235375 A CN115235375 A CN 115235375A
- Authority
- CN
- China
- Prior art keywords
- workpiece
- point cloud
- point
- template
- edge point
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 79
- 230000002950 deficient Effects 0.000 claims abstract description 8
- 230000007547 defect Effects 0.000 claims abstract description 6
- 238000001914 filtration Methods 0.000 claims description 35
- 230000009466 transformation Effects 0.000 claims description 27
- 239000011159 matrix material Substances 0.000 claims description 16
- 238000009432 framing Methods 0.000 claims description 6
- 230000011218 segmentation Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 claims description 4
- 238000005070 sampling Methods 0.000 claims description 4
- 238000000844 transformation Methods 0.000 claims description 3
- 238000011426 transformation method Methods 0.000 claims description 3
- 238000013519 translation Methods 0.000 claims description 3
- 238000001514 detection method Methods 0.000 claims description 2
- 238000007781 pre-processing Methods 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 18
- 238000005259 measurement Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 239000000284 extract Substances 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 239000000463 material Substances 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000005553 drilling Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 238000000691 measurement method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/24—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
- G01B11/2433—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures for measuring outlines by shadow casting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- 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
- 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
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- 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/20—Special algorithmic details
- G06T2207/20024—Filtering details
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention discloses a method and a device for measuring multi-circle characteristic parameters of a cover plate type workpiece and a method and a device for detecting the multi-circle characteristic parameters of the cover plate type workpiece. The method comprises the following steps: scanning a template workpiece to obtain point cloud data, extracting template edge point cloud containing complete characteristic parameters of the workpiece after data preprocessing, selecting a datum hole, measuring and storing the parameters of the datum hole, measuring the residual characteristic parameters of the template point cloud by using an improved ransac algorithm, and positioning according to the relative position of the residual characteristic parameters and the datum hole; obtaining template edge point clouds, datum holes and template multi-circle characteristic parameters of the template workpiece; acquiring point cloud data of a workpiece to be detected, and extracting to obtain edge point cloud of the workpiece to be detected; registering the edge point cloud of the workpiece to be detected with the edge point cloud of the template; calculating the maximum error and the root mean square error of the corresponding points obtained by registration; and comparing whether the error is greater than the corresponding threshold value, determining whether the workpiece to be detected is a defective workpiece, measuring the characteristic parameters of the defective workpiece one by using an improved ransac algorithm, and positioning the position of the defect.
Description
Technical Field
The invention relates to a method, a method and a device for measuring multi-circle characteristic parameters of a cover plate type workpiece based on line laser scanning, and belongs to the technical field of 3D point cloud measurement.
Background
In modern industry, a three-coordinate measuring instrument is used for detecting traditional cover plate type workpieces, and the contact type detection method is high in cost, low in efficiency and easy to damage the detected workpieces. The line laser scanning technology has the advantages of non-contact, high speed, high precision and the like, and can effectively improve the automation degree of machine drilling and workpiece assembly and reduce the cost. The characteristic parameter measurement and the characteristic positioning of the cover plate type workpiece are realized by utilizing line laser scanning, and the automatic measurement of the cover plate type workpiece on an assembly line is realized, so that the cover plate type workpiece has higher research and application values in the characteristic parameter measurement technology of the cover plate type workpiece.
The first background art is as follows: the key of the method for measuring the characteristic parameters of the cover plate type workpiece based on line laser scanning is the extraction of edge point clouds in three-dimensional point clouds. Currently, methods for extracting edge feature points are classified into indirect methods and direct methods. The indirect method converts three-dimensional point cloud into a two-dimensional image, extracts image edges and converts the two-dimensional image into three-dimensional point cloud edge feature points, but the two-dimensional image edge representation point cloud edge inevitably ignores the geometric advantages of the three-dimensional point cloud, and information loss is caused; the direct method directly extracts edge feature points from the three-dimensional point cloud according to the spatial features and the correlation parameters, and retains complete three-dimensional point cloud information, so that the direct method is a research hotspot for extracting the edge feature points.
The second background art is as follows: RANdom SAmple Consensus (RANSAC) is the most commonly used feature estimation algorithm, and estimates mathematical model parameters from a set of observed data including outliers in an iterative manner, but the conventional RANSAC algorithm can only identify one of many features on a workpiece, and does not satisfy the condition for measuring the characteristic parameters of the cover-type workpiece.
The third background technology is as follows: for the measurement of a workpiece on an assembly line, in the prior art, the workpiece needs to be accurately fixed when a workpiece plane is detected, so that the pose of the workpiece is fixed, then the view of a measuring instrument is limited above a fixture for fixing the workpiece to obtain relatively accurate point cloud data, but for the working scenes such as the relatively complex workpiece and the production assembly line with poor conditions, the method cannot completely identify characteristics and measuring parameters. Meanwhile, the method can only extract the point cloud of the plane to be measured, and cannot realize the measurement of characteristic parameters such as circle center, radius and the like.
In summary, the problems of the prior art are as follows:
(1) The existing method for extracting the feature point cloud of the workpiece point cloud is to convert the three-dimensional point cloud into a two-dimensional image, extract the image edge, and convert the two-dimensional image into the feature point of the three-dimensional point cloud edge, which causes the loss of data information, and ignores the advantages that the line laser scanning point cloud has ordered data volume and is easy to operate.
(2) The existing ransac algorithm cannot be applied to a multi-feature fitting scene.
(3) The existing method needs to limit the pose of an object when detecting point cloud characteristics.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method and a device for measuring multi-circle characteristic parameters of a cover plate workpiece based on line laser scanning, and a foundation for detecting defects of the cover plate workpiece and further positioning the characteristic with larger error.
The invention has the difficulties of ensuring the applicability, acquiring the characteristics of complex workpieces, identifying any shape and automatically measuring on a production line for measuring the point cloud of the cover plate workpiece. If the characteristic parameters are required to be measured automatically and quickly at present, only simple characteristics can be detected, and only complex characteristics can be detected manually. Measurement of all the characteristic parameters of a complex cover plate type workpiece can be a difficult problem. The general method for measuring the characteristic parameters of the cover plate type workpiece based on line laser scanning enables 3D point cloud measurement to be applied to wider scenes, and meets more measurement requirements. Registration-based methods may enable 3D point cloud measurements to be applied on an industrial pipeline.
In a first aspect, a method for measuring multi-circle characteristic parameters of a cover plate workpiece is provided, which includes:
acquiring point cloud data of the whole workpiece obtained by line laser scanning;
carrying out filtering pretreatment on the point cloud data of the workpiece to obtain pretreated point cloud data;
constructing a kd tree topological structure for the preprocessed point cloud data, and segmenting and extracting edge point clouds according to vector included angle threshold values of the point clouds;
framing out circle feature point clouds serving as reference holes in the edge point clouds by utilizing an AreaPickingEvent function provided by pcl, fitting a framed circle feature point cloud coefficient by utilizing a least square method, and filtering out framed point clouds;
for edge point clouds except the circular feature point cloud of the reference hole, adopting an improved ransac algorithm to fit features, estimating the features in the edge point cloud by using a ransac algorithm, performing parameter fitting on one of the estimated multi-features each time, storing the fitted feature parameters, adopting direct filtering, deleting all point clouds in a certain range according with the parameters, and continuously estimating the features by using the ransac after the direct filtering; and circulating the operation until all the characteristics are extracted and the parameter data of the characteristics are stored to obtain the multi-circle characteristic parameters.
In some embodiments, the filtering pre-processing is performed on the point cloud data of the workpiece, including:
and (3) enabling the platform to coincide with the XOY plane after the point cloud data of the workpiece is subjected to rotary translation, filtering noise and the point cloud of the scanning platform by using straight-through filtering, and then obtaining the preprocessed point cloud data by statistical filtering.
In some embodiments, extracting the edge point cloud according to a vector angle thresholding of the point cloud comprises:
carrying out normal estimation on the preprocessed point cloud data, wherein the normals of all points in the plane are parallel;
solving the normal included angle between each point cloud and the adjacent point, and judging whether the normal included angle is larger than a set threshold value;
when the maximum value of the normal included angle is larger than the set threshold value, the point cloud is the edge point cloud.
In some embodiments, the multiple circle characteristic parameters include circle center, radius, and circle center distance.
In a second aspect, a method for detecting a workpiece such as a multi-circular cover plate comprises the following steps:
acquiring template edge point cloud, datum holes and template multi-circle characteristic parameters of the template workpiece by using the multi-circle characteristic parameter measuring method of the cover plate workpiece;
acquiring point cloud data of a workpiece to be detected, and extracting to obtain edge point cloud of the workpiece to be detected;
registering the edge point cloud of the workpiece to be detected with the edge point cloud of the template;
calculating the maximum error and the root-mean-square error of the corresponding points obtained by registration;
and determining whether the workpiece to be detected is a defective workpiece or not by comparing whether the maximum error and the root mean square error are larger than corresponding thresholds or not.
In some embodiments, the method for detecting a workpiece such as a multi-circular cover plate further includes:
responding to the workpiece to be measured as a defective workpiece, and measuring the workpiece by using the improved ransac algorithm to obtain all characteristic parameters of the workpiece to be measured;
comparing all characteristic parameters of the workpiece to be detected with corresponding template multi-circle characteristic parameters to obtain a comparison result;
and determining the position of the workpiece defect according to the comparison result.
In some embodiments, registering the edge point cloud of the workpiece to be measured with the template edge point cloud comprises:
carrying out rough registration on the edge point cloud of the workpiece to be detected and the template edge point cloud by adopting a sampling consistency initial registration algorithm;
and performing fine registration by adopting an iterative closest point algorithm ICP.
Further, coarse registration is carried out on the edge point cloud of the workpiece to be detected and the template edge point cloud by adopting a sampling consistency initial registration algorithm, and the method comprises the following steps:
(a1) Calculating the FPFH characteristics of the template edge point cloud P and the edge point cloud Q of the workpiece to be detected;
(a2) Collecting a plurality of points from the point cloud P to form a sub-point set, and regarding the points P in the point set i Finding a point Q in the point cloud Q that is similar to the FPFH characteristic of this point i Forming a corresponding point set;
(a3) Calculating rigid body transformation matrix according to corresponding point setCalculating a point pair error sum, wherein the error sum function is generally expressed in Huber and is denoted asTo find the optimal transformation matrix, where H (l) i ):
Wherein k is i To set the threshold,/ i Solving the distance difference of the corresponding points after rigid matrix transformation according to the ith group of corresponding points;
(a4) Finding out the transformation function with the minimum error sum function in all transformations, wherein the calculated result is the optimal transformation matrix;
(a5) Coarse registration is completed through the optimal transformation matrix;
further, an iterative closest point algorithm ICP is adopted for fine registration, and the method comprises the following steps:
(b1) Selecting an initial iteration point template edge point cloud P of an ICP algorithm and an edge point cloud Q of a workpiece to be detected;
(b2) For each point P in the point cloud P i Searching the corresponding point Q with the minimum Euclidean distance in Q i Forming a corresponding point set;
(b3) Solving matrixes R and T by using a rigid body transformation method through the corresponding point set, and calculating a target error function f (R, T) after transformation;
(b4) Completing rigid body transformation according to the target point sets of the matrixes R and T, and establishing a new corresponding point set according to the Euclidean distance closest point for the transformed point cloud;
(b5) And (3) judging whether the value of the target error function reaches an iteration condition, stopping iteration if the iteration condition is reached, and repeating the processes from (b 2) to (b 4) until the iteration condition is reached or the highest iteration times is reached.
In a third aspect, the invention provides a multi-circle characteristic parameter measuring device for a cover plate type workpiece, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to the first aspect.
In a fourth aspect, the present embodiment provides an apparatus for detecting a workpiece such as a multi-circular cover plate, including a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to the second aspect.
Has the beneficial effects that: compared with the prior art, the technical scheme of the invention has the following beneficial technical effects:
the invention discloses a method and a device for measuring multi-circle characteristic parameters of a cover plate type workpiece, and the method and the device are used for extracting the characteristic point cloud of the cover plate type workpiece point cloud more quickly and efficiently by utilizing the characteristics of line laser scanning point cloud, so that the problem that the characteristic parameters of a more complex workpiece are difficult to measure is solved. The method solves the problem of difficult measurement of the characteristic parameters of the workpieces with different poses in assembly line work through a registration technology, does not need to accurately fix the workpieces, is more flexible to use, is not limited to a single-plane model, is also suitable for a multi-plane model, is not influenced by the complexity of the workpieces, and has wider use scenes.
Drawings
Fig. 1 is a flowchart of a method for measuring characteristic parameters of a cover plate type workpiece in 3D point cloud measurement according to an embodiment of the present invention.
Fig. 2 is a flow chart of an implementation of the method for measuring characteristic parameters of a cover plate type workpiece in 3D point cloud measurement according to the embodiment of the invention.
Fig. 3 is a workpiece model provided by an embodiment of the invention.
Fig. 4 is a flowchart of an improved ransac point cloud multi-feature extraction method provided in the embodiment of the present invention.
Fig. 5 is a flow chart of rough registration of point clouds according to an embodiment of the present invention.
Fig. 6 is a flow chart of fine point cloud registration according to an embodiment of the present invention.
FIG. 7 is an edge point cloud extracted according to an embodiment of the invention.
Fig. 8 is a result of performing a modified ransac measurement of the workpiece shown in fig. 3.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific methods.
In the description of the present invention, the meaning of a plurality is one or more, the meaning of a plurality is two or more, and the above, below, exceeding, etc. are understood as excluding the present numbers, and the above, below, within, etc. are understood as including the present numbers. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Example 1
A multi-circle characteristic parameter measuring method for a cover plate workpiece comprises the following steps:
acquiring point cloud data of the whole workpiece obtained by line laser scanning;
carrying out filtering pretreatment on the point cloud data of the workpiece to obtain pretreated point cloud data;
constructing a kd tree topological structure for the preprocessed point cloud data, and extracting edge point clouds according to vector included angle threshold segmentation of the point clouds;
framing out circle feature point clouds used as reference holes in the edge point clouds by utilizing an AreaPickingEvent function provided by pcl, fitting the coefficient of the framed circle feature point clouds by utilizing a least square method, and filtering out the framed point clouds;
for edge point clouds except the circular feature point cloud of the reference hole, adopting an improved ransac algorithm to fit features, estimating the features in the edge point cloud by using a ransac algorithm, performing parameter fitting on one of the estimated multi-features each time, storing the fitted feature parameters, adopting direct filtering, deleting all point clouds in a certain range according with the parameters, and continuously estimating the features by using the ransac after the direct filtering; and circulating the operation until all the characteristics are extracted and the parameter data of the characteristics are stored to obtain the multi-circle characteristic parameters.
In some embodiments, the filtering pre-processing is performed on the point cloud data of the workpiece, including:
and (3) performing rotary translation on the point cloud data of the workpiece to enable the platform to be superposed with the XOY plane, filtering noise and the point cloud of the scanning platform by using straight-through filtering, and performing statistical filtering to obtain the preprocessed point cloud data.
In some embodiments, extracting the edge point cloud according to vector angle threshold segmentation of the point cloud comprises:
carrying out normal estimation on the preprocessed point cloud data, wherein the normals of all points in the plane are parallel;
calculating the normal included angle between each point cloud and the adjacent point of the point cloud, and judging whether the normal included angle is larger than a set threshold value or not;
in response to the maximum value of the normal included angle being greater than the set threshold, this point cloud is an edge point cloud.
In some embodiments, the multi-circle characteristic parameters include circle center, radius, and circle center distance.
The method comprises the following specific steps:
(1.1) firstly, the scanned workpiece point cloud is rotated and translated, so that the platform point cloud is rotated and translated to the XOY plane, and then through-pass filtering, all the point clouds can be stored only within a certain distance range from the XOY plane (namely the scanning platform), and thus most of noise and the point cloud of the scanning platform can be filtered. And then the scanned workpiece point cloud can be obtained through statistical filtering.
And (1.2) dividing and solving the edge point cloud of the workpiece point cloud according to the vector included angle threshold value of the point cloud. Firstly, normal estimation is carried out on the point cloud of the workpiece, and the normals of all points in the plane are parallel. Then, the normal angle between each point cloud and its adjacent point is calculated, and the variation range of the normal angle is judged. And finally, comparing whether the maximum value of the normal included angle is larger than the set threshold value, if so, judging that the point is an edge point, otherwise, judging that the point is an inner point.
(1.3) framing a dot cloud serving as a reference hole by using an AreaPickingEvent function provided by pcl, and fitting a point cloud coefficient of the framed circle feature by using a least square method.
Extracting the characteristics of the template edge point cloud except the reference hole by using an improved ransac algorithm and measuring parameters, wherein the method comprises the following steps of:
(2.1) because most of characteristics of the cover plate type workpiece are circles, the method does not exemplify the condition of other characteristics, and the geometric dimensions (including circle centers, radiuses, circle center distances and the like) of circle characteristic parameters can be calculated and stored by using a least square method;
and (2.2) for the multi-feature workpiece, adopting an improved ransac algorithm to fit features, estimating the features in the edge point cloud by using a ransac algorithm, performing parameter fitting on one of the features of the multi-features each time, storing the estimated feature parameters, adopting through filtering, deleting all point clouds within a certain range according with the parameters, and continuously using the ransac estimated features for the point clouds subjected to the through filtering. The operation is circulated until all the characteristics are extracted and the parameter data of the characteristics are stored;
and (2.3) because the features on the cover plate type workpiece are similar, different in size and indefinite in position, positioning all the features according to the position relation between the features and the reference holes.
As shown in fig. 4, the modified ransac procedure is as follows:
(1) Inputting a point cloud cluster, the number of initial selected points and a selected point threshold, and initializing a container cur _ model and a best _ model with the size of cluster.
(2) And randomly selecting points according to the number of the initial selected points, fitting a random model parameter, bringing all the points in the cluster into the model parameter, and setting a corresponding position in the cur _ model to be 1 when the degree of the deviation of the point from the model is within a point selection threshold value.
(3) And judging whether the point of 1 in cur _ model is more than best _ model, if so, assigning the cur _ model to best _ model, and initializing the cur _ model to enter the next iteration.
(4) Judging whether the iteration times are reached or the points which accord with the model are enough, if not, repeating the steps (2) and (3), if so, outputting and storing the model coefficient best _ model coef of best _ model, and erasing the point cloud data which accord with best _ model coef in the cluud by adopting direct filtering.
(5) And (4) adding 1 to the feature number, judging whether the fitting feature number reaches the feature number in the template, otherwise, circulating the steps (1) to (4), and if so, ending the circulation.
The method for obtaining best _ model coef is as follows:
(1) And (3) calculating the center (x, y) of the projection of the space circle on the XOY plane and the radius r of the center.
(2) And solving a plane equation of the space dot cloud data.
(3) And (3) solving the mapping of the circle center (x.y) and the circle center R in the plane, which are solved in the step (1), by utilizing the plane equation data solved in the step (2) and utilizing the cosine value of the included angle of the normal lines between the planes, namely the circle center coordinate (x, y, z) and the radius R of the space circle.
Example 2
A method for detecting a workpiece such as a multi-circular cover plate comprises the following steps:
acquiring template edge point cloud, reference holes and template multi-circle characteristic parameters of a template workpiece by using the multi-circle characteristic parameter measuring method of the cover plate type workpiece in the embodiment 1;
acquiring point cloud data of a workpiece to be detected, and extracting to obtain edge point cloud of the workpiece to be detected;
registering the edge point cloud of the workpiece to be detected with the edge point cloud of the template;
calculating the maximum error and the root mean square error of the corresponding points obtained by registration;
and determining whether the workpiece to be detected is a defective workpiece or not by comparing whether the maximum error and the root mean square error are larger than corresponding thresholds or not.
In some embodiments, further comprising:
responding to the workpiece to be measured as a defective workpiece, and measuring the workpiece by using the improved ransac algorithm to obtain all characteristic parameters of the workpiece to be measured;
comparing all characteristic parameters of the workpiece to be detected with corresponding template multi-circle characteristic parameters to obtain a comparison result;
and determining the position of the workpiece defect according to the comparison result.
In some embodiments, as shown in fig. 1, the preferred implementation steps are:
s101: scanning the integral point cloud of the template workpiece, manually selecting a reference hole point cloud of the template point cloud for measurement, marking and storing;
s102: measuring residual characteristic parameters of the template point cloud, and positioning and numbering according to the relative positions of the residual characteristic parameters and the reference holes;
s201: in the production line, point clouds obtained by scanning a workpiece to be detected are compared with point clouds of a template workpiece through registration, and the root mean square error of a corresponding point pair is obtained so as to judge the size error of the workpiece to be detected;
s202: and (4) the workpiece with larger error enters a rechecking stage, the template workpiece measuring method is used for measuring, the characteristic with larger parameter error is positioned, then the error characteristic is repaired or redone, and the error measurement is carried out again.
The invention mainly calls PCL library to realize the basic operation of point cloud through C + + programming, as shown in FIG. 2, the specific implementation steps are as follows:
the cover plate type workpiece used in the embodiment is a standard workpiece with multiple features, as shown in fig. 3, only data on the upper surface of the cover plate type workpiece can be acquired when the point cloud data is acquired by line laser scanning, and based on the features, the following operations are performed;
during the first measurement, point cloud data of a template workpiece need to be scanned;
initialization
(1) And scanning by using line laser to obtain integral point cloud of the workpiece to be detected, and storing the integral point cloud as a template point cloud model.
(2) The linear laser scans the workpiece to obtain point cloud data of the whole workpiece, the platform is overlapped with the XOY plane after the obtained point cloud is rotated and translated, and only the point cloud of the workpiece and a small amount of point clouds around the workpiece are stored by using direct filtering.
(3) And (3) denoising and filtering the model, wherein for some off-hole noise points which can appear in the tool material, the noise points need to be filtered through statistical filtering, and a topological relation kd tree of the point cloud is constructed.
Start measurement
The edge point cloud in the template point cloud can be detected according to the vector included angle threshold segmentation of the point cloud, namely:
firstly, normal estimation is carried out on the point cloud of the workpiece, and the normals of all points in the plane are parallel. Then, the normal angle between each point cloud and its adjacent point is calculated, and the variation range of the normal angle is judged. And finally, comparing whether the maximum value of the normal included angle is larger than the set threshold value, if so, judging that the point is an edge point, otherwise, judging that the point is an inner point.
And manually framing a dot cloud serving as a reference hole by using an AreaPickingEvent function provided by pcl, fitting a framing point cloud coefficient by using a least square method, and filtering the framed point cloud.
For the remaining point cloud data, as shown in fig. 4, the improved ransac algorithm is adopted to fit the features, the ransac algorithm is used to estimate the features in the complete point cloud, the estimated feature point cloud is saved, the ransac algorithm discards the estimated features, and the ransac estimation features are continuously used;
the modified ransac procedure is as follows:
(1) The method comprises the steps of inputting point cloud, initial point selection number and point selection threshold, and initializing container cur _ model and best _ model with the size of the cloud.
(2) And randomly selecting points according to the number of the initial selected points, fitting a random model parameter, bringing all the points in the cluster into the model parameter, and setting a corresponding position in the cur _ model to be 1 when the degree of the deviation of the point from the model is within a point selection threshold value.
(3) And judging whether the point of 1 in cur _ model is more than best _ model, if so, assigning the cur _ model to best _ model, and initializing the cur _ model to enter the next iteration.
(4) Judging whether the iteration times are reached or the points which accord with the model are enough, if not, repeating the steps (2) and (3), if so, outputting and storing the model coefficient best _ model coef of best _ model, and erasing the point cloud data which accord with best _ model coef in the cluud by adopting direct filtering.
(5) And (5) adding 1 to the feature number, judging whether the fitting feature number reaches the feature number in the template, if not, circulating the steps (1) to (4), and if so, ending the circulation.
The method for obtaining best _ modelcoef is as follows:
(1) And (3) calculating the center (x, y) of the projection of the space circle on the XOY plane and the radius r of the projection.
(2) And solving a plane equation of the space dot cloud data.
(3) And (3) solving the mapping of the circle center (x.y) and the circle center R on the plane, which are the circle center coordinates (x, y, z) and the radius R of the space circle, by using the plane equation data solved in the step (2) and the cosine value of the included angle of the normal lines between the planes.
Features other than the fiducial holes are located in their relative positions to the fiducial holes.
Pipelining
When a workpiece on the assembly line is measured, a laser and a lens can be fixed, point clouds of the workpiece are collected by the workpiece moving at a constant speed on the assembly line, similar to the operation of template point clouds, and edge point clouds in the point clouds of the workpiece to be measured are extracted and stored;
the point cloud to be measured and the template point cloud are registered, so that the influence of the poses of various workpieces to be measured on the production line can be ignored;
the Point cloud coarse registration uses a Point cloud coarse registration algorithm based on Fast Point Feature Histograms (FPFH), and the coarse registration algorithm uses a Sample Consensus Initial registration algorithm (SAC-IA), so before the algorithm is executed, the FPFH of the Point cloud should be calculated, and a flow chart is shown in fig. 5.
For two point clouds to be registered (template point clouds) and (point clouds to be registered), by comparing the FPFH characteristics of the points, two points with the most similar characteristics in the two point clouds are taken as corresponding point pairs and a corresponding point set is established, and the optimal rigid body transformation matrix is solved through the corresponding point set to complete coarse registration;
the specific steps of point cloud registration are as follows:
(1) And calculating the FPFH characteristics of the template point cloud P and the point cloud Q to be detected.
(2) Collecting a plurality of points from the point cloud P to form a sub-point set, and regarding the points P in the point set i Finding a point q in the point cloud that is similar to its FPFH signature i A set of corresponding points is formed.
(3) Calculating rigid transformation matrix according to the corresponding point set, calculating point pair error sum, wherein the error sum function is usually expressed by Huber and is noted asTo find the optimal transformation matrix, where H (l) i ):
In the above formula k i To set the threshold,/ i And solving the distance difference of the corresponding points after the rigid matrix transformation according to the ith group of corresponding points.
(4) Repeating the steps to find the transformation function with the minimum error sum function in all the transformations, and obtaining the calculated result, namely the optimal transformation matrix.
(5) The coarse registration is done by the optimal transformation matrix.
The point cloud fine registration technique uses an iterative closest point algorithm (ICP), and its general idea is as follows, and a flowchart is shown in fig. 6.
(1) Selecting initial iteration points P and Q of an ICP algorithm;
(2) For each point P in the point cloud P i Searching the corresponding point Q with the minimum Euclidean distance in Q i And forming a corresponding point set.
(3) Matrices R and T are solved by using a rigid body transformation method for the corresponding point sets, and a transformed target error function f (R, T) is calculated.
(4) And (4) completing rigid body transformation according to the target point sets of the matrixes R and T, and establishing a new corresponding point set according to the Euclidean distance closest point of the transformed point cloud.
(5) And (3) judging the value of the error function, stopping iteration when the iteration condition is reached, and repeating the process (3) until the iteration condition is reached or the maximum iteration times is reached.
After the registration is completed, successfully positioning the features on the workpiece to be measured, and calculating the size error between the point cloud to be measured and the template point cloud by using a method of calculating a root mean square error;
after the registration is finished, the maximum errors of the corresponding point pairs can be directly solved through the error sorting among the corresponding point pairs, and whether the maximum errors are larger than a set threshold value or not is judged, so that whether extremely individual defects exist in the workpiece to be detected or not can be determined.
The root mean square error approximately represents the size difference between the workpiece to be measured and the template workpiece by calculating the root mean square error of the point distances between corresponding point pairs of the source point cloud P and the target point cloud Q, and the smaller the root mean square error is, the smaller the error of the two point clouds is.
In the formula d pq The Euclidean distance of corresponding point pairs in the two point clouds, and N is the number of the corresponding point pairs.
And (4) the workpiece with larger error enters a rechecking stage, a measuring method of template point cloud is used for the workpiece, the characteristic with larger error is positioned, and the workpiece is modified or redone according to the error.
And re-entering the flow after modification.
As shown in fig. 7, after the edge point cloud is extracted, the proportion of interior points conforming to the model is high, and as long as the interior points selected by ransac are greater than a certain number, it can be ensured that the interior point parameters conform to a certain characteristic of multiple characteristics, and the improved ransac algorithm provides a measurement method for a workpiece with multiple characteristic parameters in a three-dimensional space.
Fig. 8 is a result of measuring characteristic parameters of multiple circles in the workpiece shown in fig. 3 by running the ransac algorithm according to the embodiment of the present invention, where the distance is a distance between the center of each circle fitted by ransac and the center of the manually framed circle, and as can be seen from the column of the radius, the error in the size of the workpiece fitted by the method is 30 × 100 (mm), and is 0.1mm.
According to the method for measuring the characteristics of the cover plate type workpiece based on the line laser scanning, the point cloud of the model which is fit by the ransac is filtered by adding the straight-through filtering link, so that the circulating execution of the ransac fitting of other characteristics is not influenced, and the coefficients of a plurality of characteristics can be successfully fitted in a three-dimensional space; the coarse registration by using the FPFH characteristic based on the edge point cloud can improve the operation speed and the precision of the registration.
Example 3
In a third aspect, the present embodiment provides a device for measuring multi-circle characteristic parameters of a cover plate-like workpiece, including a processor and a storage medium;
the storage medium is to store instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to embodiment 1.
Example 4
In a fourth aspect, the present embodiment provides an apparatus for detecting a workpiece such as a multi-circular cover plate, including a processor and a storage medium;
the storage medium is to store instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to embodiment 2.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only of the preferred embodiments of the present invention, and it should be noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the invention, and such modifications and adaptations are intended to be within the scope of the invention.
Claims (10)
1. A multi-circle characteristic parameter measuring method of a cover plate workpiece is characterized by comprising the following steps:
acquiring point cloud data of the whole workpiece obtained by line laser scanning;
carrying out filtering pretreatment on the point cloud data of the workpiece to obtain the pretreated point cloud data;
constructing a kd tree topological structure for the preprocessed point cloud data, and extracting edge point clouds according to vector included angle threshold segmentation of the point clouds;
framing out circle feature point clouds used as reference holes in the edge point clouds by utilizing an AreaPickingEvent function provided by pcl, fitting the coefficient of the framed circle feature point clouds by utilizing a least square method, and filtering out the framed point clouds;
for edge point clouds except the circular feature point cloud of the reference hole, adopting an improved ransac algorithm to fit features, estimating the features in the edge point cloud by using a ransac algorithm, performing parameter fitting on one of the estimated multi-features each time, storing the fitted feature parameters, adopting direct filtering, deleting all point clouds in a certain range according with the parameters, and continuously estimating the features by using the ransac after the direct filtering; and circulating the operation until all the characteristics are extracted and the parameter data of the characteristics are stored to obtain the multi-circle characteristic parameters.
2. The method for measuring the multi-circle characteristic parameters of the cover plate type workpiece according to claim 1, wherein the filtering pretreatment is performed on the point cloud data of the workpiece, and comprises the following steps:
and (3) performing rotary translation on the point cloud data of the workpiece to enable the platform to be superposed with the XOY plane, filtering noise and the point cloud of the scanning platform by using straight-through filtering, and performing statistical filtering to obtain the preprocessed point cloud data.
3. The method for measuring the multi-circle characteristic parameters of the cover plate type workpiece according to claim 1, wherein the extracting of the edge point cloud according to the vector included angle threshold segmentation of the point cloud comprises the following steps:
carrying out normal estimation on the preprocessed point cloud data, wherein the normals of all points in the plane are parallel;
solving the normal included angle between each point cloud and the adjacent point, and judging whether the normal included angle is larger than a set threshold value;
when the maximum value of the normal included angle is larger than the set threshold value, the point cloud is the edge point cloud.
4. The method of claim 1, wherein the characteristic parameters of multiple circles include center, radius, and circle center distance.
5. A method for detecting a workpiece such as a multi-circular cover plate is characterized by comprising the following steps:
acquiring template edge point cloud, reference holes and template multi-circle characteristic parameters of a template workpiece obtained by using the multi-circle characteristic parameter measuring method of the cover plate type workpiece of any one of claims 1 to 4;
acquiring point cloud data of a workpiece to be detected, and extracting to obtain edge point cloud of the workpiece to be detected;
registering the edge point cloud of the workpiece to be detected with the edge point cloud of the template;
calculating the maximum error and the root-mean-square error of the corresponding points obtained by registration;
and determining whether the workpiece to be detected is a defective workpiece or not by comparing whether the maximum error and the root mean square error are larger than corresponding thresholds or not.
6. The method of claim 5, further comprising:
responding to the fact that the workpiece to be measured is a defective workpiece, and measuring the workpiece by using the improved ransac algorithm to obtain all characteristic parameters of the workpiece to be measured;
comparing all characteristic parameters of the workpiece to be detected with corresponding template multi-circle characteristic parameters to obtain a comparison result;
and determining the position of the workpiece defect according to the comparison result.
7. The method for detecting a workpiece such as a multi-circular cover plate of claim 5, wherein registering the edge point cloud of the workpiece to be detected with the template edge point cloud comprises:
carrying out rough registration on the edge point cloud of the workpiece to be detected and the template edge point cloud by adopting a sampling consistency initial registration algorithm;
and performing fine registration by adopting an iterative closest point algorithm ICP.
8. The method of inspecting a workpiece such as a multi-circular cap plate according to claim 7,
carrying out coarse registration on the edge point cloud of the workpiece to be detected and the template edge point cloud by adopting a sampling consistency initial registration algorithm, wherein the coarse registration comprises the following steps:
(a1) Calculating the FPFH characteristics of the template edge point cloud P and the edge point cloud Q of the workpiece to be detected;
(a2) Collecting a plurality of points from the point cloud P to form a sub-point set, and regarding the points P in the point set i Finding a point Q in the point cloud Q which is similar to the FPFH characteristic of the point i Forming a corresponding point set;
(a3) Calculating rigid transformation matrix according to the corresponding point set, calculating point pair error sum, wherein the error sum function is usually expressed by Huber and is marked asTo find the optimal transformation matrix, where H (l) i ):
Wherein k is i To set the threshold,/ i Solving the distance difference of the corresponding points after the rigid matrix transformation according to the ith group of corresponding points;
(a4) Finding out the transformation function with the minimum error sum function in all transformations, wherein the calculated result is the optimal transformation matrix;
(a5) Coarse registration is completed through the optimal transformation matrix;
and/or performing fine registration by adopting an iterative closest point algorithm ICP, wherein the method comprises the following steps:
(b1) Selecting an initial iteration point template edge point cloud P of an ICP algorithm and an edge point cloud Q of a workpiece to be detected;
(b2) For each point P in the point cloud P i Searching Euclidean distance maximum in QSmall corresponding point q i Forming a corresponding point set;
(b3) Solving matrixes R and T by using a rigid body transformation method through the corresponding point set, and calculating a target error function f (R, T) after transformation;
(b4) Rigid body transformation is completed according to the target point sets of the matrixes R and T, and a new corresponding point set is established for the transformed point cloud according to the Euclidean distance closest point;
(b5) And (3) judging whether the value of the target error function reaches an iteration condition, stopping iteration if the iteration condition is reached, and repeating the processes from (b 2) to (b 4) until the iteration condition is reached or the highest iteration times is reached.
9. A multi-circle characteristic parameter measuring device for a cover plate type workpiece is characterized by comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of claims 1 to 4.
10. The detection device for the workpieces such as the multiple round cover plates is characterized by comprising a processor and a storage medium;
the storage medium is to store instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of claims 5 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210838512.XA CN115235375A (en) | 2022-07-18 | 2022-07-18 | Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210838512.XA CN115235375A (en) | 2022-07-18 | 2022-07-18 | Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115235375A true CN115235375A (en) | 2022-10-25 |
Family
ID=83674176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210838512.XA Pending CN115235375A (en) | 2022-07-18 | 2022-07-18 | Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115235375A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116403208A (en) * | 2023-06-07 | 2023-07-07 | 山东科技大学 | Roller cage shoe running state detection method and device based on laser radar point cloud |
CN116625243A (en) * | 2023-07-26 | 2023-08-22 | 湖南隆深氢能科技有限公司 | Intelligent detection method, system and storage medium based on frame coil stock cutting machine |
-
2022
- 2022-07-18 CN CN202210838512.XA patent/CN115235375A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116403208A (en) * | 2023-06-07 | 2023-07-07 | 山东科技大学 | Roller cage shoe running state detection method and device based on laser radar point cloud |
CN116403208B (en) * | 2023-06-07 | 2023-08-22 | 山东科技大学 | Roller cage shoe running state detection method and device based on laser radar point cloud |
CN116625243A (en) * | 2023-07-26 | 2023-08-22 | 湖南隆深氢能科技有限公司 | Intelligent detection method, system and storage medium based on frame coil stock cutting machine |
CN116625243B (en) * | 2023-07-26 | 2023-09-19 | 湖南隆深氢能科技有限公司 | Intelligent detection method, system and storage medium based on frame coil stock cutting machine |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112581457B (en) | Pipeline inner surface detection method and device based on three-dimensional point cloud | |
CN115235375A (en) | Multi-circle characteristic parameter measuring method, detecting method and device for cover plate type workpiece | |
CN107341802B (en) | Corner sub-pixel positioning method based on curvature and gray scale compounding | |
CN109559346B (en) | Method for positioning and dividing part to be measured in 3D point cloud measurement and scanner | |
CN110060338B (en) | Prefabricated part point cloud identification method based on BIM model | |
CN111862037A (en) | Method and system for detecting geometric characteristics of precision hole type part based on machine vision | |
CN111986308B (en) | Point cloud normal and curvature change based double-constraint surface error salient point identification method | |
CN112037203A (en) | Side surface defect detection method and system based on complex workpiece outer contour registration | |
CN108830888B (en) | Coarse matching method based on improved multi-scale covariance matrix characteristic descriptor | |
CN116402866A (en) | Point cloud-based part digital twin geometric modeling and error assessment method and system | |
CN111027484A (en) | Tunnel steel arch identification method based on three-dimensional imaging | |
CN113487722A (en) | Automatic concrete member detection method based on three-dimensional laser scanning method | |
CN112233116A (en) | Concave-convex mark visual detection method based on neighborhood decision and gray level co-occurrence matrix description | |
CN115597494B (en) | Precision detection method and system for prefabricated part preformed hole based on point cloud | |
CN115861351A (en) | Edge detection method, defect detection method and detection device | |
CN111968224A (en) | Ship 3D scanning point cloud data processing method | |
CN116188544A (en) | Point cloud registration method combining edge features | |
CN116402792A (en) | Space hole site butt joint method based on three-dimensional point cloud | |
CN113870326B (en) | Structural damage mapping, quantifying and visualizing method based on image and three-dimensional point cloud registration | |
CN107610174A (en) | A kind of plane monitoring-network method and system based on depth information of robust | |
CN116452826A (en) | Coal gangue contour estimation method based on machine vision under shielding condition | |
CN116385356A (en) | Method and system for extracting regular hexagonal hole features based on laser vision | |
Ping et al. | Verification of turning insert specifications through three-dimensional vision system | |
CN116481460B (en) | Apparent pit defect size detection method based on three-dimensional reconstruction model | |
Schwarzbauer et al. | Automated quality inspection of microfluidic chips using morphologic techniques |
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 |