Sheet metal part scanning point cloud-based round hole feature picking method, device and medium
By combining principal component analysis and multi-round projection distance judgment with least squares method and rounding method, the problem of fast and accurate localization and extraction of circular hole features in the point cloud of sheet metal parts was solved, and efficient solution of circular hole feature parameters was achieved.
Patent Information
- Application Number
- CN202511676114.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-11-17
AI Technical Summary
Existing technologies struggle to quickly and accurately locate and extract the geometric parameters of circular holes in the point cloud of sheet metal parts, especially in the absence of clear spatial coordinate information. Human-computer interaction methods are complex and unstable, while automated methods suffer from low computational efficiency and poor accuracy.
A method based on principal component analysis and multi-round projection distance judgment is adopted. Discrete points are selected through human-computer interaction, a local coordinate system is constructed, a point cloud set is filtered, a polynomial objective function is constructed, and the center and diameter of the circular hole feature are accurately fitted by combining the least squares method and the circular rolling method.
It enables rapid and stable positioning and extraction of geometric parameters of circular hole features in the point cloud of sheet metal parts, reduces the complexity of human-computer interaction, improves computational efficiency and accuracy, and ensures the stability and consistency of the algorithm for solving the center and diameter of the circle.
Smart Images

Figure CN121147288B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of high-precision optical measurement, and in particular to a method, device and medium for picking up a circular hole feature based on a sheet metal part scanning point cloud. BACKGROUND
[0002] Sheet metal parts have been widely used in the manufacturing fields of automobiles, ships and aerospace due to their advantages of lightweight, easy processing and low cost. The manufacturing quality of sheet metal parts not only affects the appearance and assembly size of products, but also plays a key role in their performance, service life and reliability. Therefore, accurate manufacturing deviation detection of sheet metal parts is an indispensable part of modern industrial production.
[0003] In recent years, optical sensors such as laser radar, surface structured light and line scanner have been gradually applied to the field of three-dimensional size measurement due to their advantages of high precision, strong stability and non-contact measurement, forming a modern manufacturing detection system with traditional three-coordinate measurement mechanisms. The massive point cloud data of sheet metal parts obtained by optical scanning can be used for size and position evaluation of key features after preprocessing such as denoising, sampling, splicing and registration. Among them, the circular hole is one of the most common and important features on the sheet metal part, and its processing quality directly affects the assembly accuracy and product performance. Currently, the extraction of circular hole features usually adopts a manual picking method by the operator through human-computer interaction. However, when facing discrete point clouds lacking obvious spatial coordinate information, it is a complex and tedious operation to quickly and accurately pick up the circular hole and calculate its center and diameter, and the stability and consistency of the results are difficult to guarantee.
[0004] There have been some researches on automatic feature picking in the prior art, but there are still many limitations:
[0005] 1. Fully automatic extraction method: this kind of method tries to extract all the circular hole features in the point cloud at once, usually involving complex boundary point discrimination, clustering and fitting processes. When dealing with large-scale scanning point clouds of sheet metal parts, the calculation time increases exponentially, which is low in efficiency and poor in accuracy and consistency. Figure One 2. Method based on center of gravity distance: this method uses the distance from the point to the center of gravity to distinguish the boundary points. However, the center of gravity of the sheet metal part scanning point cloud is easily disturbed by noise, missing or adjacent features, and often does not lie inside the circular hole feature, leading to boundary recognition error and poor robustness.
[0006] 3. Projection image method: this method projects three-dimensional point clouds onto two-dimensional images along a certain axis direction, and then uses image processing algorithms to identify circular holes. However, the premise is that the axial direction of the circular hole must be known in advance, and for sheet metal part scanning point clouds with unknown direction and position, this method cannot automatically extract features.
[0007]
[0008] Furthermore, methods relying solely on human-computer interaction also have significant drawbacks: if only a single point is picked up and searched at a fixed distance, it is difficult to balance the search range and number of searches, and the termination conditions are complex; if multiple points need to be picked up to determine features, the complexity of the operation is further increased. Although deep learning-based methods can achieve fast and accurate extraction, their model training process is complex and cumbersome, lacking versatility and immediacy.
[0009] In summary, existing methods struggle to achieve a good balance between ease of operation, computational efficiency, and result accuracy. Therefore, there is an urgent need for a novel method for rapidly identifying circular hole features, capable of quickly, stably, and with high precision outputting the geometric parameters of circular hole features using minimal human-computer interaction (such as single-point picking) as input. Summary of the Invention
[0010] In view of this, it is necessary to provide a method, device and medium for picking up circular hole features based on the scanning point cloud of sheet metal parts, so as to solve the technical problem of quickly, accurately and stably locating and extracting the geometric parameters (center and diameter) of circular holes in complex point clouds in the prior art.
[0011] To address the aforementioned technical problems, in a first aspect, the present invention provides a method for picking circular hole features based on the scanned point cloud of sheet metal parts, comprising:
[0012] Randomly select a discrete point around the circular hole feature in the scanned point cloud of the sheet metal part, and obtain the three-dimensional spatial coordinates of the discrete point;
[0013] Using the discrete point as the center of a sphere, a first point cloud set is constructed by searching for neighboring point clouds with a first value as the radius, and a second point cloud set is constructed by searching for neighboring point clouds with a second value as the radius, wherein the first value is greater than the second value;
[0014] Based on principal component analysis, a first base coordinate system with the discrete points as the origin is created for the second point cloud set; the first base coordinate system includes a first principal vector, a first vector vector, and a first component vector.
[0015] A first vector set is constructed with the discrete point as the starting point and the points in the second point cloud set as the ending point. The projection length of the first vector set on the first vector is calculated. Based on the projection length, a third point cloud set in the first spatial plane where the circular hole feature is located is selected from the second point cloud set.
[0016] Principal component analysis is used to construct a second base coordinate system with the discrete points as the origin for the third point cloud set, and the projection points of the discrete points on the fitted first spatial plane are calculated; the second base coordinate system includes a second principal vector, a second vector, and a second component vector; the fitted first spatial plane is a plane obtained by fitting the third point cloud set;
[0017] A second vector set is constructed with the projection point as the starting point and the points in the third point cloud set as the ending point. The first principal projection length of the vector in the second vector set on the second principal vector, the first projection length on the second vector, and the first sub-projection length on the second sub-vector are calculated respectively. The direction of the second vector is corrected according to the first projection length.
[0018] A fourth point cloud set is obtained by selecting point clouds from the first point cloud set whose absolute values of the first main projection length and the first sub-projection length are less than a preset length threshold, and whose first projection length is greater than the product result. A fifth point cloud set is obtained by selecting point clouds from the first point cloud set whose absolute values of the first main projection length and the first sub-projection length are less than the preset length threshold, and whose first projection length is less than the product result. The product result is equal to the product of the multiplier and the preset length threshold.
[0019] Based on the projection points, the fourth point cloud set, and the fifth point cloud set, a first polynomial objective function and a second polynomial objective function are constructed on the second base coordinate system. The first extreme point that minimizes the first polynomial objective function and the second extreme point that maximizes the second polynomial objective function are then solved.
[0020] The midpoint between the first extreme point and the second extreme point is taken as the initial value of the center of the circular hole feature, and the Euclidean distance between the first extreme point and the second extreme point is taken as the initial value of the diameter of the circular hole feature.
[0021] Based on the initial values of the center and the diameter, point cloud boundary extraction and feature parameter fitting are performed to obtain the final center coordinates and final diameter of the circular hole feature.
[0022] In one possible implementation, the distance between the discrete point and the boundary of the circular hole feature is less than one-fifth of the diameter of the circular hole feature.
[0023] In one possible implementation, both the first and second values are positively correlated with the sheet metal thickness and the resolution of the optical sensor, the preset length threshold is positively correlated with the resolution of the optical sensor, and the optical sensor is a sensor used to scan and acquire the point cloud of the sheet metal.
[0024] In one possible implementation, if the absolute value of the maximum first projection length is greater than the absolute value of the minimum first projection length, then points whose first projection length is greater than the first length are selected from the second point cloud set to obtain the third point cloud set; if the absolute value of the maximum first projection length is less than or equal to the absolute value of the minimum first projection length, then points whose first projection length is greater than the first length by a negative number are selected from the second point cloud set to the third point cloud set.
[0025] In one possible implementation, correcting the direction of the second vector vector based on the length of the first projection includes:
[0026] When the absolute value of the maximum value of the first projection length is greater than the absolute value of the minimum value of the first projection length, the direction of the second vector is reversed;
[0027] When the absolute value of the maximum value of the first projection length is less than or equal to the absolute value of the minimum value of the first projection length, the direction of the second vector remains unchanged.
[0028] In one possible implementation, constructing the first polynomial objective function and the second polynomial objective function on the second base coordinate system based on the projection points, the fourth point cloud set, and the fifth point cloud set includes:
[0029] Starting from the projection point, and using the points in the fourth point cloud set and the fifth point cloud set as the endpoints, construct the third vector set and the fourth vector set respectively;
[0030] Calculate the projection lengths of the vectors in the third vector set onto the second principal vector, the corrected second vector, and the second sub-vector, and construct a first polynomial objective function with respect to the projection lengths;
[0031] Calculate the projection lengths of the vectors in the fourth vector set onto the second principal vector, the corrected second vector, and the second sub-vector, and construct a second polynomial objective function with respect to the projection lengths.
[0032] In one possible implementation,
[0033] in, ε 1 represents the objective function of the first polynomial. ε 2 represents the objective function of the second polynomial. M I , M J and MK These are the projection lengths of the vector onto the second principal vector I2, the corrected second vector J2, and the second sub-vector K2, respectively. M 0 represents the minimum length of the projection of the vector onto the corrected second vector J2. λ 1,1 , λ 1,2 , λ 1,3 , λ 2,1 , λ 2,2 and λ 2,3 This is the proportionality coefficient term.
[0034] In one possible implementation, the step of extracting point cloud boundaries and fitting feature parameters based on the initial center value and the initial diameter value to obtain the final center coordinates and final diameter of the circular hole feature includes:
[0035] Using the midpoint as the center of the sphere and the sum of the Euclidean distance and the first preset value as the radius, a sixth point cloud set is constructed by searching the point cloud closest to the midpoint in the scanned point cloud of the sheet metal part.
[0036] The second spatial plane is obtained by fitting the sixth point cloud set using the least squares method. The distance from all points in the sixth point cloud set to the first spatial plane is calculated. Points with distances less than a distance threshold are selected from the sixth point cloud set to construct the seventh point cloud set.
[0037] Calculate the distances from all points in the seventh point cloud set to the midpoint, and select points from the seventh point cloud set whose distances are greater than a first sum and less than a second sum to construct an eighth point cloud set; the first sum is equal to the sum of the Euclidean distance and a second preset value, and the second sum is equal to the sum of the Euclidean distance and a third preset value;
[0038] The third spatial plane is obtained by fitting the eighth point cloud set using the least squares method, and the seventh point cloud set is projected onto the third spatial plane to construct the ninth point cloud set.
[0039] A new base coordinate system is constructed using principal component analysis on the ninth point cloud set, and then projected onto a two-dimensional coordinate system composed of principal vectors and secondary vectors to obtain the tenth point cloud set.
[0040] The boundary of the circular hole feature is extracted using the circular rolling method for the tenth point cloud to obtain the eleventh point cloud;
[0041] Search the 3D point cloud in the ninth point cloud set that corresponds to the eleventh point cloud set to obtain the twelfth point cloud set;
[0042] Based on the random sampling consensus algorithm, the twelfth point cloud set is fitted to obtain a spatial circle, and the center and diameter of the spatial circle are determined as the final center coordinates and the final diameter.
[0043] In a second aspect, the present invention also provides an electronic device, including a memory and a processor, wherein,
[0044] The memory is used to store programs;
[0045] The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the circular hole feature picking method based on sheet metal part scanning point cloud as described in any of the above implementations.
[0046] Thirdly, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps in the circular hole feature picking method based on sheet metal part scanning point cloud described in any of the above implementations.
[0047] The beneficial effects of this invention are as follows: The circular hole feature picking method based on the scanned point cloud of sheet metal parts provided by this invention first selects a discrete point through a human-computer interaction process, reducing the constraints on discrete point selection, lowering the complexity of human-computer interaction, and reducing problems such as low stability and poor consistency of picking results caused by improper human-computer interaction. Furthermore, it employs a method combining multi-round principal component analysis and projection distance judgment, reducing the computational complexity of the algorithm and improving the search speed of the target point cloud. The simple objective function only requires sacrificing minimal computation time to obtain accurate target points, achieving a balance between search speed and picking accuracy. Furthermore, it uses the circular rolling method to extract the boundary point cloud of the circular hole feature, reducing the three-dimensional problem to a two-dimensional problem for solution, accelerating the extraction speed while ensuring accuracy. The circular hole feature parameter estimation uses a combination of RANSAC and least squares methods, improving the stability and consistency of the algorithm for solving the center and diameter. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure OneThis is a schematic flowchart of an embodiment of the circular hole feature picking method based on the scanning point cloud of sheet metal parts provided by the present invention;
[0050] Figure Two For the present invention Figure One A schematic diagram of an embodiment of the S800;
[0051] Figure Three For the present invention Figure One A schematic diagram of an embodiment of the S900;
[0052] Figure Four for Figure One A schematic diagram illustrating the rapid capture and transformation of the corresponding circular hole feature;
[0053] Figure Five For the present invention Figure One A schematic diagram of point cloud extraction and precise parameter estimation for the circular hole feature boundary of the S900.
[0054] Figure Six A schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0056] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0057] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.
[0058] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0059] Before demonstrating the embodiments, the following terms will be explained.
[0060] Sheet metal parts: refer to metal components manufactured using sheet metal processing techniques.
[0061] PCA (Principal Component Analysis) is a statistical method used to transform data from multiple variables into a few principal components through linear transformation. These principal components are linear combinations of the original data and are uncorrelated (or orthogonal) to each other, thus preserving the variance information of the original data to the greatest extent.
[0062] This invention provides a method, device, and medium for picking up circular hole features based on the scanning point cloud of sheet metal parts, which will be described below.
[0063] Figure One This is a schematic flowchart of an embodiment of the circular hole feature picking method based on the scanning point cloud of sheet metal parts provided by the present invention, as shown below. Figure One As shown, the method for picking circular hole features based on the scanned point cloud of sheet metal parts includes:
[0064] S100. Randomly select a discrete point around the circular hole feature in the scanned point cloud of the sheet metal part. P 0, obtain the discrete points P 0's three-dimensional spatial coordinates.
[0065] Specifically, firstly, a discrete point is randomly selected around the circular hole feature in the scanned point cloud of the sheet metal part, and its spatial coordinates are obtained. P 0=( X 0, Y 0, Z 0), the discrete points are randomly selected by the operator using the mouse on the software's visual interface, for example... P 0 = (84.0, 75.0, 10.0).
[0066] S200, with the discrete points P With 0 as the center of the ball, and the first value L Using a radius of 0, a first point cloud set Q0 is constructed by searching for neighboring point clouds, and then using a second value... L 1. Construct a second point cloud set Q1 using radius search of neighboring point clouds, where the first value...L 0 is greater than the second value L 1.
[0067] Be specific, point P 0 is the center of the ball. L 0 and L Using a radius of 1, search for the nearest neighbor point cloud and construct point cloud sets Q0 and Q1, where... L 0 is much greater than L 1. For example, using points P 0 is the center of the ball. L 0=30mm and L Using a radius of 1=5mm, search for the nearest neighbor point cloud and construct the first point cloud set Q0={ Q i | i =1, 2, ..., 75472} and the second point cloud set Q1={ Q j | j =1, 2, ..., 1848}.
[0068] S300. Based on principal component analysis, a first base coordinate system with the discrete points as the origin is created for the second point cloud set Q1; the first base coordinate system includes a first principal vector I1, a first vector J1, and a first sub-vector K1.
[0069] Specifically, for the second point cloud set Q1, PCA is used to construct the first base coordinate system, with the origin of the first base coordinate system being... P 0. The principal vector is the first vector I1, the second vector is the first vector J1, and the third vector is the first component vector K1. I1, J1, and K1 are all pairwise perpendicular and are all unit vectors. For example, PCA is used to construct the first base coordinate system for the second point cloud set Q1, with the origin of the coordinate system being... P 0, I1=(0.00475, 0.99999, 0.00111), J1=(0.9836, -0.00487, 0.18028), K1=(-0.18028, -0.00024, 0.98361).
[0070] S400. Using the discrete point as the starting point and the points in the second point cloud set Q1 as the ending point, construct a first vector set, calculate the projection length of the first vector set on the first vector J1, and select the third point cloud set Q2 of the first spatial plane where the circular hole feature is located from the second point cloud set Q1 according to the projection length.
[0071] Specifically, by point PStarting from point 0, a vector set is constructed using points in the second point cloud set Q1 as endpoints. The projection length of the vectors in the J1 direction is calculated, and a third point cloud set Q2 is selected based on the projection length to determine the spatial plane containing the circular hole feature. For example, using points... P Starting from 0, a vector set is constructed using points in the second point cloud set Q1 as the endpoints. The projection length of the vectors in the J1 direction is calculated. The maximum projection length is 4.89049, and the minimum is -1.50773. Because the absolute value of the maximum projection length is greater than the absolute value of the minimum projection length, points in the second point cloud set Q1 with a projection length greater than 0.5 form the third point cloud set Q2 = { Q k | k =1, 2, ..., 1137}.
[0072] S500. Using principal component analysis, construct a second base coordinate system with the discrete points as the origin for the third point cloud set Q2, and calculate the projection points of the discrete points on the fitted first spatial plane. P 0'; The second base coordinate system includes the second principal vector I2, the second vector J2, and the second sub-vector K2; The fitted first spatial plane is a plane fitted according to the third point cloud set Q2.
[0073] Specifically, for the third point cloud set Q2, principal component analysis is used to construct a new base coordinate system, with the origin of the coordinate system being... P 0, the principal vector is the second principal vector I2, the secondary vector is the second vector J2, and the third vector is the second component vector K2. I2, J2, and K2 are all pairwise perpendicular and are all unit vectors. P The projection point of 0 onto the first spatial plane fitted by the third point cloud set Q2 is: P 0'=( X 0', Y 0', Z For example, principal component analysis is used to construct a new base coordinate system for the third point cloud set Q2, with the origin of the coordinate system being... P 0, the principal vector is I2=(0.00804, 0.99997, 0.0), the secondary vector is J2=(-0.99997, 0.00804, 0.0), and the tertiary vector is K2=(0.0, 0.0, 1.0). The point is calculated. P The projection point of 0 onto the first spatial plane fitted according to the third point cloud set Q2 is: P 0' = (84.0, 75.0, 10.0).
[0074] S600, with the projection point PStarting from 0', a second vector set is constructed with the points in the third point cloud set Q2 as the endpoints. The first principal projection length of the vectors in the second vector set on the second principal vector I2, the first projection length on the second vector J2, and the first sub-projection length on the second sub-vector K2 are calculated respectively. The direction of the second vector J2 is corrected according to the first projection length.
[0075] Specifically, by point P Starting from 0', construct a vector set with the points in the third point cloud set Q0 as the endpoints. Calculate the projection lengths of the vectors in the third point cloud set Q0 in the directions I2, J2, and K2 to obtain the first main projection length, the first projection length, and the first sub-projection length. Correct the direction of the second vector J2 based on the first projection length of the vectors in the third point cloud set Q0 in the direction J2.
[0076] S700: From the first point cloud set Q0, select points whose absolute values of the first main projection length and the first sub-projection length are less than a preset length threshold. S Furthermore, the point clouds whose first projection length is greater than the product result are used to obtain the fourth point cloud set Q3. From the first point cloud set Q0, points are selected where the absolute value of the first main projection length and the first sub-projection length is less than the preset length threshold. S The point cloud whose first projection length is less than the product result is used to obtain the fifth point cloud set Q4; the product result is equal to the product of the multiplication factor and the preset length threshold.
[0077] Specifically, the multiplier can be a positive integer. The first point cloud set Q0 is selected based on the absolute value of the projected length in the I2 and K2 directions being less than a preset length threshold. S And the projected length in the J2 direction is greater than 4× S From the point clouds, construct a fourth point cloud set Q3, and select the points from the first point cloud set Q0 whose absolute values of the projection lengths in the I2 and K2 directions are less than 1. S And the projected length in the J2 direction is less than 4× S The point clouds are used to construct a fifth point cloud set Q4. For example, point clouds in Q0 that satisfy the condition that the absolute value of the projected length in the I2 and K2 directions is less than 0.5 mm and the projected length in the J2 direction is greater than 2 mm are selected to construct a point cloud set Q3={ Q l | l =1, 2, ..., 357}, filter point clouds in Q0 that satisfy the condition that the absolute value of the projected length in the I2 and K2 directions is less than 0.5 mm, and the projected length in the J2 direction is less than 2 mm, and construct point cloud set Q4={ Q m |m =1, 2, ..., 911}.
[0078] S800, according to the projection point P 0', the fourth point cloud set Q3 and the fifth point cloud set Q4, construct a first polynomial objective function on the second base coordinate system. ε 1 and the second polynomial objective function ε 2. Solve for the objective function of the first polynomial respectively. ε 1. Minimum first extreme point P 1, and make the second polynomial objective function ε 2. The largest second extreme point P 2.
[0079] S801, connect the first extreme point P1 with the second extreme point P Midpoint of 2 P 12 As the initial value of the center of the circular hole feature, the first extreme point P1 and the second extreme point are used as the reference. P 2 Euclidean distance D 12 This serves as the initial value for the diameter of the circular hole feature.
[0080] S900. Based on the initial center value and the initial diameter value, perform point cloud boundary extraction and feature parameter fitting to obtain the final center coordinates of the circular hole feature. P and final diameter D .
[0081] Specifically, based on the projection point P 0', the fourth point cloud set Q3 and the fifth point cloud set Q4, construct a first polynomial objective function on the second base coordinate system. ε 1 and the second polynomial objective function ε 2. Solve for the objective function of the first polynomial respectively. ε 1 is the first extreme point corresponding to the minimum value. P 1=( X 1, Y 1, Z 1), and make the second polynomial objective function ε 2 is the second extreme point corresponding to the maximum value. P 2=( X 2, Y 2, Z 2) Settings P 1 and P Midpoint of 2 P 12 Let be the initial value of the center of the circular hole feature, and P 1 andP 2 Euclidean distance D 12 The initial value for the diameter of the circular hole feature is given. The center coordinates of the circular hole feature are accurately fitted using point cloud boundary extraction and feature parameter estimation algorithms. P =( X , Y , Z ) and diameter D It is used for subsequent evaluation of manufacturing deviations in the position and size of the circular hole features.
[0082] For example, obtaining the first objective function ε The point corresponding to the minimum value P 1 = (66.00055, 75.09991, 10.0), thus obtaining the second objective function. ε The point corresponding to the maximum value of 2 P 2 = (84.0, 75.0, 10.0), P 1 and P Midpoint of 2 P 12 =(75.00028, 75.04995, 10.0) is the initial value of the center of the circular hole feature. P 1 and P 2 Euclidean distance D 12 =17.99972mm is the initial diameter value for the circular hole feature. According to... P 12 and D 12 The final center coordinates of the circular hole feature are obtained by extracting the point cloud boundary and fitting the feature parameters. P and final diameter D .
[0083] This invention addresses the pain point of difficult circular hole feature acquisition in engineering applications. From the perspective of simplifying human-computer interaction complexity and accelerating feature point cloud search algorithms, it proposes a rapid circular hole feature acquisition method for scanning point clouds of sheet metal parts. During human-computer interaction, only one discrete point around the circular hole feature needs to be acquired, and the constraints on discrete point selection are weakened. The search algorithm quickly classifies the point clouds of the inner wall and projection surface of the circular hole based on the information around the discrete point, and constructs a local coordinate system based on the point cloud of the projection surface. Then, it searches along a specified direction of the coordinate system for another discrete point that can approximately pass through the center of the circular hole feature. Based on these two discrete points, the initial values of the center and diameter of the circular hole feature are determined. Finally, the center coordinates and diameter of the circular hole feature are accurately calculated using boundary extraction and parameter estimation algorithms. The method proposed in this invention can reduce the complexity of human-computer interaction, achieve rapid search and localization of circular hole features, and has guiding significance for acquiring other sheet metal features such as circular grooves, square grooves, cut edges, facets, and bolts.
[0084] In some embodiments of the present invention, the distance between the discrete point and the boundary of the circular hole feature is less than one-fifth of the diameter of the circular hole feature.
[0085] Specifically, the selection of discrete points is achieved through human-computer interaction. The distance between the discrete point and the boundary of the circular hole feature is less than one-fifth of the diameter, and the smaller the distance, the better.
[0086] In some embodiments of the present invention, the first numerical value L 0 and the second value L 1 is positively correlated with the sheet metal thickness and the optical sensor resolution, and the preset length threshold is... S The resolution of the optical sensor is positively correlated with that of the sensor used to scan and acquire the point cloud of the sheet metal part.
[0087] Specifically, the values of L0 and L1 are determined by a combination of the sheet metal thickness and the resolution of the optical sensor. Typically, L0 = 30mm and L1 = 5mm. The value of S is determined by the resolution of the optical sensor, typically set to S = 0.5mm.
[0088] In some embodiments of the present invention, if the absolute value of the maximum first projection length is greater than the absolute value of the minimum first projection length, then points whose first projection length is greater than the first length are selected from the second point cloud set Q1 to obtain the third point cloud set Q2; if the absolute value of the maximum first projection length is less than or equal to the absolute value of the minimum first projection length, then points whose first projection length is greater than the first length by a negative number are selected from the second point cloud set Q1 to the third point cloud set Q2.
[0089] Specifically, the first length can be equal to 0.5, 0.6, or other positive numbers. Assuming the first length is equal to 0.5, when filtering the third point cloud set Q2, if the absolute value of the maximum projection length is greater than the absolute value of the minimum projection length, the points in the second point cloud set Q1 with a projection length greater than 0.5 form the third point cloud set Q2; otherwise, the points in the second point cloud set Q1 with a projection length less than -0.5 form the third point cloud set Q2.
[0090] In some embodiments of the present invention, correcting the direction of the second vector J2 according to the first projection length includes:
[0091] When the absolute value of the maximum value of the first projection length is greater than the absolute value of the minimum value of the first projection length, the direction of the second vector J2 is reversed;
[0092] When the absolute value of the maximum value of the first projection length is less than or equal to the absolute value of the minimum value of the first projection length, the direction of the second vector J2 remains unchanged.
[0093] Specifically, during the second direction correction of vector J2, if the absolute value of the maximum projected length is greater than the absolute value of the minimum projected length, the direction of the second vector J2 is reversed; otherwise, the direction of the second vector J2 remains unchanged. For example, taking a point... P Starting from 0', construct a second vector set with the points in the third point cloud set Q2 as the endpoints. Calculate the first projection length of the vectors in the second vector set along the direction of the second vector J2. The maximum value of the first projection length is 0.00211, and the minimum value of the first projection length is -4.97045. Since the absolute value of the maximum value of the first projection length is less than the absolute value of the minimum value of the first projection length, the direction of J2 remains unchanged.
[0094] In some embodiments of the present invention, step S800 includes:
[0095] S810, with the projection point P Starting from 0', construct the third vector set and the fourth vector set respectively, using the points in the fourth point cloud set Q3 and the fifth point cloud set Q4 as the endpoints;
[0096] S820. Calculate the projection lengths of the vectors in the third vector set onto the second principal vector I2, the corrected second vector J2, and the second sub-vector K2, and construct a first polynomial objective function about the projection lengths. ε 1;
[0097] S830. Calculate the projection lengths of the vectors in the fourth vector set onto the second principal vector I2, the corrected second vector J2, and the second sub-vector K2, and construct a second polynomial objective function about the projection lengths. ε 2.
[0098] Specifically, by point P Starting from 0', construct a vector set with the points in the fourth point cloud set Q3 as the endpoints. Calculate the projection lengths of the vectors in the directions I2, J2, and K2 respectively, and construct the first polynomial objective function with respect to the projection lengths in the three directions. ε 1. Using points P Starting from 0', construct a vector set with the points in the fifth point cloud set Q4 as the endpoints. Calculate the projection lengths of the vectors in the directions I2, J2, and K2 respectively, and construct a second polynomial objective function with respect to the projection lengths in the three directions. ε 2.
[0099] In some embodiments of the present invention
[0100] in, ε 1 represents the objective function of the first polynomial. ε 2 represents the objective function of the second polynomial. M I , M J and M K These are the projection lengths of the vector onto the second principal vector I2, the corrected second vector J2, and the second sub-vector K2, respectively. M 0 represents the minimum length of the projection of the vector onto the corrected second vector J2. λ 1,1 , λ 1,2 , λ 1,3 , λ 2,1 , λ 2,2 and λ 2,3 This is the proportionality coefficient term.
[0101] Specifically, continuing with the above example, we typically set... λ 1,1 = λ 1,2 = λ 1,3 =1.0, λ 2,1 = λ 2,3 =-0.25, λ 1,2 =0.5. (Based on points) P Starting from 0', construct the third and fourth vector sets respectively, using the points in the fourth point cloud set Q3 and the fifth point cloud set Q4 as endpoints. Calculate the projection lengths of the vectors in the third and fourth vector sets in the directions I2, J2, and K2 respectively, and construct the first and second polynomial objective functions for the projection lengths in the three directions:
[0102] .
[0103] In some embodiments of the present invention, step S900 includes:
[0104] S910, at the midpoint P 12 The Euclidean distance is the center of the sphere. D 12 Compared with the first preset value LThe sum of 2 is the radius, and the search is performed from the scanned point cloud of the sheet metal part to find the midpoint. P 12 The nearest neighbor point cloud is used to construct the sixth point cloud set E0;
[0105] S920. Based on the sixth point cloud set E0, the second spatial plane is obtained by fitting using the least squares method. The distance from all points in the sixth point cloud set E0 to the first spatial plane is calculated. Points with distances less than the distance threshold are selected from the sixth point cloud set E0 to construct the seventh point cloud set E1.
[0106] S930, Calculate the distance from all points in the seventh point cloud set E1 to the midpoint. P 12 The distance is used to select points from the seventh point cloud set E1 whose distance is greater than the first sum and less than the second sum D12+L4 to construct the eighth point cloud set E2; the first sum is equal to the sum of the Euclidean distance and the second preset value, and the second sum is equal to the sum of the Euclidean distance and the third preset value.
[0107] S940. Based on the eighth point cloud set E2, the third spatial plane is obtained by fitting it using the least squares method. The seventh point cloud set E1 is projected onto the third spatial plane to construct the ninth point cloud set E3.
[0108] S950. A new base coordinate system is constructed using principal component analysis on the ninth point cloud set E3, and it is projected onto a two-dimensional coordinate system composed of principal vectors and secondary vectors to obtain the tenth point cloud set E4.
[0109] S960. Using the circular rolling method, the boundary of the circular hole feature is extracted to obtain the eleventh point cloud set E5.
[0110] S970. Search the 3D point cloud in the ninth point cloud set E3 that corresponds to the eleventh point cloud set E5 to obtain the twelfth point cloud set E6;
[0111] S980. Based on the random sampling consensus algorithm, the twelfth point cloud set E6 is fitted to obtain a spatial circle, and the center and diameter of the spatial circle are determined as the final center coordinates. P and the final diameter D .
[0112] Specifically, continuing with the above example, let's take points... P 12 For the center of the ball, D 12 + L 2. To find the nearest neighbor point cloud by radius, construct E0. Typically, this is set... L 2 = 4mm, therefore, E0 = {E i | i =1, 2, ..., 11628}. For E0, fit the spatial plane using the least squares method, calculate the distance from all points in E0 to the spatial plane, and construct E1 = { for points with a distance less than 0.5 mm. E j | j =1, 2, ..., 11334}, the remaining points are removed as noise. Calculate the points-to-point connections for all points in E1. P 12 The distance, the filter distance is greater than D 12 + L 3 and less than D 12 + L Construct E2 using 4 points, typically set as follows: L 3 = 1mm L 4 = 3mm, therefore, E2 = { E k | k =1, 2, ..., 4018}. For E2, the least squares method is used to fit the spatial plane, and the projected coordinates of all points in E1 on the spatial plane are calculated to construct E3 = { E l | l =1, 2, ..., 11334}. For E3, principal component analysis is used to construct a new base coordinate system, and this system is projected onto a two-dimensional coordinate system composed of principal and secondary vectors, thus constructing E4 = { E m | m =1, 2, ..., 11334}. For E4, the boundary of the circular hole feature is extracted using the rounding method, and E5 is constructed as follows: E n | n =1, 2, ..., 940}. Search for the 3D point cloud in E3 that corresponds to E5 in step six, and construct E6={ E o | o =1, 2, ..., 940}. Based on E6, a random sampling consensus algorithm (such as RANSAC) is used to fit the spatial circle equation. The center and diameter of the circle equation are the final center of the circular hole feature. P =( X , Y , Z ) = (75.0, 75.0, 10.0) and the final diameter D= 18.0.
[0113] For example, as shown in Table 1,
[0114]
[0115] Table 1. Initial and precise values for picking up circular hole features in the scanned point cloud of sheet metal parts.
[0116] As shown in Table 1, experiments were conducted to verify three typical circular hole features with different positions, directions, and diameters on the scanned point cloud of sheet metal parts. The pick points were randomly selected by the user using the mouse in the software's visual interface. These could be discrete points on the surface where the circular hole feature is located or discrete points on the inner wall of the circular hole feature. The distance between the discrete points and the boundary of the circular hole was approximately 2-10 pixels, or about 0.5mm-3mm. The results show that the initial error of the circular hole feature's center coordinates calculated based on the pick point coordinates is less than 0.1mm in the X, Y, and Z directions, and the initial diameter of the circular hole feature is less than 0.05mm, fully meeting the requirement of a circular hole feature pick accuracy of less than 1mm. The constraints on discrete point pick are low, and the robustness of the initial value calculation is strong. Based on the initial values of the center and diameter, the accurate values of the circular hole feature's center coordinates and diameter were calculated and fitted. The center coordinates were less than 0.05mm in the X, Y, and Z directions, and the diameter was less than 0.05mm, meeting the theoretical requirements for repeatability and reproducibility of the inspection equipment. In addition, the initial value extraction of the circular hole feature takes about 0.1 seconds, and the fitting of the accurate value takes about 1.5 seconds, which meets the requirements of practical engineering applications.
[0117] To better implement the circular hole feature picking method based on sheet metal part scanned point cloud in this embodiment of the invention, based on the circular hole feature picking method based on sheet metal part scanned point cloud, the corresponding method is as follows: Figure Six As shown, the present invention also provides an electronic device 700. The electronic device 700 includes a processor 701, a memory 702, and a display 703. Figure Six Only some components of the electronic device 700 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0118] In some embodiments, processor 701 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 702 or process data, such as the circular hole feature picking method based on sheet metal part scanning point cloud in this invention.
[0119] In some embodiments, processor 701 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 701 may be local or remote. In some embodiments, processor 701 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, intranet, multi-cloud, etc., or any combination thereof.
[0120] In some embodiments, memory 702 may be an internal storage unit of electronic device 700, such as a hard disk or memory of electronic device 700. In other embodiments, memory 702 may also be an external storage device of electronic device 700, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 700.
[0121] Furthermore, the memory 702 may include both internal storage units of the electronic device 700 and external storage devices. The memory 702 is used to store application software and various types of data installed on the electronic device 700.
[0122] In some embodiments, display 703 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 703 is used to display information from electronic device 700 and to display a visual user interface. Components 701-703 of electronic device 700 communicate with each other via a system bus.
[0123] In one embodiment, processor 701 executes a circular hole feature picking method program based on sheet metal part scanned point cloud stored in memory 702. It should be understood that when processor 701 executes the circular hole feature picking method program based on sheet metal part scanned point cloud stored in memory 702, in addition to the functions described above, it can also perform other functions, as detailed in the description of the corresponding method embodiments above.
[0124] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 700 mentioned. Electronic device 700 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 700 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0125] Accordingly, this application also provides a computer-readable storage medium for storing a computer-readable program or instruction. When the program or instruction is executed by a processor, it can implement the steps or functions of the circular hole feature picking method based on the scanning point cloud of sheet metal parts provided in the above-described method embodiments.
[0126] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0127] The above provides a detailed description of the method, equipment, and medium for picking up circular hole features based on the scanning point cloud of sheet metal parts provided by the present invention. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for picking circular hole features based on the scanned point cloud of sheet metal parts, characterized in that, include: Randomly select a discrete point around the circular hole feature in the scanned point cloud of the sheet metal part, and obtain the three-dimensional spatial coordinates of the discrete point; Using the discrete point as the center of a sphere, a first point cloud set is constructed by searching for neighboring point clouds with a first value as the radius, and a second point cloud set is constructed by searching for neighboring point clouds with a second value as the radius, wherein the first value is greater than the second value; Based on principal component analysis, a first base coordinate system with the discrete points as the origin is created for the second point cloud set; the first base coordinate system includes a first principal vector, a first vector vector, and a first component vector. A first vector set is constructed with the discrete point as the starting point and the points in the second point cloud set as the ending point. The projection length of the first vector set on the first vector is calculated. Based on the projection length, a third point cloud set in the first spatial plane where the circular hole feature is located is selected from the second point cloud set. Principal component analysis is used to construct a second base coordinate system with the discrete points as the origin for the third point cloud set, and the projection points of the discrete points on the fitted first spatial plane are calculated; the second base coordinate system includes a second principal vector, a second vector, and a second component vector; the fitted first spatial plane is a plane obtained by fitting the third point cloud set; A second vector set is constructed with the projection point as the starting point and the points in the third point cloud set as the ending point. The first principal projection length of the vector in the second vector set on the second principal vector, the first projection length on the second vector, and the first sub-projection length on the second sub-vector are calculated respectively. The direction of the second vector is corrected according to the first projection length. A fourth point cloud set is obtained by selecting point clouds from the first point cloud set whose absolute values of the first main projection length and the first sub-projection length are less than a preset length threshold, and whose first projection length is greater than the product result. A fifth point cloud set is obtained by selecting point clouds from the first point cloud set whose absolute values of the first main projection length and the first sub-projection length are less than the preset length threshold, and whose first projection length is less than the product result. The product result is equal to the product of the multiplier and the preset length threshold. Based on the projection points, the fourth point cloud set, and the fifth point cloud set, a first polynomial objective function and a second polynomial objective function are constructed on the second base coordinate system. The first extreme point that minimizes the first polynomial objective function and the second extreme point that maximizes the second polynomial objective function are then solved. The midpoint between the first extreme point and the second extreme point is taken as the initial value of the center of the circular hole feature, and the Euclidean distance between the first extreme point and the second extreme point is taken as the initial value of the diameter of the circular hole feature. Based on the initial values of the center and the diameter, point cloud boundary extraction and feature parameter fitting are performed to obtain the final center coordinates and final diameter of the circular hole feature.
2. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that, The distance between the discrete point and the boundary of the circular hole feature is less than one-fifth of the diameter of the circular hole feature.
3. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that, Both the first and second values are positively correlated with the sheet metal thickness and the resolution of the optical sensor. The preset length threshold is positively correlated with the resolution of the optical sensor, which is a sensor used to scan and acquire the point cloud of the sheet metal.
4. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that, If the absolute value of the maximum first projection length is greater than the absolute value of the minimum first projection length, then points whose first projection length is greater than the first length are selected from the second point cloud set to obtain the third point cloud set; if the absolute value of the maximum first projection length is less than or equal to the absolute value of the minimum first projection length, then points whose first projection length is greater than the first length by a negative number are selected from the second point cloud set to obtain the third point cloud set.
5. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that, The step of correcting the direction of the second vector based on the first projection length includes: When the absolute value of the maximum value of the first projection length is greater than the absolute value of the minimum value of the first projection length, the direction of the second vector is reversed; When the absolute value of the maximum value of the first projection length is less than or equal to the absolute value of the minimum value of the first projection length, the direction of the second vector remains unchanged.
6. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that, The construction of the first polynomial objective function and the second polynomial objective function on the second base coordinate system based on the projection points, the fourth point cloud set, and the fifth point cloud set includes: Starting from the projection point, and using the points in the fourth point cloud set and the fifth point cloud set as the endpoints, construct the third vector set and the fourth vector set respectively; Calculate the projection lengths of the vectors in the third vector set onto the second principal vector, the corrected second vector, and the second sub-vector, and construct a first polynomial objective function with respect to the projection lengths; Calculate the projection lengths of the vectors in the fourth vector set onto the second principal vector, the corrected second vector, and the second sub-vector, and construct a second polynomial objective function with respect to the projection lengths.
7. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that: in, ε 1 represents the objective function of the first polynomial. ε 2 represents the objective function of the second polynomial. M I , M J and M K These are the projection lengths of the vector onto the second principal vector, the corrected second vector, and the second sub-vector, respectively. M 0 represents the minimum length of the projection of the vector onto the corrected second vector. λ 1,1 , λ 1,2 , λ 1,3 , λ 2,1 , λ 2,2 and λ 2,3 This is the proportionality coefficient term.
8. The method for picking circular hole features based on the scanned point cloud of sheet metal parts according to claim 1, characterized in that, The step of extracting point cloud boundaries and fitting feature parameters based on the initial center value and the initial diameter value to obtain the final center coordinates and final diameter of the circular hole feature includes: Using the midpoint as the center of the sphere and the sum of the Euclidean distance and the first preset value as the radius, a sixth point cloud set is constructed by searching the point cloud closest to the midpoint in the scanned point cloud of the sheet metal part. The second spatial plane is obtained by fitting the sixth point cloud set using the least squares method. The distance from all points in the sixth point cloud set to the first spatial plane is calculated. Points with distances less than a distance threshold are selected from the sixth point cloud set to construct the seventh point cloud set. Calculate the distances from all points in the seventh point cloud set to the midpoint, and select points from the seventh point cloud set whose distances are greater than a first sum and less than a second sum to construct an eighth point cloud set; the first sum is equal to the sum of the Euclidean distance and a second preset value, and the second sum is equal to the sum of the Euclidean distance and a third preset value; The third spatial plane is obtained by fitting the eighth point cloud set using the least squares method, and the seventh point cloud set is projected onto the third spatial plane to construct the ninth point cloud set. A new base coordinate system is constructed using principal component analysis on the ninth point cloud set, and then projected onto a two-dimensional coordinate system composed of principal vectors and secondary vectors to obtain the tenth point cloud set. The boundary of the circular hole feature is extracted using the circularization method for the tenth point cloud to obtain the eleventh point cloud; Search the 3D point cloud in the ninth point cloud set that corresponds to the eleventh point cloud set to obtain the twelfth point cloud set; Based on the random sampling consensus algorithm, the twelfth point cloud set is fitted to obtain a spatial circle, and the center and diameter of the spatial circle are determined as the final center coordinates and the final diameter.
9. An electronic device, characterized in that, Including memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the circular hole feature picking method based on the scanning point cloud of sheet metal parts as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the circular hole feature picking method based on the scanning point cloud of sheet metal parts as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method for detecting hook face circular hole based on three-dimensional point cloud
CN103886593A
Body-in-white sheet metal part hole feature visual detection method and system
CN118913090A