Arc weld extraction method and device

By determining whether the target plane is theoretically intersecting with the target cylindrical surface, combined with the point cloud distribution, determine the true existence of the arc weld, solve the problem of extracting the wrong position in the existing technology, and realize the accurate arc welded joints. extract.

CN118762038BActive Publication Date: 2025-01-24FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411244728.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-01-24
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

In the prior art, when extracting arc welds from point clouds, it is easy to obtain wrong positions because the directly calculated plane and cylindrical surface intersection line does not necessarily correspond to the real arc weld.

Method used

By determining whether the target plane intersects the theoretical intersection with the target cylindrical surface, and the theoretical intersection is the standard circle or ellipse, combined with the distribution of the three -dimensional point in the target plane point cloud and the target cylindrical point cloud, determine whether there is a real arc welding seam Essence

Benefits of technology

Accurately obtain the position of the arc weld and avoid erroneous extraction due to insufficient consideration of the plane and cylindrical surface range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762038B_ABST
    Figure CN118762038B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a circular arc weld extraction method and device, which relates to the field of computer technology. The method includes: judging whether the target plane and the target cylindrical surface intersect in theory and whether the theoretical intersection line is a standard circle or an ellipse, and the target plane and the target cylindrical surface are the surfaces detected from the target object point cloud; if yes, judging whether there is a real circular arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtaining the existing real circular arc as the extracted circular arc weld when it is determined that it exists, the target plane point cloud is the local point cloud corresponding to the target plane in the target object point cloud, and the target cylindrical surface point cloud is the local point cloud corresponding to the target cylindrical surface in the target object point cloud. In this way, the position of the circular arc weld can be accurately obtained based on the target object point cloud.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for extracting circular arc welds. Background Art

[0002] At present, arc weld extraction is generally performed based on point cloud by the following method: the equation of the plane and the equation of the cylinder in the point cloud are detected, the intersection line of the plane and the cylinder is calculated based on the equation, and the intersection line is used as the position of the arc weld. However, the intersection line obtained above is not necessarily the real arc weld, that is, the above method will obtain the wrong arc weld position. Summary of the invention

[0003] The embodiments of the present application provide a circular arc weld extraction method, device, electronic device and readable storage medium, which can accurately obtain the position of the circular arc weld based on the point cloud of the target object.

[0004] The embodiments of the present application can be implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for extracting an arc weld, the method comprising:

[0006] Determine whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse, wherein the target plane and the target cylindrical surface are surfaces detected from the point cloud of the target object;

[0007] If yes, determine whether there is a real arc on the theoretical intersection line based on the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and when it is determined that there is a real arc, obtain the existing real arc as the extracted arc weld, wherein the target plane point cloud is the local point cloud in the target object point cloud corresponding to the target plane, and the target cylindrical surface point cloud is the local point cloud in the target object point cloud corresponding to the target cylindrical surface.

[0008] In a second aspect, an embodiment of the present application provides an arc weld extraction device, the device comprising:

[0009] An analysis module, for determining, with respect to a target plane and a target cylindrical surface, whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse, wherein the target plane and the target cylindrical surface are surfaces detected from a point cloud of a target object;

[0010] The extraction module is used to determine whether there is a real arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtain the existing real arc as the extracted arc weld when it is determined that it exists, wherein the target plane point cloud is a local point cloud in the target object point cloud corresponding to the target plane, and the target cylindrical surface point cloud is a local point cloud in the target object point cloud corresponding to the target cylindrical surface.

[0011] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the arc weld extraction method described in the aforementioned embodiment.

[0012] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the arc weld extraction method as described in the aforementioned embodiment is implemented.

[0013] The arc weld extraction method, device, electronic device and readable storage medium provided by the embodiment of the present application, when it is determined that the target plane and the target cylindrical surface detected from the target object point cloud theoretically intersect and the theoretical intersection line is a standard circle or ellipse, according to the distribution of three-dimensional points in the target plane point cloud corresponding to the target plane and the target cylindrical surface point cloud corresponding to the target cylindrical surface in the target object point cloud, it is judged whether there is a real arc on the theoretical intersection line, and when it is determined that there is a real arc, the real arc that exists is obtained, and the real cylinder is used as the extracted arc weld. In this way, the position of the arc weld can be accurately obtained based on the target object point cloud. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application 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 paying creative work.

[0015] Figure 1 It is three schematic diagrams of plane and cylindrical surface;

[0016] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;

[0017] Figure 3 A schematic diagram of a flow chart of a circular arc weld extraction method provided in an embodiment of the present application;

[0018] Figure 4 for Figure 3 A schematic flow chart of the sub-steps included in step S100;

[0019] Figure 5 A schematic diagram of a process for obtaining all arc welds in a point cloud of a target object provided in an embodiment of the present application;

[0020] Figure 6 for Figure 3 One of the flowcharts of the sub-steps included in step S200;

[0021] Figure 7 Schematic diagram of arcs intersecting and not intersecting;

[0022] Figure 8 for Figure 6 A schematic flow chart of the sub-steps included in sub-step S230;

[0023] Fig. 9 It is a schematic diagram of the combination of the central angle of an arc;

[0024] Fig.10 for Figure 6 A schematic flow chart of the sub-steps included in sub-step S240;

[0025] Fig.11 for Fig.10 One of the flow diagrams of the sub-steps included in sub-step S242;

[0026] Fig.12 for Fig.10 The second schematic flow chart of the sub-steps included in the neutron step S242;

[0027] Fig.13 for Figure 6 A schematic flow chart of the sub-steps included in sub-step S250;

[0028] Fig.14 for Figure 3 2 is a flow chart of the sub-steps included in step S200;

[0029] Fig.15 for Fig.14 One of the flow charts of the sub-steps included in sub-step S210;

[0030] Fig.16 for Fig.14 The second schematic flow chart of the sub-steps included in the neutron step S210;

[0031] Fig.17 A schematic block diagram of an arc weld extraction device provided in an embodiment of the present application.

[0032] Icons: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - arc weld extraction device; 210 - analysis module; 220 - extraction module. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0034] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0035] It should be noted that relational terms such as "first" and "second" are used only 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.

[0036] Before the inventors of the present application proposed the technical solution in the embodiments of the present application, arc welds are generally extracted from point clouds in the following manner: a detection algorithm is used to perform plane detection and cylindrical surface detection on a specific point cloud, thereby obtaining a plane represented by a plane equation and a cylindrical surface represented by a cylindrical surface equation; then, the circular intersection line equation is calculated based on the plane equation and the cylindrical surface equation, and the circular intersection line represented by the circular intersection line equation is directly used as the arc weld position.

[0037] However, the cylindrical surface cannot be considered to be infinitely extended along the cylindrical axis, and the plane cannot be considered to be an infinitely large plane. In the process of finding the actual intersection line between the cylindrical surface and the plane, the range of the cylinder itself and the range of the plane itself should be considered. If the intersection line is directly found without considering its range, the intersection line may not correspond to the real arc weld.

[0038] The planes and cylindrical surfaces detected from the point cloud are represented by equations. The surfaces represented by the equations are infinite, but the cylindrical surfaces and planes in the point cloud are not infinite. Therefore, using the intersection of the plane and cylindrical surfaces obtained based on the equations as the arc weld position may sometimes result in an incorrect arc weld position.

[0039] like Figure 1 As shown in a in , the cylindrical surface itself has a certain height and does not actually intersect with the plane. Therefore, the theoretical intersection line between the cylindrical surface and the plane calculated based on the equation represented by the dotted line does not actually exist, that is, there is no real weld at the dotted line position. Figure 1 As shown in b, the plane itself has a certain range and does not actually intersect with the cylindrical surface. Therefore, the intersection line of the cylindrical surface and the plane calculated based on the equation represented by the dotted line does not actually exist, that is, there is no real weld at the dotted line position. Only when the theoretical intersection line of the cylindrical surface and the plane is within the range of the plane and the height range of the cylinder at the same time, the intersection line corresponds to the real weld.

[0040] Furthermore, when the position represented by the circular intersection equation is directly used as the arc weld position, the starting and ending positions of the arc are not taken into consideration, and a complete circle is directly used as the arc weld, which will also lead to an incorrect arc weld position. Figure 1 As shown in c in the figure, in fact, the arc weld is not a complete circle, it has a start point and an end point. When the intersection line of the cylinder and the plane obtained based on the equation is directly used as the arc, the start point and end point of the arc cannot be accurately obtained.

[0041] In view of the above situation, the embodiments of the present application provide a circular arc weld extraction method, device, electronic device and readable storage medium, which can accurately obtain the position of the circular arc weld based on the distribution of three-dimensional points in the point cloud corresponding to the target plane and the point cloud corresponding to the target cylindrical surface in the target object point cloud. It is worth noting that the defects existing in the above schemes are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present application for the above problems below should be the contributions made by the inventor to the present application in the process of the present application.

[0042] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0043] Please refer to Figure 2 , Figure 2A block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be, but is not limited to, a computer, a server, a welding robot, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120, and the communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.

[0044] The memory 110 is used to store programs or data, and can be, but not limited to, a solid state disk (SSD), a hard disk drive (HDD), a read-only memory (ROM), and the like.

[0045] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores an arc weld extraction device 200, and the processor 120 executes various functional applications and data processing by running the arc weld extraction device 200 stored in the memory 110, that is, realizing the arc weld extraction method in the embodiment of the present application.

[0046] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.

[0047] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0048] Please refer to Figure 3 , Figure 3 The schematic diagram of the process of the arc weld extraction method provided in the embodiment of the present application. The method can be applied to the above-mentioned electronic device 100. The specific process of the arc weld extraction method is described in detail below. In this embodiment, the method may include steps S100 to S200.

[0049] Step S100, determining whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse.

[0050] In this embodiment, the target plane is a plane detected from the target object point cloud, and the plane detected from the target object point cloud can be expressed by a plane equation; the target cylindrical surface is a cylindrical surface detected from the target object point cloud, and the cylindrical surface detected from the target object point cloud can be expressed by a cylindrical surface equation. In the case where there are many planes and cylindrical surfaces detected from the target object point cloud, the target plane and target cylindrical surface can be specifically determined in combination with actual needs, and are not specifically limited here.

[0051] The target object point cloud is a point cloud of a specific target object, which can be obtained by performing a single point cloud acquisition using a point cloud acquisition device, or by splicing point clouds acquired multiple times, which is not specifically limited here. The target object can be determined according to actual detection requirements, for example, it can be a workpiece to be welded.

[0052] When the target plane and the target cylindrical surface are determined, it can be determined in any way whether the target plane and the target cylindrical surface intersect in theory and whether the theoretical intersection line is a standard circle or an ellipse. The theoretical intersection line represents the intersection line of the target plane and the target cylindrical surface obtained by theoretical analysis, and the intersection line represents a complete circle, which can be a standard circle or an ellipse, that is, the theoretical intersection line is the same as the intersection line calculated based on the plane equation corresponding to the target plane and the cylindrical surface equation corresponding to the target cylindrical surface.

[0053] In the case where it is determined that the target plane and the target cylindrical surface do not intersect or intersect but the theoretical intersection line is not a circular intersection line, the subsequent steps may not be performed, and it may be directly determined that the arc weld cannot be extracted based on the target plane and the target cylindrical surface. That is, in the case where the target plane and the target cylindrical surface do not intersect, and in the case where the target plane and the target cylindrical surface intersect but the theoretical intersection line is not a standard circle or an ellipse, it may be directly determined that the arc weld cannot be extracted based on the target plane and the target cylindrical surface.

[0054] Step S200, if yes, determine whether there is a real arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical point cloud, and if it is determined that there is a real arc, obtain the existing real arc as the extracted arc weld.

[0055] When it is determined that the target plane intersects with the target cylindrical surface and the theoretical intersection line is a circular intersection line (i.e., an ellipse or a standard circle), it can be determined whether there is a real arc on the theoretical intersection line according to the position distribution of the three-dimensional points in the target plane point cloud and the position distribution of the three-dimensional points in the target cylindrical surface point cloud, and the real arc is obtained when it is determined that it exists. The real arc is the extracted arc weld. The target plane point cloud is a local point cloud corresponding to the target plane in the target object point cloud, that is, the three-dimensional points in the target plane point cloud are the three-dimensional points in the target object point cloud that belong to the target plane; the target cylindrical surface point cloud is a local point cloud corresponding to the target cylindrical surface in the target object point cloud, that is, the three-dimensional points in the target cylindrical surface point cloud are the three-dimensional points in the target object point cloud that belong to the target cylindrical surface. A real arc has a start and end point, so when a real arc is extracted, the obtained arc weld also has a start and end point. The start and end points of a real arc may overlap or not overlap, which is determined by the actual situation.

[0056] In this way, the position of the arc weld can be accurately obtained based on the distribution of the three-dimensional points in the point cloud corresponding to the target plane and the point cloud corresponding to the target cylindrical surface in the target object point cloud.

[0057] As a possible implementation method, an angle can be calculated based on the normal vector of the target plane and the axis of the cylinder corresponding to the target cylindrical surface. The range of the angle is [0°, 90°]. When the angle is 90°, it means that the target plane is parallel to the target cylindrical surface; when the angle is 0 degrees, it means that the target plane and the target cylindrical surface intersect vertically, and there is a theoretical intersection line of a standard circle; when the angle is greater than 0° and less than 90 degrees, it means that the target plane and the target cylindrical surface intersect obliquely, and there is a theoretical intersection line of an ellipse. Therefore, an angle range can be set in advance, and then by judging whether the angle is within the angle range, it can be determined whether the target plane and the target cylindrical surface have a theoretical intersection line of a standard circle or an ellipse.

[0058] In the case where it is determined that there is a theoretical intersection line that is a circle (the circle is an ellipse or a standard circle), subsequent analysis can be performed directly based on the theoretical intersection line represented by the standard circle equation and the ellipse equation to obtain the arc weld. That is, in the case where it is determined that there is a standard circle theoretical intersection line or an ellipse theoretical intersection line, in one case, the theoretical intersection line can be directly represented by the ellipse equation, and then subsequent analysis can be performed; in another case, the theoretical intersection line can be directly represented by the circle equation, and then subsequent analysis can be performed. In this way, subsequent analysis can be performed after a single judgment on the theoretical intersection line.

[0059] Alternatively, when it is determined that there is a theoretical intersection line that is a circle (the circle is an ellipse or a standard circle), the corresponding equation can be selected to represent the theoretical intersection line according to the specific shape of the theoretical intersection line (i.e., whether it is an ellipse or a standard circle), and then subsequent analysis can be performed. For example, when the angle is 0 degrees, the theoretical intersection line is determined to be a standard circle, and the standard circle equation can be used to represent the theoretical intersection line; when the angle is between 0 and 90 degrees, the theoretical intersection line is determined to be an ellipse, and the ellipse equation can be used to represent the theoretical intersection line. In this way, the accuracy of the theoretical intersection line can be guaranteed.

[0060] As another possible implementation, Figure 4 The method shown in the figure determines whether there is a theoretical circular intersection line between the target plane and the target cylindrical surface. Figure 4 , Figure 4 for Figure 3 Schematic diagram of the flow of sub-steps included in step S100. In this embodiment, step S100 may include sub-steps S110 to S150.

[0061] Sub-step S110, calculating the angle according to the normal vector of the target plane and the axis of the target cylindrical surface.

[0062] Sub-step S120, determining whether the angle is smaller than a first preset angle.

[0063] Wherein, the first preset angle is greater than 0 degree.

[0064] When the included angle is less than or equal to the first preset angle, sub-step S130 is executed.

[0065] Sub-step S130: The target plane intersects with the target cylindrical surface theoretically, and the theoretical intersection line is a standard circle.

[0066] When the included angle is greater than the first preset angle, sub-step S140 is executed.

[0067] Sub-step S140, determining whether the included angle is greater than the first preset angle and less than a second preset angle.

[0068] When the included angle is greater than the first preset angle and less than the second preset angle, sub-step S150 is executed.

[0069] Sub-step S150, determining that the target plane and the target cylindrical surface intersect theoretically and the theoretical intersection line is an ellipse.

[0070] In this embodiment, the angle can be first calculated based on the normal vector of the target plane and the axis of the cylinder where the target cylindrical surface is located. Then, it is determined whether the angle is less than or equal to a first preset angle greater than 0 degrees. If the angle is less than or equal to the first preset angle, it is determined that the target plane and the target cylindrical surface theoretically intersect and the theoretical intersection line is a standard circle. Then, a standard circle equation can be used to describe the theoretical intersection line, that is, the theoretical intersection line is described as a standard circle at this time. Among them, the first preset angle can be specifically combined with actual needs. For example, it can be set to 10 degrees, as long as it is ensured that the shape represented by the ellipse equation is similar to the shape represented by the standard circle equation when it is between the first preset angle and 0 degrees.

[0071] If the angle is greater than the first preset angle and less than the second preset angle, it can be determined that the target plane and the target cylindrical surface intersect in theory and the theoretical intersection line is an ellipse, and then an ellipse equation can be used to describe the theoretical intersection line, that is, the theoretical intersection line is described as an ellipse. The second preset angle can be set according to actual needs, for example, set to 90 degrees.

[0072] As a possible implementation, the second preset angle may be set in combination with the actual situation of the target object. For example, if the angle between the plane and the cylindrical surface of the target object is small, the second preset angle may also be set small, such as 30 degrees, to avoid interference.

[0073] In this way, the probability of using the standard circle equation to describe the theoretical intersection line can be increased, thereby reducing the amount of calculation as much as possible while ensuring the accuracy of subsequent analysis. The amount of calculation for an ellipse is greater than that for a standard circle.

[0074] When the angle is greater than the second preset angle, it can be determined that there is no theoretical intersection line between the target plane and the target cylindrical surface that is a standard circle or ellipse. In this case, subsequent processing may not be performed.

[0075] As a possible implementation method, the plane detection results and cylindrical surface results corresponding to the target object point cloud can be obtained, and then each plane in the plane detection results is used as the target plane in turn, and each cylindrical surface in the cylindrical surface detection results is used as the target cylindrical surface in turn, and then an analysis is performed on whether there is a circular theoretical intersection line and an analysis of the real arc weld. That is, it is determined whether each plane and each cylindrical surface have a circular theoretical intersection line. In this way, all arc welds in the target object point cloud can be obtained. Among them, the plane detection results and cylindrical surface results can be obtained by the electronic device based on the target object point cloud detection, or can be obtained by detection of other devices, which is not specifically limited here.

[0076] Optionally, the plane detection result and the target cylindrical surface detection result may be obtained in the following manner.

[0077] Arc welds are formed by the intersection of planes and cylinders. First, all planes in the target object point cloud need to be detected, and then the cylinder detection is performed to avoid interference of points on the plane on the cylinder detection.

[0078] The target object point cloud can be plane-detected using a random Hough transform (RHT), a random sample consensus (RANSAC), a deterministic voting algorithm, etc., to obtain the plane equation of the plane included in the target object point cloud. While detecting the plane, it is possible to determine which three-dimensional points in the target object point cloud are contained in each plane, that is, to determine the plane point cloud corresponding to each plane. After the plane detection is completed, the three-dimensional points in the target object point cloud that belong to the plane are removed.

[0079] For the target object point cloud from which the three-dimensional points belonging to the plane have been removed, any algorithm can be used to perform cylindrical surface detection, thereby detecting the cylindrical surface equation of the cylindrical surface included in the target object point cloud. While detecting the cylindrical surface, it is possible to determine which three-dimensional points in the target object point cloud are included in each cylindrical surface, that is, to determine the cylindrical surface point cloud corresponding to each cylindrical surface.

[0080] When obtaining the plane detection results and the cylindrical surface detection results, if Figure 5 As shown, the variable i can be set to traverse the plane in the plane detection result, and the variable j can be set to traverse the cylindrical surface in the cylindrical surface detection result. The initial values ​​of the variables i and j are both 0.

[0081] Initially, determine whether i, which is currently 0, is less than the number of planes in the plane detection result. If it is less than, obtain the normal vector of plane i Then, determine whether j, which is currently 0, is less than the number of cylindrical surfaces in the cylindrical surface detection result (i.e., the number of cylindrical surfaces), and if it is less than, obtain the axis direction of the cylindrical surface j where the cylindrical surface j is located. , and then calculate and An included angle. It is determined whether the included angle is less than a preset angle 2 (which may be the aforementioned second preset angle). If the included angle is less than the preset angle 2, it is possible to analyze whether there is a real arc on the theoretical intersection line of the plane i and the cylindrical surface j, and obtain the corresponding real arc if it exists.

[0082] If the angle is not less than the preset angle 2, j is updated by adding 1 to obtain the current value of j, and then the process jumps to the step of determining whether j is less than the number of cylinders.

[0083] If j is not less than the number of cylinders after being updated by adding 1, i can be updated by adding 1 to obtain the current value of i, and then the process jumps to the step of determining whether i is less than the number of planes.

[0084] If after i is updated by adding 1, the current value of i obtained is not less than the number of planes, it is determined that the traversal of the plane detection results and the cylindrical surface detection results are completed.

[0085] When it is determined that there is a circular theoretical intersection line between the target plane and the target cylindrical surface, the real arc correlation analysis can be performed based on the projection of the target plane point cloud and the target cylindrical surface point cloud on the theoretical intersection line. Figure 6 , Figure 6 for Figure 3 One of the flow charts of the sub-steps included in step S200. In this embodiment, step S200 may include sub-steps S230 to S250.

[0086] In sub-step S230, when the number of clusters is unknown, clustering is performed on the first projection points obtained to obtain a plane arc point set, and the first position information of the plane arc corresponding to each plane arc point set is obtained; and clustering is performed on the second projection points obtained to obtain a cylindrical arc point set, and the second position information of the cylindrical arc corresponding to each cylindrical arc point set is obtained.

[0087] In this embodiment, the projection point of the three-dimensional point located near the theoretical intersection line in the target plane point cloud on the theoretical intersection line can be obtained as the first projection point, and the projection point of the three-dimensional point located near the theoretical intersection line in the target cylindrical point cloud on the theoretical intersection line can be obtained as the second projection point. The specific method of obtaining the first projection point and the second projection point can be determined in combination with actual needs and is not specifically limited here.

[0088] Any method can be adopted, when the number of clusters is unknown, that is, without setting the number of categories in advance, to perform cluster analysis on the first projection points obtained based on the target plane point cloud, thereby obtaining at least one plane arc point set. For example, a plane arc point set can be obtained by Euclidean clustering. The first projection points in a plane arc point set form an arc (hereinafter referred to as a plane arc), that is, each plane arc is a three-dimensional point located near the theoretical intersection line in the target plane point cloud projected onto the theoretical intersection line to form an arc. Therefore, based on each plane arc point set, a first position information can be determined respectively, and the first position information is used to indicate the position of a plane arc corresponding to the plane arc point set. The specific information type in the first position information can be determined in combination with actual needs, as long as the position of the corresponding plane arc can be specified.

[0089] Similarly, any method can be used to perform cluster analysis on the second projection points obtained based on the target cylindrical surface point cloud when the number of clusters is unknown, so as to obtain at least one cylindrical arc point set. For example, a cylindrical arc point set can be obtained by Euclidean clustering. The second projection points in a cylindrical arc point set form an arc (hereinafter referred to as a cylindrical arc), that is, each cylindrical arc is a three-dimensional point located near the theoretical intersection line in the target cylindrical surface point cloud projected onto the theoretical intersection line to form an arc. Therefore, based on each cylindrical arc point set, a second position information can be determined respectively, and the second position information is used to indicate the position of a cylindrical arc corresponding to the cylindrical arc point set. The specific information type in the second position information can be determined in combination with actual needs, as long as the position of the corresponding cylindrical arc can be specified.

[0090] Among them, the specific information types in the first position information and the specific information types in the second position information can be the same. For example, when the theoretical intersection line is determined to be an ellipse, both can include the center position, the direction and size of the major and minor axes, the description information of the start and end points, etc. The description information of the start and end points can include the specific three-dimensional position coordinates of the start and end points, and can also include the center angles corresponding to the start and end points; when the theoretical intersection line is determined to be a standard circle, both can include the center position, radius size, the position of the plane where the theoretical axis is located (for example, including the plane equation) and the description information of the start and end points, etc.

[0091] Each arc in the plane arc and cylindrical arc is obtained through a clustering, so each arc is a continuous arc, that is, the corresponding center angle changes continuously. As a possible implementation method, in order to facilitate subsequent analysis, the start and end point description information can include the center angles corresponding to the start and end points, that is, two center angles. It can be understood that when the theoretical intersection line is a standard circle, the center angle represents the angle between the line connecting a point of the arc and the center of the standard circle and the positive semi-axis of the X-axis; when the theoretical intersection line is an ellipse, the center angle represents the angle between the line connecting a point of the arc and the center of the ellipse (that is, the center point of the ellipse) and the positive semi-axis of the X-axis.

[0092] Alternatively, the arctan2(y, x) function can be used to calculate the center angle corresponding to each arc point, and then obtain the center angle combination corresponding to the arc. However, the return value range of the arctan function is [-π, π]. When the point is located in quadrants 1 and 2, the center angle range is [0, π], and when the point is located in quadrants 3 and 4, the center angle range is [-π, 0]. When an arc crosses the negative x-axis, the center angle of this arc will be discontinuous and divided into two segments, one is [θ1, π], and the other is [-π,θ2]. This will make it impossible to describe the arc using two center angles, and it is not convenient to analyze the intersection arc of the two arcs based on the two center angles of the arc.

[0093] To avoid the above situation, you can Figure 8 The center angle combination in the position information corresponding to a set of arc points is obtained in the manner shown. That is, the first position information may include a first center angle combination, and the second position information may include a second center angle combination. The above two center angle combinations can be obtained by Figure 8 The above center angle combination includes the maximum and minimum values ​​of the consecutive center angles of the corresponding arcs. Figure 8 , Figure 8 for Figure 6 Schematic diagram of the flow of sub-steps included in sub-step S230. In this embodiment, sub-step S230 may include sub-steps S231 to S235.

[0094] Sub-step S231, using the inverse tangent function to calculate the center angle of each point in the arc point set.

[0095] Sub-step S232, determining an initial center angle combination according to the continuous center angles of the center angles corresponding to the points in the arc point set.

[0096] Sub-step S233, determining whether the determined initial center angle combination is a plurality of incoherent initial center angle combinations.

[0097] In this embodiment, for an arc point set, the arc tangent function can be used to calculate the center angle corresponding to each point in the arc point set. Then, according to the size of the center angle corresponding to each point in the arc point set, at least one initial center angle combination is determined based on the center angles with coherent sizes. In combination with the above description, it can be seen that the center angle corresponding to an arc obtained by the arc tangent function will only correspond to one initial center angle combination or two incoherent center angle combinations.

[0098] If only one initial center angle combination is determined, sub-step S234 may be executed.

[0099] Sub-step S234: using the initial center angle combination as the center angle combination in the position information corresponding to the arc point set.

[0100] If two incoherent initial center angle combinations are determined, sub-step S235 may be executed.

[0101] In sub-step S235, add 360° to both center angles in the second initial center angle combination, and use the maximum and minimum values ​​in the first initial center angle combination and the adjusted second initial center angle combination as the center angles included in the center angle combination in the position information corresponding to the arc point set.

[0102] In this embodiment, the maximum value of the first initial center angle combination is 180°, and the minimum value of the second initial center angle combination is -180°. The center angle of the interval represented by the second initial center angle combination can be adjusted to avoid a situation where a continuous arc has a discontinuous center angle. The adjustment method is to add 360°.

[0103] For example, if the two initial center angle combinations are determined, such as Fig. 9 As shown in a, the two center angles included in the first initial center angle combination are: 100° and 180°, the two center angles included in the second initial center angle combination are: -180° and 30°, and the arc interval corresponding to the second initial center angle combination is Fig. 9 The bold part of the arc of a in , the first initial center angle combination is kept unchanged, and 360° is added to -180° and 30° in the second initial center angle combination, respectively, to obtain 180° and 390°. In this way, the maximum value 390° and the minimum value 100° in the first initial center angle combination 100°, 180° and the adjusted second initial center angle combination 180°, 390° can be determined, and 100° and 390° are used as the two center angles included in the center angle combination in the corresponding position information in the arc point set, that is, 100° is the minimum center angle in the center angle combination of the position information , 390° is the maximum center angle of the center angle combination of position information .

[0104] Another example Fig. 9 As shown in b in , if only one initial center angle combination is determined, that is, the arc does not pass through the negative half axis of the x-axis, if the two center angles in the initial center angle combination are determined to be: -140° and 70°, then these two angles -140° and 70° can be used as the center angle combination in the position information corresponding to the arc point set, that is, -140° is the minimum center angle in the center angle combination of the position information. , 70° is the maximum center angle of the center angle combination of position information .

[0105] Optionally, an adjustment flag adjust_ may be set for each center of a circle. If a center angle combination corresponding to an arc is obtained by adding 360 degrees as described above, it indicates that adjustment has been made, and adjust_ is assigned a value of 1. Otherwise, if a center angle combination corresponding to an arc is not obtained by adding 360 degrees as described above, it indicates that adjustment has not been made, and adjust_ is assigned a value of 0.

[0106] Sub-step S240, for each plane arc and each cylindrical arc, determine whether the plane arc intersects with the cylindrical arc based on the first position information of the plane arc and the second position information of the cylindrical arc, and obtain the third position information of the intersection arc when the intersection is determined.

[0107] In this embodiment, after obtaining the plane arc and the cylindrical arc in sub-step S230, it is possible to analyze and determine whether the plane arc and the cylindrical arc overlap with each other for each plane arc and each cylindrical arc. If there is an overlap, the overlapping part can be used as the intersection arc of the plane arc and the cylindrical arc, and the third position information of the intersection arc is obtained. The third position information is used to indicate the specific position of the intersection arc, and the information type in the third position information can be the same as the specific information type in the first position information.

[0108] Optionally, the intersection judgment and the third position information may be obtained by traversal.

[0109] For example, the variable i can be used to traverse the obtained plane arcs to obtain the i-th plane arc arc i Similarly, use variable j to traverse the obtained cylindrical arcs and get the jth cylindrical arc arc j Since the first position information indicates the specific position of the plane arc, and the second position information indicates the specific position of the cylindrical arc, the plane arc arc can be determined based on the first position information and the second position information. i With cylindrical arc j Whether they intersect, and when they intersect, obtain the third position information of the corresponding intersection arc.

[0110] When the theoretical intersection line is a standard circle, Figure 7 As shown in a, the plane arc i With cylindrical arc j Intersecting, the overlapping part is a plane arc i With cylindrical arc j It is understandable that Figure 7 In order to clearly show that the intersection arc is a plane arc, i With cylindrical arc jThe overlapping part of the plane arc i With cylindrical arc j There is a gap between the parts of the intersecting arcs, but there is no gap in reality. Figure 7 As shown in b, the plane arc i With cylindrical arc j Do not intersect, that is, it is impossible to calculate the arc i With cylindrical arc j Get the intersection arc.

[0111] Optionally, a function can be used to determine the plane arc i With cylindrical arc j Whether they intersect, and if so, return 1 and the third position information of the intersection arc. If not, return 0. This function can be set according to actual needs.

[0112] As a possible implementation method, it is possible to quickly and accurately analyze whether the plane arc and the cylindrical arc intersect based on the center angle of the plane arc and the cylindrical arc, and obtain the third position information of the intersection arc when the intersection is determined. Fig.10 , Fig.10 for Figure 6 Schematic diagram of the flow of sub-steps included in sub-step S240. In this embodiment, sub-step S240 may include sub-steps S241 and S242.

[0113] Sub-step S241, obtaining a first center angle combination in the first position information, and obtaining a second center angle combination in the second position information.

[0114] The first center angle combination includes the maximum and minimum values ​​of the consecutive center angles corresponding to the plane arc, and the second center angle combination includes the maximum and minimum values ​​of the consecutive center angles corresponding to the cylindrical arc. The first center angle combination and the second center angle combination can be obtained through sub-steps S231 to S235.

[0115] Sub-step S242, judging whether the plane arc intersects with the cylindrical arc according to the first center angle combination and the second center angle combination, and determining the third position information based on the first center angle combination and the second center angle combination when the intersection is determined.

[0116] In this embodiment, an overlapping angle interval analysis can be performed based on the angle interval corresponding to the first center angle combination and the angle interval corresponding to the second center angle combination, that is, analyzing whether there is an intersection, so as to determine whether the plane arc and the cylindrical arc intersect, and when the intersection is determined, the overlapping angle interval is determined, and the third position information is obtained in combination with the first position information or the second position information. The third position information is used to indicate the specific position of the intersection arc. For example, the third position information may include a third center angle combination, and the third center angle combination includes determining the maximum angle and the minimum angle of the overlapping angle interval, and may also be similar to the first position information and the second position information, including the center position, the radius size and the position of the plane where the theoretical axis is located, or including the center position, the direction and size of the major and minor axes.

[0117] Optionally, as a possible implementation, Fig.11 The method shown here is to analyze the intersection of a plane arc and a cylindrical arc. Fig.11 , Fig.11 for Fig.10 One of the flow diagrams of the sub-steps included in sub-step S242. In this embodiment, sub-step S242 may include sub-steps S2421 and S2422.

[0118] Sub-step S2421, when the first center angle combination and the second center angle combination are both obtained after adjustment or are both obtained without adjustment, an overlapping angle interval analysis is performed based on the angle interval corresponding to the first center angle combination and the angle interval corresponding to the second center angle combination to determine whether the plane arc intersects with the cylindrical arc, and when the intersection is determined, the third position information is determined.

[0119] Sub-step S2422, when one of the first center angle combination and the second center angle combination is obtained through adjustment, for the first center angle combination and the second center angle combination, add 360 degrees to both center angles in the center angle combination that has not been adjusted, and perform overlapping angle interval analysis based on the angle intervals corresponding to the two adjusted center angle combinations to determine whether the plane arc intersects with the cylindrical arc, and determine the third position information when the intersection is determined.

[0120] Assume that the plane arc and cylindrical arc currently targeted can be represented as arc_1 and arc_2. In this embodiment, firstly determine whether the center angle combination in the position information of arc_1 and arc_2 is obtained through adjustment. Optionally, the determination can be made based on the value of the adjustment flag adjust_ of arc_1 and arc_2.

[0121] If the center angle combination of arc_1 is obtained after adjustment, and the center angle combination of arc_2 is obtained without adjustment, then add 2π to theta_min_ and theta_max_ of arc_2 for update, that is: , , theta_min_ and theta_max_ of arc_2 are the maximum and minimum values ​​of the central angle in the central angle group of arc_2. If the central angle combination of arc_1 is not adjusted, and the central angle combination of arc_2 is adjusted, then add 2π to theta_min_ and theta_max_ of arc_1 for update, that is: , If the center angle combination of arc_1 and arc_2 is obtained through adjustment or not adjusted, it remains unchanged.

[0122] Next, determine whether arc_1.theta_min_ is greater than arc_2.theta_min_. If so, the intersection arc p_inter's theta_min_ = arc_1.theta_min_. If not, p_inter's theta_min_ = arc_2.theta_min_, that is, the intersection arc's minimum center angle takes the larger of the two arcs' minimum center angles. You can also determine whether arc_1.theta_max_ is greater than arc_2.theta_max_. If so, p_inter's theta_max_ = arc_2.theta_max_. If not, p_inter's theta_max_ = arc_1.theta_max_, that is, the intersection arc's maximum center angle takes the smaller of the two arcs' maximum center angles. After that, it is determined whether theta_max_ of p_inter is greater than theta_min_. If so, it means that the intersection arc exists and p_inter can be saved; if not, it means that the intersection arc does not exist. In this way, an overlapping interval analysis can be performed in a simple way to determine whether there is an intersection arc and the maximum and minimum center angles of the intersection arc.

[0123] The inventor of the present application has also found through research that if the combination of the center angles in the position information of two arcs is not obtained by the aforementioned method of adding 360°, the intersection of the two arcs is at most one arc; if the combination of the center angles in the position information of at least one arc is obtained by the aforementioned method of adding 360°, two intersections may appear. Therefore, it is also possible to Fig.12 The intersection arc analysis is performed in the manner shown. Fig.11 and Fig.12 The two methods shown in the figure can avoid missing the intersection arc. Fig.12 , Fig.12 for Fig.10 The second flow diagram of the sub-steps included in sub-step S242. In this embodiment, sub-step S242 may further include sub-steps S2425 to S2427.

[0124] Sub-step S2425, when at least one of the first center angle combination and the second center angle combination is an adjusted center angle combination, determine whether the first center angle combination and the second center angle combination meet the first preset condition or the second preset condition.

[0125] In this embodiment, it can be determined whether at least one of the first and second central angle combinations is obtained by adding 360°. Optionally, the determination can be made based on the values ​​of the adjustment flags adjust_ of arc_1 and arc_2.

[0126] In the case that neither the first center angle combination nor the second center angle combination is an adjusted center angle combination, it can be determined that the intersection arc cannot be obtained in this way.

[0127] In the case where at least one of the first center angle combination and the second center angle combination is a center angle combination obtained through adjustment, that is, in the case where the first center angle combination and / or the second center angle combination are center angle combinations obtained through adjustment, it can be determined whether the first center angle combination and the second center angle combination meet the first preset condition or the second preset condition. Among them, if the first preset condition is met, it is impossible to meet the second preset condition; similarly, if the second preset condition is met, it is impossible to meet the first preset condition. Therefore, both preset conditions can be judged, or if one of the preset conditions is judged first and the judgment result indicates that it is satisfied, the other preset condition will no longer be judged. It can be understood that if one of the preset conditions is judged first and it is judged to be unsatisfactory, it is necessary to continue to judge the other preset condition.

[0128] The first preset condition is that the maximum value in the second central angle combination is greater than or equal to the maximum value in the first central angle combination, and the first value obtained by subtracting 360 degrees from the maximum value in the second central angle combination is greater than the minimum value in the first central angle combination. The second preset condition is that the maximum value in the first central angle combination is greater than or equal to the maximum value in the second central angle combination, and the second value obtained by subtracting 360 degrees from the maximum value in the first central angle combination is greater than the minimum value in the second central angle combination.

[0129] If the first preset condition is met, sub-step S2426 is executed.

[0130] Sub-step S2426, taking the minimum value in the first center angle combination as the minimum center angle of the intersection arc, and taking the first value as the maximum center angle of the intersection arc.

[0131] If the second preset condition is met, sub-step S2427 is executed.

[0132] Sub-step S2427, taking the minimum value in the second center angle combination as the minimum center angle of the intersection arc, and taking the second value as the maximum center angle of the intersection arc.

[0133] Assume that the plane arc and cylindrical arc currently targeted can be represented as arc_1 and arc_2. The two center angles included in the center angle combination of arc_1 are: arc_1.theta_min_, arc_1.theta_max, and the two center angles included in the center angle combination of arc_2 are: arc_2.theta_min_, arc_2.theta_max.

[0134] If the center angle combination of arc_1 and / or arc_2 is obtained by adjustment, then determine whether the following conditions are met: arc_2.theta_max_>= arc_1.theta_max_ and , the above condition indicates that arc_2 has a larger maximum central angle and that it intersects with the arc corresponding to the smaller central angle of arc_1. If this is true, then p_inter.theta_min_ = arc_1.theta_min_. You can also determine whether the following conditions hold: arc_1.theta_max_>= arc_2.theta_max_ and , the above condition indicates that arc_1 has a larger maximum central angle and that it intersects with the arc corresponding to the smaller central angle of arc_2. If this is true, then p_inter.theta_min_ = arc_2.theta_min_. .

[0135] The following is an example to illustrate the method shown in sub-steps S2421 to S2421 and sub-steps S2425 to S2427.

[0136] Assume that the initial center angle combination of arc_1 obtained by the inverse tangent function is two, namely: 90°, 180°; -180°, 0°; the initial center angle combination of arc_2 is only one, namely: -170°, 100°. Figure 8 After the processing shown, the central angle combination of arc_1 is: 90°, 360°, and the central angle combination of arc_2 is: -170°, 100°.

[0137] Since the center angle combination of arc_1 is obtained after adjustment and the center angle combination of arc_2 is not obtained after adjustment, the center angle combination of arc_2 is processed by adding 360° to obtain two center angles: 190° and 460°. Then, for the center angle combination of arc_1, 90° and 360°, and the updated center angle combination of arc_2, 190° and 460°, the minimum angle and maximum angle of the intersection interval are calculated: 190° and 360°. In this way, the maximum center angle and minimum center angle of an intersection arc of arc_1 and arc_2 can be obtained.

[0138] In addition, since the center angle combination of arc_1 is obtained after adjustment and the center angle combination of arc_2 is not obtained after adjustment, it is also judged whether the following conditions are met: 460°≥360° and 460°-360°>90°. Since they are met, it can be determined that there is an intersection arc, and the minimum center angle of the intersection arc is 90° and the maximum center angle is 460°-360°.

[0139] Sub-step S250, judging whether there is a real arc on the theoretical intersection line according to the obtained third position information of the intersection arc, and obtaining the real arc if it is determined to exist.

[0140] Based on the third position information of each intersecting arc, it can be determined whether each intersecting arc is a real arc existing on the theoretical intersection line. If so, the third position information of the intersecting arc that is a real arc is used as the position information of a real arc, that is, as the position information of an arc weld.

[0141] Optionally, as a possible implementation manner, each obtained intersection arc can be used as a real arc.

[0142] Alternatively, as another possible implementation, Fig.13 The method shown here determines whether the intersection arc is a true arc. Fig.13 , Fig.13 for Figure 6 Schematic diagram of the flow of sub-steps included in sub-step S250. In this embodiment, sub-step S250 may include sub-steps S251 and S252.

[0143] Sub-step S251, for each obtained intersection arc, determine the nearest points of the two endpoints of the intersection arc in the target plane point cloud and the target cylindrical point cloud, and calculate four nearest distances based on the obtained four nearest points.

[0144] The closest distance is the distance between the closest point and the corresponding endpoint.

[0145] Sub-step S252, judging whether the intersection arc is a real arc according to the fourth preset distance and the four closest distances.

[0146] In this embodiment, for each intersection arc obtained based on the target plane and the target cylindrical surface, the coordinates of the start and end points of the intersection arc can be determined according to the third position information of the intersection arc, that is, the coordinates of the two end points can be determined. A KD tree can be set for the target plane point cloud to obtain kdtree_1, and based on kdtree_1, the nearest point corresponding to the start point of the intersection arc in the target plane point cloud is determined, and the distance between the start point of the intersection arc and the corresponding nearest point is calculated as a nearest distance, and the nearest point corresponding to the end point of the intersection arc in the target plane point cloud is determined, and the distance between the end point of the intersection arc and the corresponding nearest point is calculated as a nearest distance. Similarly, a KD tree is set for the target cylindrical point cloud to obtain kdtree_2, and based on kdtree_2, the nearest point corresponding to the starting point of the intersection arc in the target cylindrical point cloud is determined, and the distance between the starting point of the intersection arc and the corresponding nearest point is calculated as a nearest distance, and the nearest point corresponding to the end point of the intersection arc in the target cylindrical point cloud is determined, and the distance between the end point of the intersection arc and the corresponding nearest point is calculated as a nearest distance. In this way, 4 nearest distances can be obtained.

[0147] Then, the four closest distances can be compared with the fourth preset distance in sequence. If the four closest distances are all less than or equal to the fourth preset distance, it is determined that the intersection arc is a real arc existing on the theoretical intersection line, and the intersection arc is an arc weld. If at least one of the four closest distances is greater than the fourth preset distance, it is determined that the intersection arc is not a real arc located on the theoretical intersection line.

[0148] In this way, the true arc positions of all intersections between the target plane and the target cylindrical surface can be obtained.

[0149] It is understandable that, after each closest distance is calculated, the closest distance can be compared with the fourth preset distance. If the closest distance is greater than the fourth preset distance, it can be directly determined that the current intersection arc is not a real arc, and there is no need to continue calculating the closest distance. If the closest distance is less than the fourth preset distance, continue to search for the nearest point, calculate the closest distance, and compare the newly calculated closest distance with the fourth preset distance.

[0150] Optionally, in this embodiment, in order to avoid unnecessary calculations, it can be determined whether to perform cluster analysis based on the number of the first projection points and the number of the second projection points. Fig.14 , Fig.14 for Figure 3 2 is a flow chart of sub-steps included in step S200. In this embodiment, step S200 may further include sub-steps S210 to S260, wherein sub-steps S210 to S220 are executed before sub-step S230.

[0151] Sub-step S210, obtaining the first projection point and the second projection point by projection, and obtaining a first number of the first projection points and a second number of the second projection points.

[0152] Sub-step S220, judging whether the theoretical intersection line is actually possible based on the first number and the second number.

[0153] If the theoretical intersection line may actually exist, sub-step S230 is executed, that is, a plane arc point set and a cylinder arc point set are obtained by clustering.

[0154] If the theoretical intersection line cannot actually exist, sub-step S260 is executed.

[0155] Sub-step S260, determining whether there is no real arc on the theoretical intersection line.

[0156] In this embodiment, for the target plane point cloud, the three-dimensional points in the target plane point cloud located near the theoretical intersection line can be projected onto the theoretical intersection line to obtain first projection points, and the first number of the first projection points can be obtained by counting. Also, for the target cylindrical surface point cloud, the three-dimensional points in the target cylindrical surface point cloud located near the theoretical intersection line can be projected onto the theoretical intersection line to obtain second projection points, and the second number of the second projection points can be obtained by counting.

[0157] Afterwards, it can be determined whether the theoretical intersection line is likely to actually exist based on whether the first number and the second number are both greater than the preset number. The preset number can be set in combination with actual needs, and can be greater than 0 or can be 0. As a possible implementation method, in order to reduce the omission of intersection arcs caused by misjudgment, the preset number can be set to 0, that is, when the number of the first projection points obtained is 0 and / or the number of the second projection points obtained is 0, it is directly determined that the theoretical intersection line is unlikely to actually exist, that is, there is no real arc on the theoretical intersection line; conversely, when the number of the first projection points obtained and the number of the second projection points obtained are not 0, it is determined that the theoretical intersection line is likely to actually exist, and there may be a real arc on the theoretical intersection line.

[0158] As a possible implementation method, it can be determined whether the theoretical intersection line is a standard circle or an ellipse. When the theoretical intersection line is determined to be a standard circle, the first projection point and the second projection point can be obtained based on the theoretical intersection line of the standard circle; when the theoretical intersection line is determined to be an ellipse, the first projection point and the second projection point can be obtained based on the theoretical intersection line of the ellipse. Figure 4 The sub-steps S110 to S130 shown determine whether the theoretical intersection line is a standard circle or an ellipse, which can increase the probability of calculating the first projection point and the second projection point based on the standard circle equation, thereby reducing the amount of calculation while ensuring accuracy.

[0159] Please refer to Fig.15 , Fig.15 for Fig.14 One of the flow diagrams of the sub-steps included in sub-step S210. In this embodiment, sub-step S210 may include sub-steps S211 and S212.

[0160] In sub-step S211, when it is determined that the theoretical intersection line is a standard circle, for each first three-dimensional point in the target plane point cloud, a first distance between the first three-dimensional point and the center of the theoretical intersection line is calculated, and when the difference between the first distance and the radius corresponding to the theoretical intersection line is less than or equal to a first preset distance, the projection point of the first three-dimensional point on the theoretical intersection line is used as the first projection point.

[0161] Sub-step S212, for each second three-dimensional point in the cylindrical point cloud, calculate the second distance between the second three-dimensional point and the target plane, and when the second distance is less than or equal to the second preset distance, use the projection point of the second three-dimensional point on the theoretical intersection line as the second projection point.

[0162] In this embodiment, when the theoretical intersection line is determined to be a standard circle, the center position of the theoretical intersection line can be analyzed first, and then the projection calculation is performed in combination with the center position. Assume that the normal of the target plane is n, and the distance from the target plane to the origin is , the cylinder axis corresponding to the target cylindrical surface is t, the radius is r, and a point on the axis t is . Place the above axis points Project it onto the target plane to get the axis point The projection point , , projection point It is the center point of the standard circle of the theoretical intersection line.

[0163] We can also establish a t1t2 coordinate system based on n so that we can express the standard circle equation in this coordinate system. The t1t2 coordinate system is the xy coordinate system used by the standard circle equation. We can first get the absolute values ​​of the three components of n, which are , , , and then determine which of the three components is the largest. Maximum, then , , , , , represents the three components of t1. If Maximum, then , , .if Maximum, then , , .Then, , then , Normalize them respectively to get the t1t2 coordinate system. The origin of the t1t2 coordinate system is the projection point .

[0164] Next, the points in the target plane point cloud and the target cylindrical surface point cloud that are located near the theoretical intersection line of the standard circle are projected onto the theoretical intersection line to obtain a first projection point and a second projection point.

[0165] Use variable i to traverse the first three-dimensional points in the target plane point cloud and get , and calculate as follows: , Indicated by point to The vector of The vector perpendicular to the cylinder axis t : After that, judge The difference between the length (i.e., the first distance) and the radius r (the difference is The absolute value of the result obtained by subtracting the radius r from the length of Projecting onto the theoretical intersection line, we get a first projection point, the position of which is: , the first projection point can be stored in plane_pro_points for subsequent statistical quantity, cluster analysis, etc. It can be seen that when the three-dimensional points in the target plane point cloud are close to the theoretical intersection line, these points will be projected onto the theoretical intersection line, and the projection point will be used as the first projection point.

[0166] Use variable j to traverse the second three-dimensional point in the target cylindrical surface and get , and calculate as follows: After that, judge (i.e., the second distance) is less than the second preset distance, if so, Project it onto the theoretical intersection line to get a second projection point. The position of the second projection point is: ,in, , , the second projection point can be stored in cylinder_pro_points for subsequent statistical quantity, cluster analysis, etc. It can be seen that when the three-dimensional points in the target cylindrical point cloud are close to the theoretical intersection line, these points will be projected onto the theoretical intersection line, and the projection point will be used as the second projection point.

[0167] In this way, the first projection point and the second projection point can be calculated using a calculation formula related to a standard circle.

[0168] Please refer to Fig.16 , Fig.16 for Fig.14 The second flow diagram of the sub-steps included in sub-step S210. In this embodiment, sub-step S210 may include sub-steps S214 and S215.

[0169] In sub-step S214, when it is determined that the theoretical intersection line is an ellipse, for each first three-dimensional point in the target plane point cloud, a calculated value is calculated according to the standard equation of the ellipse corresponding to the first three-dimensional point and the theoretical intersection line, and a judgment is made as to whether the calculated value is within a preset range. If so, the projection point of the first three-dimensional point on the theoretical intersection line is used as the first projection point.

[0170] The preset range is set according to 1, and the calculated value is a value calculated by substituting the position of the first three-dimensional point into the standard equation of the ellipse. For example, the preset range includes 1, the maximum value of the preset range is greater than 1, and the minimum value is less than 1. The preset range can be set according to actual needs, for example, the preset range is [0.8, 1.25].

[0171] Sub-step S215, for each second three-dimensional point in the cylindrical point cloud, calculate the third distance between the second three-dimensional point and the target plane, and when the third distance is less than or equal to the third preset distance, use the projection point of the second three-dimensional point on the theoretical intersection line as the second projection point.

[0172] In this embodiment, when the theoretical intersection line is determined to be an ellipse, the center position of the ellipse of the theoretical intersection line can be analyzed first as the center position of the circle, and then the projection calculation is performed in combination with the center position of the circle. Assume that the normal direction of the target plane is n, and the distance from the target plane to the origin is , the cylinder axis corresponding to the target cylindrical surface is t, the radius is r, and a point on the axis t is . Place the above axis points Project it onto the target plane to get the axis point The projection point , , projection point That is the center of the ellipse of the theoretical intersection.

[0173] A t3t4 coordinate system can also be established based on n to express the ellipse equation in this coordinate system. The t3t4 coordinate system is the xy coordinate system used by the ellipse equation. , , then , Normalize them respectively to get the t3t4 coordinate system. The origin of the t3t4 coordinate system is the projection point .

[0174] Next, the points in the target plane point cloud and the target cylindrical surface point cloud that are located near the theoretical intersection line of the ellipse are projected onto the theoretical intersection line to obtain a first projection point and a second projection point.

[0175] Use variable i to traverse the first three-dimensional points in the target plane point cloud and get , and calculate as follows: , ,when When within the preset range, e.g. If established, Project it onto the theoretical intersection line to get a first projection point. The position of the first projection point is obtained by: , , , . In the above formula, , , represents the minor semi-axis of the ellipse, represents the major semi-axis of the ellipse, Represents the coordinate axis where the minor axis of the ellipse is located, represents the coordinate axis where the major axis of the ellipse is located, Represents the difference vector In the t3t4 coordinate system The projection value on the axis, Represents the difference vector In the t3t4 coordinate system The projection value on the axis.

[0176] Use variable j to traverse the second three-dimensional points on the target cylindrical surface and get , and calculate as follows: After that, judge (i.e., the second distance) is less than the second preset distance, if so, Project it onto the theoretical intersection line to obtain a second projection point. The position of the second projection point is calculated by the following formula: , , , , .

[0177] In this way, the calculation formula related to the ellipse can be used to calculate the first projection point and the second projection point.

[0178] The arc weld extraction method provided in the embodiment of the present application can extract the real arc position in the point cloud and determine the starting point and end point of each arc. Figure 1 In the cases shown in a and b in the figure, since the points that meet the conditions in the target plane point cloud and the points that meet the conditions in the target cylindrical surface point cloud are used for projection, it is possible to correctly determine whether each part of the projection points is empty. Figure 1 In the case shown in a in the figure, the projection point corresponding to the target plane point cloud is not empty, while the projection point corresponding to the cylindrical point cloud is empty. Figure 1 In the case shown in b, the projection point corresponding to the target plane point cloud is empty, and the projection point corresponding to the target cylindrical point cloud is not empty. In the end, both of the above two cases are judged as not having a real arc. Figure 1 In the case shown in c, since the starting and ending positions of all intersecting arcs are obtained, the correct starting and ending positions of the arc weld can be obtained.

[0179] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the circular arc weld extraction device 200 is provided below. Optionally, the circular arc weld extraction device 200 can adopt the above Figure 2 The device structure of the electronic device 100 is shown. Fig.17 , Fig.17 A schematic block diagram of an arc weld extraction device 200 provided in an embodiment of the present application. It should be noted that the basic principle and technical effects of the arc weld extraction device 200 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference may be made to the corresponding contents in the above-mentioned embodiments. In this embodiment, the arc weld extraction device 200 may include: an analysis module 210 and an extraction module 220.

[0180] The analysis module 210 is used to determine whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse. The target plane and the target cylindrical surface are surfaces detected from the point cloud of the target object.

[0181] The extraction module 220 is used to determine whether there is a real arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtain the existing real arc as the extracted arc weld when it is determined that there is a real arc. The target plane point cloud is a local point cloud corresponding to the target plane in the target object point cloud, and the target cylindrical surface point cloud is a local point cloud corresponding to the target cylindrical surface in the target object point cloud.

[0182] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 2 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.

[0183] An embodiment of the present application also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the arc weld extraction method is implemented.

[0184] In summary, the embodiments of the present application provide a circular arc weld extraction method, device, electronic device and readable storage medium. When it is determined that the target plane and the target cylindrical surface detected from the target object point cloud theoretically intersect and the theoretical intersection line is a standard circle or ellipse, it is determined whether there is a real arc on the theoretical intersection line according to the distribution of the target plane point cloud corresponding to the target plane and the target cylindrical surface point cloud corresponding to the target cylindrical surface in the target object point cloud, and when it is determined that there is a real arc, the real arc is obtained, and the real cylinder is used as the extracted circular arc weld. In this way, the position of the circular arc weld can be accurately obtained based on the target object point cloud.

[0185] The above description is only an optional embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A circular arc weld extraction method, characterized in that: The method comprises: Determine whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse, wherein the target plane and the target cylindrical surface are surfaces detected from the point cloud of the target object; In the case of yes, judging whether there is a real arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtaining the existing real arc as the extracted arc weld when it is determined that there is, wherein the target plane point cloud is a local point cloud corresponding to the target plane in the target object point cloud, and the target cylindrical surface point cloud is a local point cloud corresponding to the target cylindrical surface in the target object point cloud; Wherein, judging whether there is a real arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtaining the existing real arc as the extracted arc weld when it is determined that the real arc exists, includes: When the number of clusters is unknown, clustering is performed on the first projection points obtained to obtain a plane arc point set, and first position information of the plane arcs corresponding to each plane arc point set is obtained; and clustering is performed on the second projection points obtained to obtain a cylindrical arc point set, and second position information of the cylindrical arcs corresponding to each cylindrical arc point set is obtained, wherein the first projection point is a projection point on the theoretical intersection line of a three-dimensional point in the target plane point cloud located near the theoretical intersection line, and the second projection point is a projection point on the theoretical intersection line of a three-dimensional point in the target cylindrical surface point cloud located near the theoretical intersection line; For each plane arc and each cylindrical arc, determine whether the plane arc intersects with the cylindrical arc according to the first position information of the plane arc and the second position information of the cylindrical arc, and obtain third position information of the intersection arc when the intersection is determined; According to the obtained third position information of the intersection arc, judging whether there is a real arc on the theoretical intersection line, and obtaining the real arc if it is determined that there is; The method of determining whether there is a real arc on the theoretical intersection line according to the obtained third position information of the intersection arc, and obtaining the real arc when it is determined that the real arc exists, includes: For each obtained intersection arc, determine the nearest points of the two endpoints of the intersection arc in the target plane point cloud and the target cylindrical point cloud, and calculate four nearest distances based on the obtained four nearest points, wherein the nearest distance is the distance between the nearest point and the corresponding endpoint; According to the fourth preset distance and the four closest distances, it is determined whether the intersection arc is a real arc.

2. The method according to claim 1, characterized in that The step of determining whether the plane arc and the cylindrical arc intersect based on the first position information of the plane arc and the second position information of the cylindrical arc, and obtaining third position information of the intersection arc when the intersection is determined, includes: Obtaining a first center angle combination in the first position information, and obtaining a second center angle combination in the second position information, wherein the first center angle combination includes a maximum value and a minimum value of consecutive center angles corresponding to the plane arc, and the second center angle combination includes a maximum value and a minimum value of consecutive center angles corresponding to the cylindrical arc; According to the first center angle combination and the second center angle combination, it is determined whether the plane arc intersects with the cylindrical arc, and when the intersection is determined, the third position information is determined based on the first center angle combination and the second center angle combination.

3. The method according to claim 2, characterized in that The center angle combination in the position information corresponding to a set of arc points is obtained in the following way: The arc tangent function is used to calculate the center angle of each point in the arc point set; Determine an initial center angle combination according to the continuous center angles of the center angles corresponding to the points in the arc point set; Determining whether the determined initial center angle combination is a plurality of incoherent initial center angle combinations; If only one initial center angle combination is determined, the initial center angle combination is used as the center angle combination in the position information corresponding to the arc point set; If two incoherent initial center angle combinations are determined, add 360° to the two center angles in the second initial center angle combination, and use the maximum and minimum values ​​of the first initial center angle combination and the adjusted second initial center angle combination as the center angles included in the center angle combination in the position information corresponding to the arc point set, wherein the maximum value in the first initial center angle combination is 180°, and the minimum value in the second initial center angle combination is -180°.

4. The method according to claim 3, characterized in that The determining whether the plane arc intersects with the cylindrical arc according to the first center angle combination and the second center angle combination, and determining the third position information based on the first center angle combination and the second center angle combination when the intersection is determined, includes: In the case where the first center angle combination and the second center angle combination are both obtained after adjustment or are both obtained without adjustment, performing overlapping angle interval analysis according to the angle interval corresponding to the first center angle combination and the angle interval corresponding to the second center angle combination to determine whether the plane arc intersects with the cylindrical arc, and determining the third position information when the intersection is determined; In the case where one of the first and second center angle combinations is obtained through adjustment, for the first and second center angle combinations, 360 degrees are added to both center angles in the center angle combination that has not been adjusted, and overlapping angle interval analysis is performed based on the angle intervals corresponding to the two adjusted center angle combinations to determine whether the plane arc intersects with the cylindrical arc, and when the intersection is determined, the third position information is determined.

5. The method according to claim 3, characterized in that: The determining whether the plane arc intersects with the cylindrical arc according to the first center angle combination and the second center angle combination, and determining the third position information based on the first center angle combination and the second center angle combination when the intersection is determined, includes: In the case where at least one of the first and second central angle combinations is an adjusted central angle combination, determining whether the first and second central angle combinations meet a first preset condition or a second preset condition; wherein the first preset condition is that the maximum value in the second central angle combination is greater than or equal to the maximum value in the first central angle combination, and a first value obtained by subtracting 360 degrees from the maximum value in the second central angle combination is greater than a minimum value in the first central angle combination; and the second preset condition is that the maximum value in the first central angle combination is greater than or equal to the maximum value in the second central angle combination, and a second value obtained by subtracting 360 degrees from the maximum value in the first central angle combination is greater than a minimum value in the second central angle combination; If the first preset condition is met, the minimum value in the first combination of center angles is used as the minimum center angle of the intersection arc, and the first value is used as the maximum center angle of the intersection arc; If the second preset condition is met, the minimum value in the second center angle combination is used as the minimum center angle of the intersection arc, and the second value is used as the maximum center angle of the intersection arc.

6. The method according to any one of claims 2 to 5, characterized in that: The method further comprises: judging whether there is a real arc on the theoretical intersection line according to the distribution of the three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtaining the real arc as the extracted arc weld when it is determined that the real arc exists. Obtaining the first projection point and the second projection point by projection, and obtaining a first number of the first projection points and a second number of the second projection points; According to the first number and the second number, determining whether the theoretical intersection line is likely to actually exist; If the theoretical intersection line cannot actually exist, then determining that there is no real arc on the theoretical intersection line; If the theoretical intersection line may actually exist, the step of obtaining a plane arc point set and a cylinder arc point set by clustering is performed.

7. The method according to claim 6, characterized in that The obtaining the first projection point and the second projection point by projection includes: When it is determined that the theoretical intersection line is a standard circle, for each first three-dimensional point in the target plane point cloud, a first distance between the first three-dimensional point and the center of the theoretical intersection line is calculated, and when the difference between the first distance and the radius corresponding to the theoretical intersection line is less than or equal to a first preset distance, the projection point of the first three-dimensional point on the theoretical intersection line is used as the first projection point; and for each second three-dimensional point in the cylindrical point cloud, a second distance between the second three-dimensional point and the target plane is calculated, and when the second distance is less than or equal to a second preset distance, the projection point of the second three-dimensional point on the theoretical intersection line is used as the second projection point; When it is determined that the theoretical intersection line is an ellipse, for each first three-dimensional point in the target plane point cloud, a calculated value is calculated according to the standard equation of the ellipse corresponding to the first three-dimensional point and the theoretical intersection line, and it is determined whether the calculated value is within a preset range. If so, the projection point of the first three-dimensional point on the theoretical intersection line is used as the first projection point, wherein the preset range is set according to 1, and the calculated value is the value obtained by substituting the position of the first three-dimensional point into the standard equation of the ellipse; and for each second three-dimensional point in the cylindrical point cloud, the third distance between the second three-dimensional point and the target plane is calculated, and when the third distance is less than or equal to the third preset distance, the projection point of the second three-dimensional point on the theoretical intersection line is used as the second projection point.

8. The method according to any one of claims 2 to 5, characterized in that: The step of judging whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse includes: Calculating an angle according to a normal vector of the target plane and an axis of the target cylindrical surface; When the included angle is less than or equal to a first preset angle, it is determined that the target plane and the target cylindrical surface intersect theoretically and the theoretical intersection line is a standard circle, wherein the first preset angle is greater than 0 degrees, and when the theoretical intersection line is determined to be a standard circle, the first projection point and the second projection point are calculated based on the theoretical intersection line of the standard circle; When the angle is greater than the first preset angle and less than the second preset angle, it is determined that the target plane and the target cylindrical surface theoretically intersect and the theoretical intersection line is an ellipse, wherein, when the theoretical intersection line is determined to be an ellipse, the first projection point and the second projection point are calculated based on the theoretical intersection line of the ellipse.

9. A circular arc weld extraction device, characterized in that: The device comprises: An analysis module, for determining, with respect to a target plane and a target cylindrical surface, whether the target plane and the target cylindrical surface intersect theoretically and whether the theoretical intersection line is a standard circle or an ellipse, wherein the target plane and the target cylindrical surface are surfaces detected from a point cloud of a target object; an extraction module, for, in the case of yes, judging whether there is a real arc on the theoretical intersection line according to the distribution of three-dimensional points in the target plane point cloud and the target cylindrical surface point cloud, and obtaining the existing real arc as the extracted arc weld when it is determined that there is, wherein the target plane point cloud is a local point cloud corresponding to the target plane in the target object point cloud, and the target cylindrical surface point cloud is a local point cloud corresponding to the target cylindrical surface in the target object point cloud; Wherein, the extraction module is specifically used for: when the number of clusters is unknown, clustering the first projection points obtained to obtain a plane arc point set, and obtaining the first position information of the plane arc corresponding to each plane arc point set, and clustering the second projection points obtained to obtain a cylindrical arc point set, and obtaining the second position information of the cylindrical arc corresponding to each cylindrical arc point set, wherein the first projection point is the projection point of a three-dimensional point located near the theoretical intersection line in the target plane point cloud on the theoretical intersection line, and the second projection point is the projection point of a three-dimensional point located near the theoretical intersection line in the target cylindrical surface point cloud on the theoretical intersection line; for each plane arc and each cylindrical arc, judging whether the plane arc intersects with the cylindrical arc according to the first position information of the plane arc and the second position information of the cylindrical arc, and obtaining the third position information of the intersection arc when the intersection is determined; judging whether there is a real arc on the theoretical intersection line according to the obtained third position information of the intersection arc, and obtaining the real arc when it is determined that it exists; Among them, the extraction module determines whether there is a real arc on the theoretical intersection line based on the third position information of the obtained intersection arc, and when it is determined that there is a real arc, the method of obtaining the existing real arc includes: for each obtained intersection arc, determining the nearest points of the two endpoints of the intersection arc in the target plane point cloud and the target cylindrical point cloud, and calculating four nearest distances based on the obtained four nearest points, wherein the nearest distance is the distance between the nearest point and the corresponding endpoint; based on the fourth preset distance and the four nearest distances, judging whether the intersection arc is a real arc.

Citation Information

Patent Citations

  • Curved surface point cloud registration method based on secant feature correlation

    CN116934817A

  • Method and device for identifying arc-shaped welding seam

    CN118196109A