CN117934429A - Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching - Google Patents

Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching Download PDF

Info

Publication number
CN117934429A
CN117934429A CN202410113884.5A CN202410113884A CN117934429A CN 117934429 A CN117934429 A CN 117934429A CN 202410113884 A CN202410113884 A CN 202410113884A CN 117934429 A CN117934429 A CN 117934429A
Authority
CN
China
Prior art keywords
point
point cloud
passenger car
points
defect
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.)
Granted
Application number
CN202410113884.5A
Other languages
Chinese (zh)
Other versions
CN117934429B (en
Inventor
胡志恒
王佳怡
秦凯阳
任缪楠
王文劲
王斯冉
习爽
刘兴光
杨雨图
韩程
周海燕
刘�英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Forestry University
Original Assignee
Nanjing Forestry University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing Forestry University filed Critical Nanjing Forestry University
Priority to CN202410113884.5A priority Critical patent/CN117934429B/en
Publication of CN117934429A publication Critical patent/CN117934429A/en
Application granted granted Critical
Publication of CN117934429B publication Critical patent/CN117934429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30204Marker

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Length Measuring Devices With Unspecified Measuring Means (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a passenger car side wall board flatness detection method based on three-dimensional point cloud and contour matching, which comprises the following steps: acquiring one-frame three-dimensional point clouds of side wallboards of different types of passenger cars; preprocessing the three-dimensional point cloud to generate point cloud slice data; performing line segment fitting on the point cloud slice data, and storing a line segment function obtained by fitting, the number of acquired points and region division into a template library; performing point cloud preprocessing operation when collecting each frame of point cloud data of a measured piece, matching the point cloud preprocessing operation with point cloud slice data in a template library, setting a relevant defect threshold value, and judging whether a point is a defect point or not; unfolding the data into complete point cloud data of the side wall plate of the passenger car, and dividing out a defect area; and eliminating misjudgment points by using an abnormal point eliminating algorithm to obtain a defect area. The invention solves the problems that the detection time is too long due to the oversized side wall plate of the passenger car, and the detection is difficult due to the too small defects by adopting the contour matching method, thereby meeting the real-time and accurate defect detection on the complex curved surface of the side wall plate of the passenger car.

Description

Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching
Technical Field
The invention belongs to the field of machine vision nondestructive detection, and particularly relates to a passenger car side wall plate flatness detection method based on three-dimensional point cloud and contour matching.
Background
In the production and manufacturing process of large parts, manufacturing flaws such as texture damage of the object surface, welding seams generated in the material welding process, depressions generated when the materials are extruded and collided are unavoidable. If these flaws are not found in time and maintenance and repair are performed, the service life of the product will be greatly reduced, even with a great safety risk. Taking a side wall plate of a passenger car as an example, various defects on the side wall plate can greatly influence the strength and the appearance of the side wall plate, and even larger defects can cause the risk that paint and putty fall off together in the running process of a train. The appearance of the automobile body is mostly white primary color, the machine vision defect detection technology is poor in detection effect on the tiny defects with depth information, and the point cloud defect detection technology can well meet the requirements of extracting the defect characteristics of the side wall plate.
The detection of the surface quality of a product based on point cloud is a field worthy of intensive research and is also a key step in production, manufacture and product use and maintenance. The 3D point cloud defect detection techniques can be summarized into five categories: 1. based on the contour point cloud; 2. matching based on templates; 3. based on local geometric features; 4. based on the multi-modal point cloud data; 5. based on deep learning. The point cloud defect detection methods have the advantages that: the adaptability based on the contour point cloud is strong and the speed is high; the template matching is accurate and suitable for standard components, but the speed is low; the generalization capability is high based on local geometric features; the accuracy of the multi-mode point cloud is high, and the generalization is strong; irregular point clouds can be handled based on deep learning, but sample acquisition is difficult and less versatile. The side wall plate of the passenger car is large in size, small in defect characteristic and high in required precision, if the method is adopted, small defects are difficult to detect, and the detection time is too long.
Disclosure of Invention
The technical problem to be solved by the invention is to provide the passenger car side wall board flatness detection method based on three-dimensional point cloud and contour matching aiming at the defects in the prior art, and the method is to carry out data processing on the point cloud data of the cut point cloud data by slicing the point cloud data, so that the problem that the detection time is too long due to the too large size of the passenger car side wall board, and meanwhile, the problem that the detection is difficult due to too small defects is solved by adopting the contour matching method, thereby being capable of meeting the real-time and accurate defect detection on complex curved surfaces such as the passenger car side wall board and providing reliable data support for subsequent putty spraying on the surface of the passenger car side wall board.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
a passenger car side wall board flatness detection method based on three-dimensional point cloud and contour matching comprises the following steps:
step 1, acquiring one-frame three-dimensional point cloud data of side wallboards of different types of standard buses;
Step 2, preprocessing the obtained three-dimensional point cloud data, and generating a part of point cloud slice data by taking a Y coordinate as a main direction;
Step 3, carrying out line segment fitting on the point cloud slice data, fitting two straight line segments and two curve segments, recording the straight line segment function and the curve segment function obtained by fitting, and the number and the area division of the acquired points, and storing the obtained points and the area division into a template library;
Step 4, performing point cloud preprocessing operation when collecting each frame of point cloud data of the measured piece, extracting corresponding point cloud slice data from the template library which is made in the step 3 by taking the Y coordinate as a reference, matching the corresponding point cloud slice data with the collected first frame of point cloud data of the measured piece, calculating the shortest distance from each point in each frame of point cloud to a line segment which corresponds to the matched bus type in the template library, setting a relevant defect threshold, and when the calculated shortest distance is larger than the relevant defect threshold, determining the point as a defect point and recording the position and parameters of the point;
Step 5, after all point cloud slice data are acquired, expanding the point cloud slice data into complete point cloud data of the side wall plate of the passenger car according to Y coordinates, and dividing a defect area in the point cloud data;
and 6, eliminating misjudgment points by using an abnormal point eliminating algorithm, and finally obtaining the defect area information.
As a further improved technical scheme of the present invention, the step 1 specifically includes:
and taking one-frame three-dimensional point cloud data of the side wallboards of different types of standard buses by using the scanning device of the side wallboards of the buses.
As a further improved technical scheme of the present invention, the step 2 specifically includes:
step 2.1, filtering and denoising the frame of standard point cloud data obtained in the step 1, removing abnormal points and noise in the point cloud of the side wall plate, and performing downsampling on the point cloud data by using a uniform downsampling method;
and 2.2, adjusting the pose of the point cloud data of the side wall panel after the pretreatment is finished, and taking the Y coordinate axis as the main direction of the pose, namely, the Y coordinates of all points in the point cloud data are the same.
As a further improved technical scheme of the present invention, the step 3 specifically includes:
Step 3.1, taking the point cloud slice data obtained in the step 2 as an object, assuming that k points exist in the slice data P, and considering the points in the slice as a point set in the two-dimensional data because the Y coordinate values of the points are the same, i.e., each point is composed of an x coordinate and a z coordinate, then p= { (x 1,z1),(x2,z2),…,(xk,zk) };
Step 3.2, dividing the set P into four parts P 1、P2、P3、P4 according to the x coordinate, wherein P 1 and P 3 are curve part point sets, P 2 and P 4 are straight part point sets, assuming that there are m points in P 1, n points in P 3, a point in P 2, b points in P 4, and m+n+a+b=k;
step 3.3, fitting the straight line part in the slice data by using a least square method:
l(x)=a0+a1x (1);
Wherein l (x) is a fitted linear function, each point in the data to be fitted is brought into a least square method formula (1) to calculate a predicted value, and whether the linear fitting is reasonable or not is judged by a weighted error square sum The calculation formula of (2) is as follows:
Wherein ω (x i) >0 is the weight function in the range of x i, l (x i) is the fitted function value, f (x i) is the original value, and x i is the coordinate of the i-th point; when the weighted error square sum of the fitted straight line segments And if the least square is the least, the least square fitting is completed;
fitting P 2 by using a formula (1) and a formula (2) to obtain a straight-line segment function l 1 (x), and fitting P 4 by using the formula (1) and the formula (2) to obtain a straight-line segment function l 2 (x);
and 3.4, obtaining a curve segment equation in slice data by adopting a circle fitting method:
(X-x)2+(Z-z)2=r2 (3);
Wherein the center coordinates are (x, z), and the radius of the circle is r; the fitting process comprises the following steps:
Step 3.4.1, firstly randomly picking out different three points in a curve segment corresponding to a curve part point set, and fitting out a curve segment circle equation by utilizing the principle of three-point circle setting;
In step 3.4.2, since the curve segment in the slice data is smaller than one quarter circle, the fitted curve segment circle equation is converted into a function z=f (x), the points of the curve segment in the slice data are brought into the fitted function, a new z coordinate value is obtained, and a determination coefficient R 2 is obtained at the same time:
Wherein z i represents the true z-coordinate value of the ith point, Predictive z-coordinate value representing the ith point,/>Representing an average of true z coordinate values for all points;
When R 2 is less than 0.95, returning to the step 3.4.1, and randomly selecting three points again to perform curve fitting until R 2 is more than or equal to 0.95, and finishing the curve fitting;
Fitting P 1 by using the steps 3.4.1 and 3.4.2 to obtain a curve segment function f 1 (x), fitting P 3 by using the steps 3.3.1 and 3.3.2 to obtain a curve segment function f 2 (x);
And 3.5, repeating the steps 3.1 to 3.4, obtaining two straight line segment functions, two curve segment functions, the number of points in the point cloud slice data and region division in all passenger car types and the side wall plate point cloud slice data, and storing the fitted two straight line segment functions, two curve segment functions, the number of points in the point cloud slice data and region division and corresponding passenger car types into a template library.
As a further improved technical scheme of the present invention, the step4 specifically includes:
Step 4.1, acquiring three-dimensional point cloud data of a detected piece by utilizing a scanning device of a side wall board of the passenger car, and when the first frame of point cloud data is acquired, carrying out a preprocessing mode in the step 2.1 by a vertical horse, and simultaneously adopting a point cloud pose adjustment mode in the step 2.2 to enable Y coordinates of all points in the same frame of point cloud data to be the same;
step 4.2, calculating the number of points in the acquired first frame point cloud slice data, and finding the passenger car type closest to the calculated number of points in the first frame point cloud slice data in a template library and matching the passenger car type with the passenger car type;
Step 4.3, extracting two straight line segment functions and two curve segment functions corresponding to the matched passenger car type from a template library, dividing acquired point cloud slice data of the detected piece according to regions in the template library, dividing a set P corresponding to the point cloud slice data of the detected piece into four parts P 1、P2、P3、P4 according to x coordinates, wherein P 1 and P 3 are curve part point sets, P 2 and P 4 are straight line part point sets, and calculating the shortest distance from each point in each frame of the acquired point cloud slice data of the detected piece to the corresponding line segment function in the matched passenger car type;
Step 4.4, when obtaining the shortest distance from the point in the point set of the linear part of the measured object to the linear segment function, assuming that the linear segment function l 1 (x) is converted into a linear equation ax+bz+c=0, the shortest distance from the point to the linear segment is:
distance i in equation (5) is the shortest distance from point (x i,zi) to straight line segment l 1 (x);
Obtaining the shortest distance from each point in the P 2 point set of the tested piece to a straight line segment function l 1 (x) corresponding to the matched passenger car type in the template library by using the method of the step 4.4, and obtaining the shortest distance from each point in the P 4 point set of the tested piece to a straight line segment function l 2 (x) corresponding to the matched passenger car type in the template library;
Step 4.5, when obtaining the shortest distance from the point concentrated on the curve part of the measured object to the curve segment function, it is necessary to find the perpendicular point q 0 between the point and the curve, assuming a point P i(xi,zi concentrated on the point P 1 of the measured object), taking a point q τ on the curve segment function f 1 (x), obtaining the direction vector of the tangent line at the point q τ P i(xi,zi) and q τ are each a segment direction vector/>Setting a correlation threshold k, if/>Q τ is the calculated point P i(xi,zi) to the perpendicular point q 0 between the curve segment functions f 1 (x), otherwise, adding a step size, searching the next point on the curve segment function f 1 (x), repeating the step of finding the perpendicular point until the/>Conditions of (2); after the perpendicular point q 0 = (x, z) is found, the shortest distance from the point P i(xi,zi to the curve segment function f 1 (x) can be found:
Distance i in equation (6) is the shortest distance from point P i(xi,zi) to curve segment function f 1 (x);
Calculating the shortest distance from each point in the P 1 point set of the tested piece to a curve segment function f 1 (x) corresponding to the matched passenger car type in the template library by using the method of the step 4.5, and calculating the shortest distance from each point in the P 3 point set of the tested piece to a curve segment function f 2 (x) corresponding to the matched passenger car type in the template library;
Step 4.6, setting a relevant defect threshold epsilon, respectively comparing the shortest distance between each point in the P 2 point set of the tested piece and a straight line segment function l 1 (x) corresponding to the matched passenger car type in the template library, the shortest distance between each point in the P 4 point set of the tested piece and a straight line segment function l 2 (x) corresponding to the matched passenger car type in the template library, the shortest distance between each point in the P 1 point set of the tested piece and a curve segment function f 1 (x) corresponding to the matched passenger car type in the template library, and the shortest distance between each point in the P 3 point set of the tested piece and a curve segment function f 2 (x) corresponding to the matched passenger car type in the template library with the relevant defect threshold epsilon, and if a certain shortest distance is larger than the relevant defect threshold epsilon, the point in the tested piece corresponding to the shortest distance is a defect point, and recording the shortest distance corresponding to the defect point and the position of the defect point;
and step 4.7, after the step 4.1 and the step 4.2 are performed, each frame of point cloud slice data of the measured piece is acquired, namely, the step 4.2 to the step 4.6 are circulated once.
As a further improved technical scheme of the present invention, the step5 specifically includes:
and 5.1, when all the point cloud slice data of the side wall plate of the measured piece are acquired, expanding all the acquired point cloud slice data according to the Y direction to obtain the point cloud data of the whole side wall plate, and marking the defect area consisting of the defect points.
As a further improved technical scheme of the present invention, the step 6 specifically includes:
step 6.1, extracting all defect areas, and dividing the extracted defect areas into a defect area 1, a defect area 2 and a … defect area n;
step 6.2, assuming that the set of points in the defect area j is Q, j=1, 2,3 … n, calculating the minimum bounding box of all points in the set Q, obtaining the volume T of the minimum bounding sphere, setting a relevant threshold value gamma, and when T < gamma, recognizing the defect area as a misjudgment area and correcting the misjudgment area as a non-defect area;
And 6.3, detecting all the defect areas according to the step 6.2, removing the misjudgment areas in the defect areas, and finally obtaining the defect areas.
The beneficial effects of the invention are as follows:
(1) According to the invention, a template library of the side wall boards of the passenger car is built, and standard side wall boards of different types of passenger cars are stored in the template library, so that the algorithm can be self-adaptive to flatness detection of the side wall boards of various types of passenger cars, and even if a brand new side wall board of the passenger car is manufactured, the side wall board of the passenger car can be detected by only scanning the side wall board once and storing the side wall board in the template library, and the problem of poor adaptability is solved.
(2) According to the invention, the point cloud outline of each frame is processed instead of the whole point cloud after the scanning is finished, so that the problem of overlong time for processing the whole point cloud data is avoided, the extraction of the defect area can be performed while the point cloud data of the side wall plate is acquired, and the time required for operation is greatly reduced.
(3) The invention uses the point cloud contour to carry out template matching, amplifies the defect characteristics in detection, and solves the problems of small defect detection precision and incapability of detecting small defects caused by overlarge size of the side wall plate of the passenger car.
(4) According to the method, all the obtained point cloud slice data are spliced into complete side wall plate point cloud data, the defect areas are marked, and the defect areas which are misjudged are corrected into the defect-free areas by using an abnormal area removing algorithm, so that the problem of errors caused by hardware is solved, meanwhile, the coordinates and depth information of the defect areas can be obtained, and a reliable data source is provided for subsequent side wall plate putty surface spraying.
(5) According to the invention, through slicing point cloud data and carrying out data processing on the sliced point cloud data, the problem that the detection time is too long due to the fact that the size of the side wall plate of the passenger car is too large is solved, meanwhile, the problem that the detection is difficult due to too small defects is solved by adopting a contour matching method, the real-time and accurate defect detection on complex curved surfaces such as the side wall plate of the passenger car can be met, and reliable data support is provided for subsequent putty spraying on the surface of the side wall plate of the passenger car.
Drawings
FIG. 1 is a flowchart of the method for detecting the flatness of a side wall panel of a passenger car.
Fig. 2 is a profile of a standard point cloud of sidewall panels.
Fig. 3 is a profile of a point cloud of a sidewall defect type.
FIG. 4 is a full point cloud of the sidewall panel
Fig. 5 is a view of the real defect area in fig. 4.
A in fig. 5 is an enlarged view of the real defect area in fig. 4.
B in fig. 5 is a simple real defect area diagram.
Detailed Description
The following is a further description of embodiments of the invention, with reference to the accompanying drawings:
a passenger car side wall board flatness detection method based on three-dimensional point cloud and contour matching, as shown in figure 1, comprises the following steps:
step 1, acquiring one-frame three-dimensional point cloud data of side wallboards of different types of standard buses;
Step 2, preprocessing the obtained three-dimensional point cloud data, and generating a part of point cloud slice data by taking a Y coordinate as a main direction;
Step 3, carrying out line segment fitting on the point cloud slice data, fitting two straight line segments and two curve segments, recording the straight line segment function and the curve segment function obtained by fitting, and the number and the area division of the acquired points, and storing the obtained points and the area division into a template library;
Step 4, performing point cloud preprocessing operation when collecting each frame of point cloud data of the measured piece, extracting corresponding point cloud slice data from the template library made in the step 3 by taking the Y coordinate as a reference, matching the corresponding point cloud slice data with the first frame of point cloud data of the measured piece, calculating the shortest distance from each point in each frame of point cloud of the measured piece to a line segment corresponding to a matched bus type in the template library, setting a relevant defect threshold, and when the calculated shortest distance is larger than the relevant defect threshold, determining the point as a defect point and recording the position and parameters of the point;
Step 5, after all point cloud slice data are acquired, expanding the point cloud slice data into complete point cloud data of the side wall plate of the passenger car according to Y coordinates, and dividing a defect area in the point cloud data;
and 6, eliminating misjudgment points by using an abnormal point eliminating algorithm, and finally obtaining the defect area information.
The step 1 specifically comprises the following steps:
step 1.1, build passenger train side wall board scanning device (adopting current structure), including scanning equipment (camera), base, support, cantilever beam, servo motor etc.. The base and support structure of the scanning equipment mainly comprises an independent first slide rail, an independent second slide rail, a cantilever beam connecting piece, a support frame main body, a base and the like; the independent slide rail I and the independent slide rail II are used for controlling the distance between the camera and the measured object; considering the resolution and effective acquisition area of the line laser scanning camera, six camera placement points are arranged on the cantilever Liang Xiangji support frame in total so as to ensure that the surface data of the whole side wall plate can be acquired at one time;
Step 1.2, a total of four servo motors are used for controlling the whole device to perform scanning movement, wherein two motors are placed at the joint of the support frame and the cantilever beam and used for controlling the back-and-forth movement and the up-and-down movement of the cantilever beam, the distance between the line laser scanning camera and the measured piece is adjusted, and the remaining two motors are used for controlling the movement of the base on the slide rail, so that the line laser scanning camera is moved to collect three-dimensional data of the measured piece.
The step 2 specifically comprises the following steps:
Step 2.1, carrying out filtering and denoising pretreatment operation on the frame of standard point cloud data obtained in the step 1, removing abnormal points and noise in the point cloud of the side wall plate, and carrying out downsampling treatment on the point cloud data by using a uniform downsampling method so as to reduce the subsequent treatment time;
step 2.2, adjusting the pose of the point cloud data of the side wall panel after the pretreatment is finished, and taking a Y coordinate axis as a main direction of the pose, namely, the Y coordinates of all points in the point cloud data are the same;
The step 3 specifically comprises the following steps:
Step 3.1, taking the point cloud slice data obtained in the step 2 as an object, assuming that k points exist in the slice data P, and considering the points in the slice as a point set in the two-dimensional data because the Y coordinate values of the points are the same, i.e., each point is composed of an x coordinate and a z coordinate, then p= { (x 1,z1),(x2,z2),…,(xk,zk) };
Step 3.2, as shown in fig. 2, fig. 2 is a profile diagram of a standard point cloud of a sidewall plate, and the set P is divided into four parts P 1、P2、P3、P4 according to an x coordinate, wherein P 1 and P 3 are curve part point sets, P 2 and P 4 are straight part point sets, and it is assumed that m points exist in P 1, n points exist in P 3, a points exist in P 2, b points exist in P 4, and m+n+a+b=k;
step 3.3, fitting the straight line part in the slice data by using a least square method:
l(x)=a0+a1x (1);
Wherein l (x) is a fitted linear function, and the general experience shows that l (x) is a unitary linear function; each point in the data to be fitted is brought into a least square method formula (1) to calculate a predicted value, and whether the straight line fitting is reasonable or not is judged through a weighted error square sum The calculation formula of (2) is as follows:
Wherein ω (x i) >0 is the weight function in the range of x i, l (x i) is the fitted function value, f (x i) is the original value, and x i is the coordinate of the i-th point; when the weighted error square sum of the fitted straight line segments And if the least square is the least, the least square fitting is completed;
fitting P 2 by using a formula (1) and a formula (2) to obtain a straight-line segment function l 1 (x), and fitting P 4 by using the formula (1) and the formula (2) to obtain a straight-line segment function l 2 (x);
Step 3.4, the manufacturing process can know that the curve part in the contour of the passenger car side wall panel approximates to an arc, so that a curve segment equation in slice data is obtained by adopting a circle fitting method:
(X-x)2+(Z-z)2=r2 (3);
Wherein the center coordinates are (x, z), and the radius of the circle is r; the fitting process comprises the following steps:
Step 3.4.1, firstly randomly picking out different three points in a curve segment corresponding to a curve part point set, and fitting out a curve segment circle equation by utilizing the principle of three-point circle setting;
In step 3.4.2, since the curve segment in the slice data is significantly smaller than a quarter circle, the fitted curve segment circle equation can be converted into a function z=f (x), one x corresponds to one z, the points of the curve segment in the slice data are brought into the fitted function to obtain a new z coordinate value, and meanwhile, the determination coefficient R 2 is obtained:
Wherein z i represents the true z-coordinate value of the ith point, Representing the predicted z-coordinate value of the ith point, i.e., the z-value calculated by the fitted function,/>Representing an average of true z coordinate values for all points;
When R 2 is less than 0.95, returning to the step 3.4.1, and randomly selecting three points again to perform curve fitting until R 2 is more than or equal to 0.95, and finishing the curve fitting;
Fitting P 1 by using the steps 3.4.1 and 3.4.2 to obtain a curve segment function f 1 (x), fitting P 3 by using the steps 3.3.1 and 3.3.2 to obtain a curve segment function f 2 (x);
And 3.5, repeating the steps 3.1 to 3.4, obtaining two straight line segment functions, two curve segment functions, the number of points in the point cloud slice data and region division in all passenger car types and the side wall plate point cloud slice data, and storing the fitted two straight line segment functions, two curve segment functions, the number of points in the point cloud slice data and region division and corresponding passenger car types into a template library.
The step 4 specifically comprises the following steps:
Step 4.1, acquiring three-dimensional point cloud data of a detected piece along a ground rail by using a passenger car side wall plate scanning device, and when first frame point cloud data is acquired, carrying out a preprocessing mode in step 2.1 by a vertical horse, and simultaneously adopting a point cloud pose adjustment mode in step 2.2 to enable Y coordinates of all points in the same frame point cloud data to be the same;
Step 4.2, according to experience, the number of points in the point cloud slice data of the side wall boards of the passenger car in different types is greatly different, so that the number of points in the acquired first frame point cloud slice data is calculated, and the passenger car type closest to the calculated number of points in the first frame point cloud slice data is found in a template library and matched with the passenger car type;
Step 4.3, extracting two straight line segment functions and two curve segment functions corresponding to the matched passenger car types from a template library, dividing acquired point cloud slice data of the detected piece according to regions in the template library, dividing a set P corresponding to the point cloud slice data of the detected piece into four parts P 1、P2、P3、P4 according to x coordinates, wherein P 1 and P 3 are curve part point sets, P 2 and P 4 are straight line part point sets, and calculating the shortest distance from each point in each frame of the acquired point cloud slice data of the detected piece to the corresponding line segment function corresponding to the matched passenger car types;
Referring to fig. 3, a set corresponding to point cloud slice data of a measured piece is divided into four parts P 1、P2、P3、P4 according to an x coordinate, and fig. 3 is a side wall plate defect point cloud contour diagram;
Step 4.4, when obtaining the shortest distance from the point in the point set of the linear part of the measured object to the linear segment function, assuming that the linear segment function l 1 (x) is converted into a linear equation ax+bz+c=0, the shortest distance from the point to the linear segment is:
distance i in equation (5) is the shortest distance from point (x i,zi) to straight line segment l 1 (x);
Obtaining the shortest distance from each point in the P 2 point set of the tested piece to a straight line segment function l 1 (x) corresponding to the matched passenger car type in the template library by using the method of the step 4.4, and obtaining the shortest distance from each point in the P 4 point set of the tested piece to a straight line segment function l 2 (x) corresponding to the matched passenger car type in the template library;
step 4.5, when obtaining the shortest distance from the point concentrated on the curve part of the measured object to the curve segment function, it is necessary to find the perpendicular point q 0 between the point and the curve, assuming a point P i(xi,zi concentrated on the point P 1 of the measured object), and the point q τ,qτ on the curve segment function f 1 (x) represents the τ point on the curve segment function f 1 (x), and obtain the direction vector of the tangent line at the point q τ P i(xi,zi) and q τ are each a segment direction vector/>Setting a correlation threshold k, if/>Q τ is the calculated point P i(xi,zi) to the perpendicular point q 0 between the curve segment functions f 1 (x), otherwise, adding a step size, searching the next point on the curve segment function f 1 (x), repeating the step of finding the perpendicular point until the/>Conditions of (2); after the perpendicular point q 0 = (x, z) is found, the shortest distance from the point P i(xi,zi to the curve segment function f 1 (x) can be found:
Distance i in equation (6) is the shortest distance from point P i(xi,zi) to curve segment function f 1 (x);
Calculating the shortest distance from each point in the P 1 point set of the tested piece to a curve segment function f 1 (x) corresponding to the matched passenger car type in the template library by using the method of the step 4.5, and calculating the shortest distance from each point in the P 3 point set of the tested piece to a curve segment function f 2 (x) corresponding to the matched passenger car type in the template library;
Step 4.6, setting a relevant defect threshold epsilon, respectively comparing the shortest distance between each point in the P 2 point set of the tested piece and a straight line segment function l 1 (x) corresponding to the matched passenger car type in the template library, the shortest distance between each point in the P 4 point set of the tested piece and a straight line segment function l 2 (x) corresponding to the matched passenger car type in the template library, the shortest distance between each point in the P 1 point set of the tested piece and a curve segment function f 1 (x) corresponding to the matched passenger car type in the template library, and the shortest distance between each point in the P 3 point set of the tested piece and a curve segment function f 2 (x) corresponding to the matched passenger car type in the template library with the relevant defect threshold epsilon, and if a certain shortest distance is larger than the relevant defect threshold epsilon, the point in the tested piece corresponding to the shortest distance is a defect point, and recording the shortest distance corresponding to the defect point and the position (parameter) of the defect point;
and step 4.7, after the step 4.1 and the step 4.2 are performed, each frame of point cloud slice data of the measured piece is acquired, namely, the step 4.2 to the step 4.6 are circulated once.
The step 5 specifically comprises the following steps:
And 5.1, when the passenger car side wall plate scanning device is operated, namely, all point cloud slice data of the side wall plate of the tested piece are acquired, expanding all acquired point cloud slice data according to the Y direction to obtain whole piece of side wall plate point cloud data, and marking a defect area consisting of defect points.
The step 6 specifically comprises the following steps:
step 6.1, because the accidental shake of the camera, the noise is not eliminated completely, and other reasons, the misjudgment phenomenon is inevitably generated, so that all the defect areas are extracted, and the extracted defect areas are divided into a defect area 1, a defect area 2 and a … defect area n;
Step 6.2, assuming that the set of points in the defect area j is Q, j=1, 2,3 … n, calculating the minimum bounding box of all points in the set Q, obtaining the volume T of the minimum bounding sphere, setting a relevant threshold value gamma, and when T < gamma, recognizing the defect area as a misjudgment defect area and correcting the defect area as a defect-free area; as shown in fig. 4, a misjudgment defective region and a true defective region are included; a in fig. 5 is an enlarged view of the real defect region in fig. 4, and b in fig. 5 is an extracted pure real defect region;
and 6.3, detecting all the defect areas according to the step 6.2, removing the misjudgment areas in the defect areas, and finally obtaining the defect areas and the defect parameters.
According to the method, the template library of the side wall boards of the passenger car is built, and the side wall boards of the passenger car in different types are stored in the template library, so that the method can be self-adaptive to flatness detection of the side wall boards of the passenger car in different types, and even if a brand new side wall board of the passenger car is manufactured, the side wall boards of the passenger car can be detected only by scanning the side wall boards once and storing the side wall boards in the template library, and the problem of poor adaptability is solved.
According to the invention, the point cloud outline of each frame is processed instead of the whole point cloud after the scanning is finished, so that the problem of overlong time for processing the whole point cloud data is avoided, the extraction of the defect area can be performed while the point cloud data of the side wall plate is acquired, and the time required for operation is greatly reduced.
The invention uses the point cloud contour to carry out template matching, amplifies the defect characteristics in detection, and solves the problems of small defect detection precision and incapability of detecting small defects caused by overlarge size of the side wall plate of the passenger car.
According to the method, all the obtained point cloud slice data are spliced into complete side wall plate point cloud data, the defect areas are marked, and the defect areas which are misjudged are corrected into the defect-free areas by using an abnormal area removing algorithm, so that the problem of errors caused by hardware is solved, meanwhile, the coordinates and depth information of the defect areas can be obtained, and a reliable data source is provided for subsequent side wall plate putty surface spraying.
The scope of the present invention includes, but is not limited to, the above embodiments, and any alterations, modifications, and improvements made by those skilled in the art are intended to fall within the scope of the invention.

Claims (7)

1. A passenger car side wall board flatness detection method based on three-dimensional point cloud and contour matching is characterized by comprising the following steps:
step 1, acquiring one-frame three-dimensional point cloud data of side wallboards of different types of standard buses;
Step 2, preprocessing the obtained three-dimensional point cloud data, and generating a part of point cloud slice data by taking a Y coordinate as a main direction;
Step 3, carrying out line segment fitting on the point cloud slice data, fitting two straight line segments and two curve segments, recording the straight line segment function and the curve segment function obtained by fitting, and the number and the area division of the acquired points, and storing the obtained points and the area division into a template library;
Step 4, performing point cloud preprocessing operation when collecting each frame of point cloud data of the measured piece, extracting corresponding point cloud slice data from the template library which is made in the step 3 by taking the Y coordinate as a reference, matching the corresponding point cloud slice data with the collected first frame of point cloud data of the measured piece, calculating the shortest distance from each point in each frame of point cloud to a line segment which corresponds to the matched bus type in the template library, setting a relevant defect threshold, and when the calculated shortest distance is larger than the relevant defect threshold, determining the point as a defect point and recording the position and parameters of the point;
Step 5, after all point cloud slice data are acquired, expanding the point cloud slice data into complete point cloud data of the side wall plate of the passenger car according to Y coordinates, and dividing a defect area in the point cloud data;
and 6, eliminating misjudgment points by using an abnormal point eliminating algorithm, and finally obtaining the defect area information.
2. The method for detecting the flatness of the side wall panel of the passenger car based on the three-dimensional point cloud and the contour matching according to claim 1, wherein the step 1 is specifically as follows:
and taking one-frame three-dimensional point cloud data of the side wallboards of different types of standard buses by using the scanning device of the side wallboards of the buses.
3. The method for detecting the flatness of the side wall panel of the passenger car based on the three-dimensional point cloud and the contour matching according to claim 1, wherein the step2 is specifically as follows:
step 2.1, filtering and denoising the frame of standard point cloud data obtained in the step 1, removing abnormal points and noise in the point cloud of the side wall plate, and performing downsampling on the point cloud data by using a uniform downsampling method;
and 2.2, adjusting the pose of the point cloud data of the side wall panel after the pretreatment is finished, and taking the Y coordinate axis as the main direction of the pose, namely, the Y coordinates of all points in the point cloud data are the same.
4. The passenger car side wall panel flatness detection method based on three-dimensional point cloud and contour matching according to claim 1, wherein the step 3 specifically comprises:
step 3.1, taking the point cloud slice data obtained in the step 2 as an object, assuming that k points exist in the slice data P, and considering the points in the slice as a point set in the two-dimensional data because the Y coordinate values of the points are the same, i.e., each point is composed of an x coordinate and a z coordinate, then p= { (x 1,z1),(x2,z2),...,(xk,zk) };
Step 3.2, dividing the set P into four parts P 1、P2、P3、P4 according to the x coordinate, wherein P 1 and P 3 are curve part point sets, P 2 and P 4 are straight part point sets, assuming that there are m points in P 1, n points in P 3, a point in P 2, b points in P 4, and m+n+a+b=k;
step 3.3, fitting the straight line part in the slice data by using a least square method:
l(x)=a0+a1x (1);
Wherein l (x) is a fitted linear function, each point in the data to be fitted is brought into a least square method formula (1) to calculate a predicted value, and whether the linear fitting is reasonable or not is judged by a weighted error square sum The calculation formula of (2) is as follows:
Wherein ω (x i) > 0 is the weight function in the range of x i, l (x i) is the fitted function value, f (x i) is the original value, and x i is the coordinate of the i-th point; when the weighted error square sum of the fitted straight line segments And if the least square is the least, the least square fitting is completed;
fitting P 2 by using a formula (1) and a formula (2) to obtain a straight-line segment function l 1 (x), and fitting P 4 by using the formula (1) and the formula (2) to obtain a straight-line segment function l 2 (x);
and 3.4, obtaining a curve segment equation in slice data by adopting a circle fitting method:
(X-x)2+(Z-z)2=r2 (3);
Wherein the center coordinates are (x, z), and the radius of the circle is r; the fitting process comprises the following steps:
Step 3.4.1, firstly randomly picking out different three points in a curve segment corresponding to a curve part point set, and fitting out a curve segment circle equation by utilizing the principle of three-point circle setting;
In step 3.4.2, since the curve segment in the slice data is smaller than one quarter circle, the fitted curve segment circle equation is converted into a function z=f (x), the points of the curve segment in the slice data are brought into the fitted function, a new z coordinate value is obtained, and a determination coefficient R 2 is obtained at the same time:
Wherein z i represents the true z-coordinate value of the ith point, Predictive z-coordinate value representing the ith point,/>Representing an average of true z coordinate values for all points;
When R 2 is less than 0.95, returning to the step 3.4.1, and randomly selecting three points again to perform curve fitting until R 2 is more than or equal to 0.95, and finishing the curve fitting;
Fitting P 1 by using the steps 3.4.1 and 3.4.2 to obtain a curve segment function f 1 (x), fitting P 3 by using the steps 3.3.1 and 3.3.2 to obtain a curve segment function f 2 (x);
And 3.5, repeating the steps 3.1 to 3.4, obtaining two straight line segment functions, two curve segment functions, the number of points in the point cloud slice data and region division in all passenger car types and the side wall plate point cloud slice data, and storing the fitted two straight line segment functions, two curve segment functions, the number of points in the point cloud slice data and region division and corresponding passenger car types into a template library.
5. The method for detecting the flatness of the side wall panel of the passenger car based on the three-dimensional point cloud and the contour matching according to claim 1, wherein the step 4 is specifically:
Step 4.1, acquiring three-dimensional point cloud data of a detected piece by utilizing a scanning device of a side wall board of the passenger car, and when the first frame of point cloud data is acquired, carrying out a preprocessing mode in the step 2.1 by a vertical horse, and simultaneously adopting a point cloud pose adjustment mode in the step 2.2 to enable Y coordinates of all points in the same frame of point cloud data to be the same;
step 4.2, calculating the number of points in the acquired first frame point cloud slice data, and finding the passenger car type closest to the calculated number of points in the first frame point cloud slice data in a template library and matching the passenger car type with the passenger car type;
Step 4.3, extracting two straight line segment functions and two curve segment functions corresponding to the matched passenger car type from a template library, dividing acquired point cloud slice data of the detected piece according to regions in the template library, dividing a set P corresponding to the point cloud slice data of the detected piece into four parts P 1、P2、P3、P4 according to x coordinates, wherein P 1 and P 3 are curve part point sets, P 2 and P 4 are straight line part point sets, and calculating the shortest distance from each point in each frame of the acquired point cloud slice data of the detected piece to the corresponding line segment function in the matched passenger car type;
Step 4.4, when obtaining the shortest distance from the point in the point set of the linear part of the measured object to the linear segment function, assuming that the linear segment function l 1 (x) is converted into a linear equation ax+bz+c=0, the shortest distance from the point to the linear segment is:
Distance i in equation (5) is the shortest distance from point (x i,zi) to straight line segment l 1 (x);
Obtaining the shortest distance from each point in the P 2 point set of the tested piece to a straight line segment function l 1 (x) corresponding to the matched passenger car type in the template library by using the method of the step 4.4, and obtaining the shortest distance from each point in the P 4 point set of the tested piece to a straight line segment function l 2 (x) corresponding to the matched passenger car type in the template library;
Step 4.5, when obtaining the shortest distance from the point concentrated on the curve part of the measured object to the curve segment function, it is necessary to find the perpendicular point q 0 between the point and the curve, assuming a point P i(xi,zi concentrated on the point P 1 of the measured object), taking a point q τ on the curve segment function f 1 (x), obtaining the direction vector of the tangent line at the point q τ P i(xi,zi) and q τ are each a segment direction vector/>Setting a correlation threshold k, if/>Q τ is the calculated point P i(xi,zi) to the perpendicular point q 0 between the curve segment functions f 1 (x), otherwise, adding a step size, searching the next point on the curve segment function f 1 (x), repeating the step of finding the perpendicular point until the point is satisfiedConditions of (2); after the perpendicular point q 0 = (x, z) is found, the shortest distance from the point P i(xi,zi to the curve segment function f 1 (x) can be found:
Distance i in equation (6) is the shortest distance from point P i(xi,zi) to curve segment function f 1 (x);
Calculating the shortest distance from each point in the P 1 point set of the tested piece to a curve segment function f 1 (x) corresponding to the matched passenger car type in the template library by using the method of the step 4.5, and calculating the shortest distance from each point in the P 3 point set of the tested piece to a curve segment function f 2 (x) corresponding to the matched passenger car type in the template library;
Step 4.6, setting a relevant defect threshold epsilon, respectively comparing the shortest distance between each point in the P 2 point set of the tested piece and a straight line segment function l 1 (x) corresponding to the matched passenger car type in the template library, the shortest distance between each point in the P 4 point set of the tested piece and a straight line segment function l 2 (x) corresponding to the matched passenger car type in the template library, the shortest distance between each point in the P 1 point set of the tested piece and a curve segment function f 1 (x) corresponding to the matched passenger car type in the template library, and the shortest distance between each point in the P 3 point set of the tested piece and a curve segment function f 2 (x) corresponding to the matched passenger car type in the template library with the relevant defect threshold epsilon, and if a certain shortest distance is larger than the relevant defect threshold epsilon, the point in the tested piece corresponding to the shortest distance is a defect point, and recording the shortest distance corresponding to the defect point and the position of the defect point;
and step 4.7, after the step 4.1 and the step 4.2 are performed, each frame of point cloud slice data of the measured piece is acquired, namely, the step 4.2 to the step 4.6 are circulated once.
6. The passenger car side wall panel flatness detection method based on three-dimensional point cloud and contour matching according to claim 1, wherein the step 5 specifically comprises:
and 5.1, when all the point cloud slice data of the side wall plate of the measured piece are acquired, expanding all the acquired point cloud slice data according to the Y direction to obtain the point cloud data of the whole side wall plate, and marking the defect area consisting of the defect points.
7. The passenger car side wall panel flatness detection method based on three-dimensional point cloud and contour matching according to claim 1, wherein the step 6 specifically comprises:
step 6.1, extracting all defect areas, and dividing the extracted defect areas into a defect area 1, a defect area 2 and a … defect area n;
step 6.2, assuming that the set of points in the defect area j is Q, j=1, 2,3 … n, calculating the minimum bounding box of all points in the set Q, obtaining the volume T of the minimum bounding sphere, setting a relevant threshold value gamma, and when T is less than gamma, recognizing the defect area as a misjudgment area and correcting the misjudgment area as a non-defect area;
And 6.3, detecting all the defect areas according to the step 6.2, removing the misjudgment areas in the defect areas, and finally obtaining the defect areas.
CN202410113884.5A 2024-01-27 2024-01-27 Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching Active CN117934429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410113884.5A CN117934429B (en) 2024-01-27 2024-01-27 Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410113884.5A CN117934429B (en) 2024-01-27 2024-01-27 Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching

Publications (2)

Publication Number Publication Date
CN117934429A true CN117934429A (en) 2024-04-26
CN117934429B CN117934429B (en) 2024-07-02

Family

ID=90768197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410113884.5A Active CN117934429B (en) 2024-01-27 2024-01-27 Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching

Country Status (1)

Country Link
CN (1) CN117934429B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020002705A1 (en) * 2018-06-29 2020-01-02 Universiteit Antwerpen Item inspection by radiation imaging using an iterative projection-matching approach
CN111024037A (en) * 2019-09-25 2020-04-17 北京工业大学 Circular shield tunnel section fitting method based on three-dimensional laser scanning technology
CN114881955A (en) * 2022-04-28 2022-08-09 厦门微亚智能科技有限公司 Slice-based annular point cloud defect extraction method and device and equipment storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020002705A1 (en) * 2018-06-29 2020-01-02 Universiteit Antwerpen Item inspection by radiation imaging using an iterative projection-matching approach
CN111024037A (en) * 2019-09-25 2020-04-17 北京工业大学 Circular shield tunnel section fitting method based on three-dimensional laser scanning technology
CN114881955A (en) * 2022-04-28 2022-08-09 厦门微亚智能科技有限公司 Slice-based annular point cloud defect extraction method and device and equipment storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LINTAO HUO 等: "Review: Research on product surface quality inspection technology based on 3D point cloud", 《ADVANCES IN MECHANICAL ENGINEERING》, vol. 15, no. 3, 25 March 2023 (2023-03-25), pages 1 - 17 *
李威祥 等: "基于图像点云的道路缺陷检测", 《计算机系统应用》, vol. 33, no. 3, 19 January 2024 (2024-01-19), pages 220 - 225 *

Also Published As

Publication number Publication date
CN117934429B (en) 2024-07-02

Similar Documents

Publication Publication Date Title
CN105354880B (en) A kind of sand blasting machine people&#39;s automatic path generation method based on line laser structured light
CN114041168A (en) Automated 360-degree dense point object inspection
CN105783723B (en) Precision die surface processing accuracy detection device and method based on machine vision
CN115482195B (en) Train part deformation detection method based on three-dimensional point cloud
CN109483887B (en) Online detection method for contour accuracy of forming layer in selective laser melting process
CN107796373B (en) Distance measurement method based on monocular vision of front vehicle driven by lane plane geometric model
CN113450379B (en) Method and device for extracting and analyzing profile line of section of special-shaped workpiece
CN112697058A (en) Machine vision-based large-size plate assembly gap on-line measurement system and method
US20220214159A1 (en) Device and method for automatically detecting through-hole rate of honeycomb sandwich composite-based acoustic liner
Borsu et al. Automated surface deformations detection and marking on automotive body panels
CN110490342B (en) Contact net static geometrical parameter detection method based on Faster R-CNN
CN114283139A (en) Weld joint detection and segmentation method and device based on area array structured light 3D vision
CN115656182A (en) Sheet material point cloud defect detection method based on tensor voting principal component analysis
CN115100116A (en) Plate defect detection method based on three-dimensional point cloud
CN117433430A (en) System and method for detecting size of steel plate cutting part
CN114119957A (en) Method and device for detecting high-speed railway steel rail profile
CN117934429B (en) Bus side wall plate flatness detection method based on three-dimensional point cloud and contour matching
CN111738907B (en) Train pantograph detection method based on binocular calibration and image algorithm
García et al. Rail surface inspection system using differential topographic images
CN116664508A (en) Weld surface quality detection method and computer readable storage medium
CN114426039B (en) Point cloud data processing method based on urban rail train wheel tread
CN115971004A (en) Intelligent putty spraying method and system for carriage
CN116385356A (en) Method and system for extracting regular hexagonal hole features based on laser vision
CN110021027B (en) Edge cutting point calculation method based on binocular vision
CN115290656A (en) Welding seam surface defect detection and classification method based on line structured light

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