Arc fitting method and device, electronic equipment and readable storage medium

By collecting point clouds and separating the connection domains at the edges of the to be detected, point cloud information is randomly obtained for spatial circle fitting, and reliable models are determined, which solves the insufficient accuracy and high computational complexity of the arc fitting method in the existing technology. The problem of this achieves higher fitting accuracy and stability.

CN118898633APending Publication Date: 2024-11-05FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410942762.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

The existing arc fitting methods are insufficiently accurate when noise and outliers exist, have high computational complexity, and have strong parameter selection dependence, which makes them prone to falling into local minimum values ​​and it is difficult to obtain a global optimal model in specific situations.

Method used

By collecting point clouds and separating the connected domains at the edges of the to be detected, a preset number of point cloud information is randomly obtained, spatial circle fitting is performed based on point cloud information, parameter information of point clouds and spatial circle planes is calculated, and reliable model is determined. And optimized by least squares method, iterating repeatedly until the number of loops is reached to obtain the optimal model.

Benefits of technology

The accuracy and stability of arc fitting are improved, noise and outliers are avoided, and the reliability and accuracy of the model are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898633A_ABST
    Figure CN118898633A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an arc fitting method and device, electronic equipment and a readable storage medium, and relates to the field of data processing, and the method comprises the steps: carrying out the point cloud collection of the edge of a to-be-detected workpiece, carrying out the connected domain separation of the point cloud, obtaining a plurality of connected regions, randomly obtaining the information of a preset number of point clouds for each connected region, and carrying out the calculation of the preset number of point clouds. Performing spatial circle fitting based on the point cloud information to obtain a spatial circle plane, calculating first parameter information of all points in the point cloud and the spatial circle plane, determining a plurality of reliable models based on the first parameter information, determining an optimal reliable model from the reliable models, and performing arc fitting based on the optimal reliable model to obtain an arc fitting result; and obtaining a fitting arc group formed by the plurality of arcs, and determining a target arc corresponding to the to-be-detected workpiece from the fitting arc group. The precision of arc fitting is ensured, so that the accuracy of arc fitting is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to an arc fitting method, device, electronic equipment and readable storage medium. Background Art

[0002] The basic idea of ​​the RANSAC (RANdom SAmple Consensus) algorithm is to randomly extract a subset from the data, use this subset to estimate the parameters of the model, and then verify whether other data points also conform to the model. This process is repeated many times, and the model generated each time is either discarded because of too few data points, or selected because it is better than the existing model. The RANSAC algorithm has the following characteristics: it is robust to noise and outliers. Since the RANSAC algorithm estimates model parameters through random sampling and model verification, it can obtain relatively accurate results even if the data contains a lot of noise and outliers. The computational complexity is high. Since the RANSAC algorithm needs to perform random sampling and model verification processes many times, its computational complexity is high. In practical applications, it is necessary to select appropriate parameters such as the number of iterations and thresholds according to the specific situation.

[0003] Based on the Hough arc fitting method, the arc can be uniquely determined by three parameters, the center coordinates (x, y, z) and the radius r. For the arc, the parameter space is a three-dimensional space, in which each point represents a combination of the center and the radius. For each point P, all possible centers C and radii r are traversed in the parameter space, and the relationship between these combinations and P is calculated. A common relationship is whether the distance from the point to the center is equal to the radius r, or whether the point P is inside or on the boundary of the circle formed by the center C and the radius r. If the conditions are met, a vote is performed. Find the combination of center and radius with the most votes in the parameter space, usually by finding the point or area with the highest voting value. Use the optimal parameters to fit the arc. The least squares method or other optimization algorithms can be used to optimize the fitting results so that the fitted arc best matches the point cloud data.

[0004] The RANSAC algorithm is a powerful fitting algorithm, but in certain cases, especially in the aided fitting problem, it also has some disadvantages and limitations: (1) Dependence on parameter selection. The performance of the RANSAC algorithm is highly dependent on the selection of parameters, including the number of iterations, tolerance threshold, and sampling size. Incorrect parameter selection may lead to inaccurate or instability in model estimation.

[0005] The RANSAC algorithm is easily disturbed by some noise points. In some cases, the RANSAC algorithm may fall into a local minimum, resulting in the found model not being the global optimal one.

[0006] Some disadvantages of Hough transform: (1) It needs to traverse the parameter space and accumulate votes, which will lead to high computational complexity of the algorithm, especially when the parameter space dimension is high or the point cloud data is large. (2) It is sensitive to noise because noise points may generate additional votes in the parameter space, thus affecting the accuracy of the fitting results. Summary of the invention

[0007] The object of the present invention is to provide an arc fitting method, device, electronic device and readable storage medium, which can improve the accuracy of arc fitting.

[0008] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0009] In a first aspect, an embodiment of the present application provides an arc fitting method, the method comprising:

[0010] Collecting point clouds from the edges of the workpiece to be inspected, and separating the connected domains of the point clouds to obtain multiple connected regions;

[0011] For each of the connected areas, randomly acquiring a preset number of point cloud information;

[0012] Performing spatial circle fitting based on each of the point cloud information to obtain a spatial circular plane;

[0013] Calculate first parameter information of all points in the point cloud and the space circular plane;

[0014] Determine a reliable model based on each of the first parameter information;

[0015] Returning to the step of randomly acquiring a preset number of point cloud information for each of the connected areas to the step of determining a reliable model based on each of the first parameter information, until the number of cycles is reached, and a plurality of reliable models are obtained;

[0016] Determining an optimal reliable model from among the reliable models;

[0017] Perform arc fitting based on the optimal reliable model to obtain a fitting arc group consisting of multiple arcs;

[0018] A target arc corresponding to the workpiece to be inspected is determined from the fitting arc group.

[0019] Optionally, the step of collecting point clouds of edges of the workpiece to be inspected and separating connected domains of the point clouds to obtain a plurality of connected regions includes:

[0020] Collect point cloud of the edge of the workpiece to be inspected;

[0021] For each first point in the point cloud, calculating a first distance between the first point and each second point in the point cloud, wherein the point cloud includes a plurality of first points, and the second points are each point in the point cloud except the first point;

[0022] comparing each of the first distances with a preset distance;

[0023] When the first distance is greater than the preset distance, dividing the points corresponding to the first distance into a first connected area;

[0024] When the first distance is less than or equal to the preset distance, the points corresponding to the first distance are divided into a second connected area.

[0025] Optionally, the step of determining a target arc corresponding to the workpiece to be detected from the fitting arc group includes:

[0026] For each first arc group in the fitting arc group, determine each second arc parallel to the first arc group from each first arc, wherein the fitting arc group is composed of a plurality of first arc groups, and arc groups other than the first arc group in the fitting arc group constitute each first arc;

[0027] determining the number of each of the second circular arcs;

[0028] Return to executing the step of determining each second circular arc parallel to the first circular arc group from each first circular arc to the step of determining the number of each second circular arc for each first circular arc group in the fitting circular arc group, until each first circular arc group is traversed to obtain the number of each second circular arc corresponding to each first circular arc group;

[0029] Determine a second arc group corresponding to the maximum number from among the numbers;

[0030] The workpiece to be detected is converted to the point cloud corresponding to the workpiece to be detected by point cloud registration to obtain a target circle corresponding to the workpiece to be detected;

[0031] A target arc matching the target circle is determined from the target arc group, wherein the target arc group is formed by the first arc group corresponding to the second arc group corresponding to the maximum number and the second arc group.

[0032] Optionally, the step of determining a target arc matching the target circle from a target arc group comprises:

[0033] Calculating second parameter information of each first target arc in the target arc group and the target circle, wherein the second parameter information includes a second distance, a radius difference, and a normal vector angle between the first target arc and the target circle;

[0034] A first target arc corresponding to the minimum second parameter information is obtained from each of the second parameter information as a target arc.

[0035] Optionally, the step of calculating first parameter information of all points in the point cloud and the space circular plane includes:

[0036] For each point in the point cloud, calculating a plane distance between the point and the plane of the space circle;

[0037] Calculating a third distance between the point and the center of the space circular plane;

[0038] Calculating a difference between the third distance and the radius of the spatial circular plane;

[0039] Each of the plane distances and each of the differences is used as first parameter information of the point and the space circular plane.

[0040] Optionally, the step of determining a reliable model based on each of the first parameter information includes:

[0041] For each of the plane distances, comparing the plane distance with a first preset threshold;

[0042] When the plane distance is less than or equal to the first preset threshold, comparing the difference corresponding to the plane distance with a second preset threshold;

[0043] When the difference corresponding to the plane distance is less than or equal to the second preset threshold, determining the point corresponding to the plane distance and the difference as a local point;

[0044] Determining the number of local points of each of the local points;

[0045] Comparing the number of local points with a preset number;

[0046] When the number of the local points is greater than or equal to the preset number, each of the local points is used to form a reliable model.

[0047] Optionally, the step of determining the optimal reliable model from the reliable models comprises:

[0048] Determining the number of local points in each of the reliable models;

[0049] Obtain the target local point quantity corresponding to the maximum quantity from the quantities of each local point;

[0050] The target local points corresponding to the number of target local points constitute an optimal reliable model.

[0051] In a second aspect, an embodiment of the present application provides an arc fitting device, the device comprising:

[0052] A separation module is used to collect point clouds from the edges of the workpiece to be inspected, and separate the point clouds into connected domains to obtain multiple connected regions;

[0053] An acquisition module, used for randomly acquiring a preset amount of point cloud information for each of the connected areas;

[0054] A fitting module, used for performing spatial circle fitting based on each of the point cloud information to obtain a spatial circle plane;

[0055] A calculation module, used for calculating first parameter information of all points in the point cloud and the space circular plane;

[0056] A determination module, configured to determine a reliable model based on each of the first parameter information;

[0057] An execution module, used for returning to execute the step of randomly acquiring a preset number of point cloud information for each of the connected areas to the step of determining a reliable model based on each of the first parameter information, until the number of cycles is reached, and a plurality of reliable models are obtained;

[0058] The determination module is further used to determine the optimal reliable model from each of the reliable models;

[0059] The fitting module is further used to perform arc fitting based on the optimal reliable model to obtain a fitting arc group consisting of multiple arcs;

[0060] The determination module is further used to determine a target arc corresponding to the workpiece to be detected from the fitting arc group.

[0061] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the arc fitting method when executing the computer program.

[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the arc fitting method when executed by a processor.

[0063] This application has the following beneficial effects:

[0064] The present application collects point cloud from the edge of the workpiece to be inspected, separates the point cloud into connected domains, obtains multiple connected areas, randomly obtains a preset number of point cloud information for each connected area, performs spatial circle fitting based on each point cloud information, obtains a spatial circular plane, calculates the first parameter information of all points in the point cloud and the spatial circular plane, determines a reliable model based on each first parameter information, returns to execute the step of randomly obtaining a preset number of point cloud information for each connected area to the step of determining a reliable model based on each first parameter information, until the number of cycles is reached, obtains multiple reliable models, determines the optimal reliable model from each reliable model, performs arc fitting based on the optimal reliable model, obtains a fitting arc group composed of multiple arcs, and determines the target arc corresponding to the workpiece to be inspected from the fitting arc group. The point cloud of the workpiece to be inspected is divided into multiple connected areas to ensure that the connected domain separation algorithm can accurately segment the edge of the point cloud and avoid omission or misclassification. The spatial circular plane where the arc is located is determined by the least squares method, and the points around the spatial circular plane are fitted with the arc by the random sample consistency algorithm, which ensures the accuracy of arc fitting, thereby improving the accuracy of arc fitting. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0066] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention;

[0067] Figure 2 One of the flow charts of an arc fitting method provided by an embodiment of the present invention;

[0068] Figure 3 A schematic diagram of the fitting effect of a fitting arc group provided in an embodiment of the present invention;

[0069] Figure 4 A second flow chart of an arc fitting method provided by an embodiment of the present invention;

[0070] Figure 5 A third flow chart of an arc fitting method provided by an embodiment of the present invention;

[0071] Figure 6 A fourth flow chart of an arc fitting method provided by an embodiment of the present invention;

[0072] Figure 7A fifth flow chart of an arc fitting method provided by an embodiment of the present invention;

[0073] Figure 8 A structural block diagram of an arc fitting device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0075] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0076] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0077] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0078] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0079] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0080] After extensive research, the inventors found that the existing arc fitting method has poor accuracy.

[0081] In view of the discovery of the above problems, the present embodiment provides an arc fitting method, device, electronic device and readable storage medium, which can collect point cloud from the edge of the workpiece to be inspected, separate the point cloud into connected domains, obtain multiple connected areas, randomly obtain a preset number of point cloud information for each connected area, perform spatial circle fitting based on each point cloud information, obtain a spatial circular plane, calculate each first parameter information of all points in the point cloud and the spatial circular plane, determine a reliable model based on each first parameter information, return to execute the step of randomly obtaining a preset number of point cloud information for each connected area to the step of determining a reliable model based on each first parameter information, until the number of cycles is reached, obtain multiple reliable models, determine the optimal reliable model from each reliable model, perform arc fitting based on the optimal reliable model, obtain a fitting arc group composed of multiple arcs, and determine the target arc corresponding to the workpiece to be inspected from the fitting arc group. Divide the point cloud of the workpiece to be inspected into multiple connected areas to ensure that the connected domain separation algorithm can accurately segment the edge of the point cloud to avoid missing or misclassifying. The spatial circular plane where the arc is located is determined by the least squares method, and the points around the spatial circular plane are obtained to fit the arc using a random sample consistency algorithm, thereby ensuring the accuracy of the arc fitting and thus improving the accuracy of the arc fitting. The solution provided in this embodiment is described in detail below.

[0082] This embodiment provides an electronic device that can fit an arc. In a possible implementation, the electronic device can be a user terminal, for example, the electronic device can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc.

[0083] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of the structure of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0084] The electronic device 100 includes an arc fitting device 110 , a memory 120 and a processor 130 .

[0085] The memory 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The arc fitting device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the arc fitting device 110.

[0086] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.

[0087] Please refer to Figure 2 , Figure 2 For application Figure 1 A flow chart of an arc fitting method of an electronic device 100 is shown, and the method including various steps is described in detail below.

[0088] S201: collecting point clouds from the edges of the workpiece to be inspected, and separating the point clouds into connected domains to obtain multiple connected regions.

[0089] S202: For each connected area, randomly obtain a preset amount of point cloud information.

[0090] S203: Perform spatial circle fitting based on each point cloud information to obtain a spatial circle plane.

[0091] S204: Calculate first parameter information of all points in the point cloud and the space circular plane.

[0092] S205: Determine a reliable model based on each first parameter information.

[0093] S206: Return to the step of randomly acquiring a preset number of point cloud information for each connected area to the step of determining a reliable model based on each first parameter information until the number of cycles is reached to obtain multiple reliable models.

[0094] S207: Determine the optimal reliable model from various reliable models.

[0095] S208: Perform arc fitting based on the optimal reliable model to obtain a fitting arc group consisting of multiple arcs.

[0096] S209: Determine a target arc corresponding to the workpiece to be inspected from the fitted arc group.

[0097] In arc fitting, the existence of rivet welds and noise points leads to deviation in fitting accuracy, which exceeds the actual required accuracy range of less than 2 mm. Rivet welds introduce additional uncertainty, while noise points interfere with the accuracy of the fitting algorithm. Due to the influence of these factors, there is a large gap between the final fitting result and the actual situation.

[0098] In order to avoid the problem of poor fitting accuracy, the point cloud of the edge of the workpiece to be inspected is separated into connected domains, and arc fitting is performed based on the separated connected regions.

[0099] It should be noted that the workpiece to be inspected may be a workpiece to be welded, and the point cloud of the edge of the workpiece to be inspected may be collected, and the edge of the workpiece to be inspected may be segmented by connecting domain separation to obtain multiple connected regions. The connected domain separation method for the point cloud may be a clustering method based on Euclidean distance, and the connected domain separation is performed according to a set threshold value to obtain multiple corresponding connected regions.

[0100] A preset number of point cloud information is randomly obtained from each connected area, and a spatial circle is fitted based on each point cloud information to obtain a spatial circular plane.

[0101] Exemplarily, when the connected area includes a first connected area and a second connected area, a preset amount of first point cloud information is obtained from the first connected area, a preset amount of second point cloud information is obtained from the second connected area, and spatial circle fitting is performed based on the first point cloud information and the second point cloud information.

[0102] It should be noted that the preset number can be 3, and the embodiment of the present application does not impose any specific limitation on this.

[0103] When the preset number is 3, 6 point cloud information is obtained from the first connected area and the second connected area, and the space circle is fitted based on the following formula based on the 6 point cloud information:

[0104]

[0105] Among them, A is the normal vector of the X axis, B is the normal vector of the Y axis, C is the normal vector of the Z axis, D is the length, (x0, y0, z0) is the center of the space circular plane, and R is the radius of the space circular plane.

[0106] Based on the above equations, the space circular plane can be obtained.

[0107] The first parameter information of each point cloud of the edge of the workpiece to be detected is determined based on the spatial circular plane, and a reliable model is determined based on the first parameter information.

[0108] The random point cloud information is acquired again for each connected area, and the space circle fitting is performed based on the randomly acquired point cloud information to obtain a new space circle plane, and the new first parameter information of each point cloud of the edge of the workpiece to be detected is calculated based on the new space circle plane, and a new reliable model is obtained based on the new first parameter information. The above steps are repeated until the number of cycles is reached to obtain multiple reliable models, and the optimal reliable model is obtained from the multiple reliable models, and arc fitting is performed based on the optimal reliable model to obtain a fitting arc group, such as Figure 3 As shown in FIG. 1 , it is a schematic diagram of the fitting effect of the fitting arc group, and the target arc is obtained from the fitting arc group.

[0109] There are many ways to collect point clouds at the edge of the workpiece to be inspected, separate the connected domains, and obtain multiple connected regions. In one implementation, Figure 4 As shown, the following steps are included:

[0110] S201-1: Collect point cloud of the edge of the workpiece to be inspected.

[0111] S201 - 2 : For each first point in the point cloud, calculate a first distance between the first point and each second point in the point cloud.

[0112] The point cloud includes multiple first points, and the second points are points in the point cloud except the first points.

[0113] S201 - 3: Compare each first distance with a preset distance.

[0114] S201-4: When the first distance is greater than a preset distance, divide the points corresponding to the first distance into a first connected area.

[0115] S201-5: When the first distance is less than or equal to the preset distance, divide the points corresponding to the first distance into a second connected area.

[0116] Through the clustering method of Euclidean distance, the connected domains are separated according to the preset distance size to obtain the corresponding first connected area and second connected area.

[0117] The weld edge is divided into multiple regions by the above-mentioned connected domain separation method, and an optimized random sampling consistent arc fitting algorithm is executed for each region, which can help solve the inaccuracy problem of traditional random sampling consistent algorithm and Hough transform method in fitting the weld edge.

[0118] There are many ways to determine the target arc corresponding to the workpiece to be detected from the fitting arc group. In one implementation, Figure 5 As shown, the following steps are included:

[0119] S209 - 1 : For each first arc group in the fitted arc group, determine each second arc parallel to the first arc group from each first arc.

[0120] The fitting arc group is composed of a plurality of first arc groups, and arc groups other than the first arc group in the fitting arc group constitute each first arc.

[0121] S209-2: Determine the number of second arcs.

[0122] S209-3: Return to executing the step of determining the second arcs parallel to the first arc group from the first arcs for each first arc group in the fitting arc group, to the step of determining the number of the second arcs, until the traversal of the first arc groups is completed to obtain the number of the second arcs corresponding to the first arc groups.

[0123] S209-4: Determine the second arc group corresponding to the maximum number from among the numbers.

[0124] S209-5: Convert the workpiece to be detected to the point cloud corresponding to the workpiece to be detected through point cloud registration to obtain a target circle corresponding to the workpiece to be detected.

[0125] S209-6: Determine a target arc that matches the target circle from the target arc group.

[0126] The target arc group is formed by the first arc group and the second arc group corresponding to the second arc group corresponding to the maximum number.

[0127] A specific method for determining a target arc that matches a target circle from a target arc group may be: calculating the second parameter information of each first target arc and the target circle in the target arc group, wherein the second parameter information includes a second distance between the first target arc and the target circle, a radius difference, and a normal vector angle, and obtaining the first target arc corresponding to the minimum second parameter information as the target arc from each second parameter information.

[0128] Through point cloud registration, the relative position relationship between the workpiece to be detected and the collected point cloud is obtained. After the workpiece matrix conversion, the target circle corresponding to the workpiece to be detected is obtained.

[0129] For each first arc group in the fitting arc group, the first arc group with the largest number of parallelism is found from the fitting arc group as the second arc group.

[0130] In a welding scenario, an arc must be composed of a disc and another object, so there naturally exists a set of arc parameters that are parallel to each other. By using this property, arcs that meet the conditions can be screened out more accurately.

[0131] Specifically, for each first arc group in the fitting arc group, determine the other first arcs in the fitting arc group except the first arc group. The first arc group includes circle A and circle B. Since circle A and circle B are parallel to each other, the angle between the normal vector of each first arc and the normal vector of circle A or circle B can be calculated. If the angle between the first arc and the normal vector of circle A or circle B is less than the preset angle, it is determined that the first arc is parallel to circle A or circle B. Count the number of first arcs that are relatively parallel to circle A or circle B, obtain the number of sources that each first arc is relatively parallel to each first arc group, and record it in the hash table. After counting the relative parallel number, the code will traverse the hash table and determine the second arc group corresponding to the maximum number from each number. The first arc group corresponding to the second arc group corresponding to the maximum number and the second arc group constitute the target arc group.

[0132] According to the point cloud registration, the workpiece to be detected is converted to the point cloud corresponding to the workpiece to be detected, and the target circle corresponding to the workpiece to be detected is obtained. The second parameter information of the second distance, radius difference and normal vector angle between each first target arc in the target arc group and the target circle is calculated, and the first target arc corresponding to the minimum second parameter information is obtained from each second parameter information as the target arc. That is, the circle with the shortest distance and the smallest radius difference and normal vector angle is found from the target arc group as the closest circle, which is used as the target arc of the workpiece to be detected.

[0133] Through the above arc fitting method, the fitting process of each weld area can be better controlled, and the influence of relatively far points on the fitting results can be reduced, thereby improving the accuracy and stability of arc fitting. In addition, according to the properties of circular symmetry and parallelism in welding, the parameters most likely to be the location of the welding arc can be screened out, which can further improve the accuracy and reliability of fitting.

[0134] There are many ways to calculate the first parameter information of all points in the point cloud and the space circular plane. In one implementation, for example, Figure 6 As shown, the following steps are included:

[0135] S204-1: For each point in the point cloud, calculate the plane distance between the point and the plane of the space circle.

[0136] S204-2: Calculate the third distance between the point and the center of the space circular plane.

[0137] S204-3: Calculate the difference between the third distance and the radius of the spatial circular plane.

[0138] S204-4: Use each plane distance and each difference as the first parameter information of the point and the space circular plane.

[0139] For the spatial circular planes obtained by randomly obtaining a preset number of point cloud information from the connected area and fitting, for each spatial circular plane, the plane distance from all points in the point cloud to each fitted spatial circular plane is calculated, and the third distance from all points in the point cloud to each spatial circular plane is calculated based on the Euclidean distance. The difference between the calculated third distance of each spatial circular plane and the radius of the spatial circular plane is calculated.

[0140] There are many implementations for determining a reliable model based on each first parameter information. In one implementation, for example, Figure 7 As shown, the following steps are included:

[0141] S301: For each plane distance, compare the plane distance with a first preset threshold.

[0142] S302: When the plane distance is less than or equal to the first preset threshold, compare the difference corresponding to the plane distance with a second preset threshold.

[0143] S303: When the difference corresponding to the plane distance is less than or equal to a second preset threshold, determine that the point corresponding to the plane distance and the difference is a local point.

[0144] S304: Determine the number of local points of each local point.

[0145] S305: Compare the number of local points with a preset number.

[0146] S306: When the number of local points is greater than or equal to a preset number, each local point is used to form a reliable model.

[0147] It should be noted that the first preset threshold and the second preset threshold can be set based on the actual welding scene, and the embodiment of the present application does not limit this.

[0148] Scan the third distance corresponding to all point clouds and the difference between the third distance and the radius of the corresponding space circular plane. If the difference between the third distance and the radius of the corresponding space circular plane is within the set threshold range, the point can be considered as a local point. After the traversal is completed, calculate the number of all local points. If the number of local points is greater than the preset number, the model is considered to be a reliable model.

[0149] The method of determining the optimal reliable model from each reliable model is specifically as follows: determining the number of local points in each reliable model, obtaining the target local point number corresponding to the maximum number from the number of local points, and forming the optimal reliable model with the target local points corresponding to the target local point number.

[0150] Please refer to Figure 8 The present application embodiment also provides an application Figure 1 The arc fitting device 110 of the electronic device 100 includes:

[0151] A separation module 111 is used to collect point clouds from the edges of the workpiece to be inspected, and separate the point clouds into connected domains to obtain multiple connected regions;

[0152] An acquisition module 112 is used to randomly acquire a preset amount of point cloud information for each of the connected areas;

[0153] A fitting module 113 is used to perform space circle fitting based on each of the point cloud information to obtain a space circle plane;

[0154] A calculation module 114, used for calculating first parameter information of all points in the point cloud and the space circular plane;

[0155] A determination module 115, configured to determine a reliable model based on each of the first parameter information;

[0156] An execution module 116 is used to return to the step of randomly acquiring a preset number of point cloud information for each of the connected areas to the step of determining a reliable model based on each of the first parameter information until the number of cycles is reached and multiple reliable models are obtained;

[0157] The determination module 115 is further used to determine the optimal reliable model from each of the reliable models;

[0158] The fitting module 113 is further used to perform arc fitting based on the optimal reliable model to obtain a fitting arc group consisting of multiple arcs;

[0159] The determination module 115 is further configured to determine a target arc corresponding to the workpiece to be inspected from the fitting arc group.

[0160] The present application also provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer executable instructions, and when the computer executable instructions are executed by the processor 130, the arc fitting method is implemented.

[0161] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the arc fitting method is implemented.

[0162] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0163] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

[0164] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0165] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A circular arc fitting method, characterized in that: The method comprises: Collecting point clouds from the edges of the workpiece to be inspected, and separating the connected domains of the point clouds to obtain multiple connected regions; For each of the connected areas, randomly obtaining a preset number of point cloud information; Performing spatial circle fitting based on each of the point cloud information to obtain a spatial circular plane; Calculate first parameter information of all points in the point cloud and the space circular plane; Determine a reliable model based on each of the first parameter information; Returning to the step of randomly acquiring a preset number of point cloud information for each of the connected areas to the step of determining a reliable model based on each of the first parameter information, until the number of cycles is reached, and a plurality of reliable models are obtained; Determining an optimal reliable model from among the reliable models; Perform arc fitting based on the optimal reliable model to obtain a fitting arc group consisting of multiple arcs; A target arc corresponding to the workpiece to be inspected is determined from the fitting arc group.

2. The method according to claim 1, characterized in that The step of collecting point clouds of the edges of the workpiece to be inspected and separating the connected domains of the point clouds to obtain a plurality of connected regions comprises: Collect point cloud of the edge of the workpiece to be inspected; For each first point in the point cloud, calculating a first distance between the first point and each second point in the point cloud, wherein the point cloud includes a plurality of first points, and the second points are each point in the point cloud except the first point; comparing each of the first distances with a preset distance; When the first distance is greater than the preset distance, dividing the points corresponding to the first distance into a first connected area; When the first distance is less than or equal to the preset distance, the points corresponding to the first distance are divided into a second connected area.

3. The method according to claim 1, characterized in that: The step of determining the target arc corresponding to the workpiece to be detected from the fitting arc group includes: For each first arc group in the fitting arc group, determine each second arc parallel to the first arc group from each first arc, wherein the fitting arc group is composed of a plurality of first arc groups, and arc groups other than the first arc group in the fitting arc group constitute each first arc; determining the number of each of the second circular arcs; Return to executing the step of determining each second circular arc parallel to the first circular arc group from each first circular arc to the step of determining the number of each second circular arc for each first circular arc group in the fitting circular arc group, until each first circular arc group is traversed to obtain the number of each second circular arc corresponding to each first circular arc group; Determine a second arc group corresponding to the maximum number from among the numbers; The workpiece to be detected is converted to the point cloud corresponding to the workpiece to be detected by point cloud registration to obtain a target circle corresponding to the workpiece to be detected; A target arc matching the target circle is determined from the target arc group, wherein the target arc group is formed by the first arc group corresponding to the second arc group corresponding to the maximum number and the second arc group.

4. The method according to claim 3, characterized in that The step of determining a target arc matching the target circle from the target arc group comprises: Calculating second parameter information of each first target arc in the target arc group and the target circle, wherein the second parameter information includes a second distance, a radius difference, and a normal vector angle between the first target arc and the target circle; A first target arc corresponding to the minimum second parameter information is obtained from each of the second parameter information as a target arc.

5. The method according to claim 1, characterized in that The step of calculating first parameter information of all points in the point cloud and the space circular plane comprises: For each point in the point cloud, calculating a plane distance between the point and the plane of the space circle; Calculating a third distance between the point and the center of the space circular plane; Calculating a difference between the third distance and the radius of the spatial circular plane; Each of the plane distances and each of the differences is used as first parameter information of the point and the space circular plane.

6. The method according to claim 5, characterized in that The step of determining a reliable model based on each of the first parameter information comprises: For each of the plane distances, comparing the plane distance with a first preset threshold; When the plane distance is less than or equal to the first preset threshold, comparing the difference corresponding to the plane distance with a second preset threshold; When the difference corresponding to the plane distance is less than or equal to the second preset threshold, determining the point corresponding to the plane distance and the difference as a local point; Determining the number of local points of each of the local points; Comparing the number of local points with a preset number; When the number of the local points is greater than or equal to the preset number, each of the local points is used to form a reliable model.

7. The method according to claim 6, characterized in that The step of determining the optimal reliable model from the reliable models comprises: Determining the number of local points in each of the reliable models; Obtain the target local point quantity corresponding to the maximum quantity from the quantities of each local point; The target local points corresponding to the number of target local points constitute an optimal reliable model.

8. A circular arc fitting device, characterized in that: The device comprises: A separation module is used to collect point clouds from the edges of the workpiece to be inspected, and separate the point clouds into connected domains to obtain multiple connected regions; An acquisition module, used for randomly acquiring a preset amount of point cloud information for each of the connected areas; A fitting module, used for performing spatial circle fitting based on each of the point cloud information to obtain a spatial circle plane; A calculation module, used for calculating first parameter information of all points in the point cloud and the space circular plane; A determination module, configured to determine a reliable model based on each of the first parameter information; An execution module, used for returning to execute the step of randomly acquiring a preset number of point cloud information for each of the connected areas to the step of determining a reliable model based on each of the first parameter information, until the number of cycles is reached, and a plurality of reliable models are obtained; The determination module is further used to determine the optimal reliable model from each of the reliable models; The fitting module is further used to perform arc fitting based on the optimal reliable model to obtain a fitting arc group consisting of multiple arcs; The determination module is further used to determine a target arc corresponding to the workpiece to be detected from the fitting arc group.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Interlayer contour matching method based on primitive shape information

    CN103310232A

  • Round hole feature extraction method

    CN109859206A

  • Robot positioning method, device, facility and medium based on arc feature extraction

    CN110253579A

  • Conical surface fitting method and device, computer equipment and storage medium

    CN112017290A

  • Method for efficiently and accurately identifying arc features

    CN114114316A