A 3D circle detection method for free-form surfaces
Through the normal vector-oriented rolling ball method and density-weighted iterative algorithm, the normal vectors of curved circular holes are extracted and fitted, which solves the problem that the existing technology is difficult to deal with non-planar surfaces, and realizes high-precision and robust three-dimensional circular holes. Positioning, suitable for complex surface scenes.
Patent Information
- Application Number
- CN202411457938.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The existing three-dimensional circular hole positioning technology is difficult to effectively deal with complex non-planar surfaces, especially in the fields of aerospace and automobile manufacturing. The existing algorithms cannot be directly applied, and it is difficult to obtain large-scale labeling data, and there is insufficient real-time performance.
The normal vector-oriented rolling ball method is used to extract the boundary outline of the surface point cloud, and the boundary segmentation is performed based on European clustering. The density-weighted iterative algorithm is used to obtain the normal vector of the surface circle hole, and project it to the plane for iterative fitting to obtain the final positioning. information.
It realizes high-precision circular hole positioning for non-planar complex surfaces, improves the universality and noise resistance of the algorithm, can be applied to round hole recognition and detection tasks in various industrial scenarios, and enhances positioning accuracy and robustness.
Smart Images

Figure CN119006569B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of three-dimensional visual detection, and in particular relates to a three-dimensional circle detection method for free-form surfaces. Background Art
[0002] In high-end equipment manufacturing fields such as aerospace and automobiles, the recognition and detection of circular holes on free-form surfaces are widely used in typical application scenarios such as automatic hole making, drilling and riveting, and long-beam positioning and assembly. There are a large number of circular holes in these typical application scenarios. For example, the number of rivet holes on an airplane can reach millions, distributed on various surfaces and in various sizes. However, manual inspection is inefficient, easy to miss, and costly. In contrast, automated inspection has the advantages of modularity, intelligence, and traceability, which can further meet the new era of aviation manufacturing for high quality, high efficiency, and low cost. Accurate positioning of circular holes on curved surfaces is crucial to automated production. It provides key data for robots, robotic arms and other equipment to help them accurately identify and manipulate workpieces to the appropriate position, thereby improving production efficiency.
[0003] There are two main types of circular hole positioning methods: image circular hole positioning and point cloud circular hole positioning. Although image circular hole positioning technology is mature, it is limited to two-dimensional image information and cannot directly obtain normal vectors and depth information in three-dimensional space. This limits the applicability of image processing technology in certain application scenarios that require normal vectors and depth information. In contrast, point cloud circular hole positioning technology can provide richer spatial information and provide more spatial perception and posture control capabilities for robotic arm operations.
[0004] Circular hole positioning technology can also be divided into traditional algorithms and deep learning methods. Traditional algorithms rely on manually designed features and rules, while deep learning algorithms are trained through a large amount of labeled data. However, it is relatively difficult to obtain large-scale labeled data in industrial scenarios, and there are problems such as insufficient real-time performance. The existing traditional point cloud circular hole positioning methods are mainly aimed at point clouds on planes, because plane point clouds are relatively simple and dominate in many industrial scenarios. However, in some industrial scenarios, such as automotive manufacturing and aerospace, non-planar complex surfaces are often encountered, and existing algorithms cannot be directly applied. These complex surfaces require more complex and flexible algorithms to process and analyze.
[0005] Based on this, the present invention proposes a three-dimensional circle detection method for free-form surfaces. Summary of the invention
[0006] In view of the above technical problems, the present invention provides a three-dimensional circle detection method for free-form surfaces.
[0007] The technical solution adopted by the present invention to solve the technical problem is:
[0008] A three-dimensional circle detection method for a free-form surface, the method comprising the following steps:
[0009] S100: acquiring curved surface point cloud data, and applying a normal vector-guided rolling ball method to the point cloud data to extract a boundary contour of a curved surface circular hole point cloud;
[0010] S200: performing boundary segmentation based on Euclidean clustering on the boundary contour of the point cloud to obtain clustering results of all boundary point clouds, where the clustering results are multiple circular hole contours;
[0011] S300: performing a density-based weighted iterative algorithm on each circular hole contour to obtain a surface circular hole normal vector;
[0012] S400: Projecting the circular hole on the curved surface onto a plane along the circular hole normal vector on the curved surface, and then performing circular hole iterative fitting based on solving an overdetermined equation on the projected circular hole point cloud to obtain final positioning information.
[0013] Preferably, S100 includes:
[0014] S110: For finite point cloud sets ,Depend on points, from the point set Any point in Start by searching with The nearest neighboring points, calculate the local plane of these points in the least squares sense ,flat The normal vector is recorded as ,Bundle As The normal vector of the point;
[0015] S120: As the center of the circle, the preset The neighborhood point set with radius inside, take A little outside , calculated and Two points with center passing through the plane , and the radius is The ball The calculated coordinates of the sphere center are ;
[0016] S130: Calculate neighborhood point set Other points within To the center of the ball Distance , , if all Both greater than , so there are no other points in the sphere, then is a boundary point, save it, otherwise repeat S120 to S130 until All points inside are judged;
[0017] S140: Point Set Repeat S120-S140 for all remaining points in All points in the calculation are judged.
[0018] Preferably, the setting in S120 Should meet: Radius The size is larger than the point cloud resolution , which is smaller than the radius of the circular hole to be identified ,Right now: .
[0019] Preferably, the sphere center obtained in S120 has two values, one inward and one outward, specifically:
[0020] ;
[0021] in, yes Normal vector of a point; vector ; for and The distance between ,in Represents the 2-norm of a vector; .
[0022] Preferably, S300 includes:
[0023] S310: Density weighting: For a certain point cloud collection , The three-dimensional coordinate data is , calculate each point The average distance of the neighboring points is taken as a row Column weight vector , standardize the obtained weight vector, that is ,in Represents a vector norm so that its sum is 1;
[0024] S320: De-centroiding: Point Cloud Collection With the weight vector The centroid is obtained by multiplying the transpose of ,right Each data in is subtracted To centroidalize, we get a new ;
[0025] S330: Calculate the covariance matrix ,right Perform singular value decomposition to find the eigenvalues and eigenvectors of the covariance matrix, and extract the eigenvector corresponding to the minimum eigenvalue , then the fitted normal vector is , the plane equation is ,in , and then calculate the distance between the data point and the plane to get the residual ;
[0026] S340: Calculate the current total cost ,Right now , and calculate the difference between the current cost and the previous cost ;
[0027] S350: Parameter update: The corresponding points smaller than the scale parameter a are retained and the residuals are updated , and use the SA-Cauchy weight function to update the weight W, the calculation formula is , and then update the scale parameter , ,in Scaling value for the algorithm, in preparation for the next iteration; if it is the first iteration, the maximum value of the residual Re is used as the scale parameter a;
[0028] S360: Repeat S310-S350 until the cost difference is less than a preset first threshold or is less than the preset second threshold, the output It is the surface hole normal vector.
[0029] Preferably, S400 includes:
[0030] S410: Surface hole normal vector , the plane equation is , where the coordinates of the point to be projected are , centroid coordinates , project all points onto the plane and obtain the coordinates of the projected points , the projection formula is , origin cloud coordinates , ,in Represents the 2-norm of a vector;
[0031] S420: Since the perpendicular bisector of the line connecting any two points on the arc must pass through the center of the circle, the coordinates of the center of the circle can be calculated by solving the linear equations. :
[0032] in Refers to the vector distance between any two points. , Refers to the difference between the x-axis coordinates of the j-th point and the i-th point. Refers to the difference between the y-axis coordinates of the j-th point and the i-th point. Refers to the difference between the z-axis coordinates of the j-th point and the i-th point. , , ;
[0033] , ;
[0034] S430: After obtaining the coordinates of the circle center, traverse the point cloud data and calculate the distance from each point to the circle center , the average distance obtained is used as the radius of the circle, and the calculation formula is: , where the center coordinates , get the positioning information ;
[0035] S440: In order to reduce the fitting error, the fitting circle is iterated. When a preset end condition is reached, the iteration is stopped, and the final positioning information is the final fitting result.
[0036] Preferably, S440 is specifically:
[0037] Calculate the distance from each point to the fitted circle. , judge when Greater than the set threshold , delete the point until all points are judged;
[0038] Use the remaining points to fit the circle again until the difference between the two fitting radii is Less than the set threshold Or the number of iterations Less than the set threshold , stop iteration, the final positioning information This is the final fitting result, where Indicates The radius obtained by the second fit.
[0039] The above-mentioned three-dimensional circle detection method for free-form surfaces is not only applicable to planar point cloud data, but also can process non-planar complex surfaces. It has strong versatility and applicability. It can cope with surfaces of different shapes, curvatures and surface features, and is suitable for circular hole recognition and detection tasks in various industrial scenarios; the normal vector-guided rolling ball method extracts the convex hull of the circular hole of the surface point cloud, and at the same time it takes into account the normal vector of the surface. Therefore, the point cloud boundary extracted by the normal vector-guided rolling ball method is closer to the actual boundary of the circular hole, which provides a reliable basis for subsequent circular hole positioning and fitting. At the same time, the density / distance weighted surface circular hole iterative fitting algorithm can filter out outliers in the details, further improving the circular hole positioning accuracy; in order to further reduce the influence of outliers on three-dimensional circle fitting, a density / distance weighted surface circular hole iterative fitting algorithm is proposed. The present invention improves the anti-noise ability of the algorithm in two aspects: first, when determining the circular hole normal vector, density weighting and distance iteration are used to filter out outliers; second, in order to further reduce the influence of outliers on circle fitting, iteration is performed during circular hole fitting to improve positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of a three-dimensional circle detection method for a free-form surface in one embodiment of the present invention;
[0041] Figure 2 Point cloud data input in one embodiment of the present invention;
[0042] Figure 3 The circular hole contour extraction result in one embodiment of the present invention;
[0043] Figure 4 This is the circular hole clustering segmentation result in one embodiment of the present invention;
[0044] Figure 5 The circular hole positioning result in one embodiment of the present invention;
[0045] Figure 6 is the result of the circular hole positioning radius error in one embodiment of the present invention;
[0046] Figure 7 Result of normal vector error of circular hole positioning in one embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings.
[0048] In one embodiment, Figure 1 As shown, a three-dimensional circle detection method for a free-form surface comprises the following steps:
[0049] S100: acquiring curved surface point cloud data, and applying a normal vector-guided rolling ball method to the point cloud data to extract a boundary contour of a curved surface circular hole point cloud;
[0050] S200: performing boundary segmentation based on Euclidean clustering on the boundary contour of the point cloud to obtain clustering results of all boundary point clouds, where the clustering results are multiple circular hole contours;
[0051] S300: performing a density-based weighted iterative algorithm on each circular hole contour to obtain a surface circular hole normal vector;
[0052] S400: Projecting the circular hole on the curved surface onto a plane along the circular hole normal vector on the curved surface, and then performing circular hole iterative fitting based on solving an overdetermined equation on the projected circular hole point cloud to obtain final positioning information.
[0053] In one embodiment, S100 includes:
[0054] S110: For finite point cloud sets ,Depend on points, from the point set Any point in Start by searching with The nearest neighboring points, calculate the local plane of these points in the least squares sense ,flat The normal vector is recorded as ,Bundle As The normal vector of the point;
[0055] Furthermore, if Figure 2 The point cloud data input in this embodiment is shown as follows. The point cloud data is 199909, and the radius of the circular hole is 2.5mm;
[0056] S120: As the center of the circle, the preset The neighborhood point set with radius inside, take A little outside , calculated and Two points with center passing through the plane , and the radius is The ball The calculated coordinates of the sphere center are ;
[0057] S130: Calculate neighborhood point set Other points within To the center of the ball Distance , , if all Both greater than , so there are no other points in the sphere, then is a boundary point, save it, otherwise repeat S120 to S130 until All points inside are judged;
[0058] S140: Point Set Repeat S120-S140 for all remaining points in All points in the calculation are judged.
[0059] Specifically, in S130, since there are two solutions for the center of the sphere, and the points on the boundary only satisfy that there are no other points in the outer sphere, it is sufficient that only one of the centers of the sphere meets the condition.
[0060] In one embodiment, the setting in S120 Should meet: Radius The size is larger than the point cloud resolution , which is smaller than the radius of the circular hole to be identified ,Right now: .
[0061] Specifically, set the rolling ball radius , The larger the value, the larger the rolling ball radius and the fewer boundary points are recognized. Should meet: Radius The size is larger than the point cloud resolution , which is smaller than the radius of the circular hole to be identified ,Right now: . The larger the value, the more points need to be traversed and the longer the boundary recognition process will be. If the value is too small, the rolling ball radius will not be able to connect two adjacent points and thus cannot be recognized.
[0062] In this embodiment, the rolling ball radius is selected The specific process is: the point cloud resolution is calculated in the example is 0.257, select is 1, and the boundary extraction result is as follows Figure 3 The boundary segmentation result in S200 is shown as Figure 4 shown.
[0063] In one embodiment, due to the symmetry of this process, the sphere center obtained in S120 has two values, one inward and one outward, specifically:
[0064] ;
[0065] in, yes Normal vector of a point; vector ; for and The distance between ,in Represents the 2-norm of a vector; .
[0066] In one embodiment, S300 includes:
[0067] S310: Density weighting: For a certain point cloud collection , The three-dimensional coordinate data is , calculate each point The average distance of the neighboring points is taken as a row Column weight vector , standardize the obtained weight vector, that is ,in Represents a vector norm so that its sum is 1;
[0068] S320: De-centroiding: Point Cloud Collection With the weight vector The centroid is obtained by multiplying the transpose of ,right Each data in is subtracted To centroidalize, we get a new ;
[0069] S330: Calculate the covariance matrix ,right Perform singular value decomposition to find the eigenvalues and eigenvectors of the covariance matrix, and extract the eigenvector corresponding to the minimum eigenvalue , then the fitted normal vector is , the plane equation is ,in , and then calculate the distance between the data point and the plane to get the residual ;
[0070] S340: Calculate the current total cost ,Right now , and calculate the difference between the current cost and the previous cost ;
[0071] S350: Parameter update: The corresponding points smaller than the scale parameter a are retained and the residuals are updated , and use the SA-Cauchy weight function to update the weight W, the calculation formula is , and then update the scale parameter , ,in Scaling value for the algorithm, in preparation for the next iteration; if it is the first iteration, the maximum value of the residual Re is used as the scale parameter a;
[0072] S360: Repeat S310-S350 until the cost difference is less than a preset first threshold or is less than the preset second threshold, the output It is the surface hole normal vector.
[0073] Specifically, S310 can reduce the normal vector deviation caused by uneven density; the purpose of S320 is to make the data mean zero, because the data mean will affect the subsequent covariance matrix, and de-centroiding can eliminate the influence of the data origin and simplify the data; in S350, the algorithm scaling value is set to .
[0074] In one embodiment, S400 includes:
[0075] S410: Surface hole normal vector , the plane equation is , where the coordinates of the point to be projected are , centroid coordinates , project all points onto the plane and obtain the coordinates of the projected points , the projection formula is , origin cloud coordinates , ,in Represents the 2-norm of a vector;
[0076] S420: Since the perpendicular bisector of the line connecting any two points on the arc must pass through the center of the circle, the coordinates of the center of the circle can be calculated by solving the linear equations. :
[0077] in Refers to the vector distance between any two points. , Refers to the difference between the x-axis coordinates of the j-th point and the i-th point. Refers to the difference between the y-axis coordinates of the j-th point and the i-th point. Refers to the difference between the z-axis coordinates of the j-th point and the i-th point. , , ;
[0078] , ;
[0079] S430: After obtaining the coordinates of the circle center, traverse the point cloud data and calculate the distance from each point to the circle center , the average distance obtained is used as the radius of the circle, and the calculation formula is: , where the center coordinates , get the positioning information ;
[0080] S440: In order to reduce the fitting error, the fitting circle is iterated. When a preset end condition is reached, the iteration is stopped, and the final positioning information is the final fitting result.
[0081] In one embodiment, S440 is specifically:
[0082] Calculate the distance from each point to the fitted circle. , judge when Greater than the set threshold , delete the point until all points are judged;
[0083] Use the remaining points to fit the circle again until the difference between the two fitting radii is Less than the set threshold Or the number of iterations Less than the set threshold , stop iteration, the final positioning information This is the final fitting result, where Indicates The radius obtained by the second fit.
[0084] Specifically, the original point cloud data and the fitted space circle are finally drawn, such as Figure 5 As shown; and the values of the center coordinates, radius and normal vector are displayed, and the radius error is as follows Figure 6 As shown, the normal vector error is Figure 7 shown.
[0085] Compared with the prior art, the above technical solution conceived by the present invention has the following beneficial effects:
[0086] 1. Versatility and applicability. The present invention is not only applicable to planar point cloud data, but also can process non-planar complex curved surfaces, and has strong versatility and applicability. It can handle curved surfaces of different shapes, curvatures and surface features, and is suitable for circular hole recognition and detection tasks in various industrial scenarios.
[0087] 2. High precision. The normal vector-guided rolling ball method extracts the convex hull of the circular hole of the surface point cloud. At the same time, it takes into account the normal vector of the surface. Therefore, the point cloud boundary extracted by the normal vector-guided rolling ball method is closer to the actual boundary of the circular hole, providing a reliable basis for subsequent circular hole positioning and fitting. At the same time, the density / distance weighted surface circular hole iterative fitting algorithm can filter out outliers in the details, further improving the circular hole positioning accuracy.
[0088] 3. Strong robustness. In order to further reduce the influence of outliers on three-dimensional circle fitting, a density / distance weighted surface circular hole iterative fitting algorithm is proposed. The present invention improves the anti-noise ability of the algorithm in two aspects: first, when determining the circular hole normal vector, outliers are filtered out by using density weighting and distance iteration; second, in order to further reduce the influence of outliers on circle fitting, iteration is performed during circular hole fitting to improve positioning accuracy.
[0089] The above is a detailed introduction to a three-dimensional circle detection method for free-form surfaces provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the core idea of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A three-dimensional circle detection method for free-form surfaces, characterized in that: The method comprises the following steps: S100: acquiring curved surface point cloud data, and applying a normal vector-guided rolling ball method to the point cloud data to extract a boundary contour of a curved surface circular hole point cloud; S100 includes: S110: For finite point cloud sets ,Depend on points, from the point set Any point in Start by searching with The nearest neighboring points, calculate the local plane of these points in the least squares sense ,flat The normal vector is recorded as ,Bundle As The normal vector of the point; S120: As the center of the circle, the preset The neighborhood point set with radius inside, take A little outside , calculated and Two points with center passing through the plane , and the radius is The ball The calculated coordinates of the sphere center are ; S130: Calculate neighborhood point set Other points within To the center of the ball Distance , , if all Both greater than , so there are no other points in the sphere, then is a boundary point, save it, otherwise repeat S120 to S130 until All points inside are judged; S140: Point Set Repeat S120-S140 for all remaining points in All points in the are judged; S200: performing boundary segmentation based on Euclidean clustering on the boundary contour of the point cloud to obtain clustering results of all boundary point clouds, where the clustering results are multiple circular hole contours; S300: performing a density-based weighted iterative algorithm on each circular hole contour to obtain a surface circular hole normal vector; S300 includes: S310: Density weighting: For a certain point cloud collection , The three-dimensional coordinate data is , calculate each point The average distance of the neighboring points is taken as a row Column weight vector , standardize the obtained weight vector, that is ,in Represents a vector norm so that its sum is 1; S320: De-centroiding: Point Cloud Collection With the weight vector The centroid is obtained by multiplying the transpose of ,right Each data in is subtracted To centroidalize, we get a new ; S330: Calculate the covariance matrix ,right Perform singular value decomposition to find the eigenvalues and eigenvectors of the covariance matrix, and extract the eigenvector corresponding to the minimum eigenvalue , then the fitted normal vector is , the plane equation is ,in , and then calculate the distance between the data point and the plane to get the residual ; S340: Calculate the current total cost ,Right now , and calculate the difference between the current cost and the previous cost ; S350: Parameter update: The corresponding points smaller than the scale parameter a are retained and the residuals are updated , and use the SA-Cauchy weight function to update the weight W, the calculation formula is , and then update the scale parameter , ,in Scaling value for the algorithm, in preparation for the next iteration; if it is the first iteration, the maximum value of the residual Re is used as the scale parameter a; S360: Repeat S310-S350 until the cost difference is less than a preset first threshold or is less than the preset second threshold, the output It is the normal vector of the circular hole on the surface; S400: Projecting the circular hole on the curved surface onto a plane along the circular hole normal vector on the curved surface, and then performing circular hole iterative fitting based on solving an overdetermined equation on the projected circular hole point cloud to obtain final positioning information.
2. The method according to claim 1, characterized in that S120 settings Should meet: Radius The size is larger than the point cloud resolution , which is smaller than the radius of the circular hole to be identified ,Right now: .
3. The method according to claim 2, characterized in that The sphere center obtained in S120 has two values, one inward and one outward, specifically: ; in, yes Normal vector of a point; vector ; for and The distance between ,in Represents the 2-norm of a vector; .
4. The method according to claim 3, characterized in that S400 includes: S410: Surface hole normal vector , the plane equation is , where the coordinates of the point to be projected are , centroid coordinates , project all points onto the plane and obtain the coordinates of the projected points , the projection formula is , origin cloud coordinates , ,in Represents the 2-norm of a vector; S420: Since the perpendicular bisector of the line connecting any two points on the arc must pass through the center of the circle, the coordinates of the center of the circle can be calculated by solving the linear equations. : in Refers to the vector distance between any two points. , Refers to the difference between the x-axis coordinates of the j-th point and the i-th point. Refers to the difference between the y-axis coordinates of the j-th point and the i-th point. Refers to the difference between the z-axis coordinates of the j-th point and the i-th point. , , ; , ; S430: After obtaining the coordinates of the circle center, traverse the point cloud data and calculate the distance from each point to the circle center , the average distance obtained is used as the radius of the circle, and the calculation formula is: , where the center coordinates , get the positioning information ; S440: In order to reduce the fitting error, the fitting circle is iterated. When a preset end condition is reached, the iteration is stopped, and the final positioning information is the final fitting result.
5. The method according to claim 4, characterized in that S440 is specifically: Calculate the distance from each point to the fitted circle. , judge when Greater than the set threshold , delete the point until all points are judged; Use the remaining points to fit the circle again until the difference between the two fitting radii is Less than the set threshold Or the number of iterations Less than the set threshold , stop iteration, the final positioning information This is the final fitting result, where Indicates The radius obtained by the second fit.
