Weld joint identification method and device
By analyzing the point cloud data of the target workpiece, identifying welds between unused planes, solving the repeated welding problem caused by inaccurate weld identification in the prior art, and achieving a more efficient welding process.
Patent Information
- Application Number
- CN202510604693.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-08-12
AI Technical Summary
The existing weld recognition methods cannot identify welds that have been welded, resulting in repeated welding that may occur during robot welding.
By obtaining point cloud data for the target workpiece, planes that are not used to form the two-sided structure are identified and whether welded welds exist between these planes, repeating this process until all welded welds are identified.
Effectively identify welded welds, reduce repeated operations in robot welding, and improve welding efficiency and accuracy.
Smart Images

Figure CN120471887A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a weld identification method and device. Background Art
[0002] Existing weld seam recognition methods typically use the identified intersection line as the recognition result, and subsequent welding is performed based on this recognition result. This often does not consider whether the weld to be identified has been welded before. In other words, it is assumed that every weld to be identified in the workpiece has not been welded before. If some welds in the current workpiece have been welded before, and these welds are not identified, subsequent welding based on the identified welds will result in duplicate welding. Summary of the Invention
[0003] The embodiments of the present application provide a weld recognition method, device, electronic device and readable storage medium, which can identify welded welds in a target workpiece to provide important information for subsequent robot automatic welding, thereby reducing repeated welding.
[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 weld identification method, the method comprising:
[0006] Obtain a plane list based on the target point cloud of the target workpiece;
[0007] Determining a target two-surface structure to be analyzed based on the plane list, wherein the target two-surface structure is a structure composed of two planes having a theoretical intersection line in the currently determined target workpiece, and the two planes in the target two-surface structure have not been used to form a two-surface structure in a previous weld recognition process;
[0008] Analyzing whether there is a weld seam between two planes of the target two-sided structure according to the target point cloud to obtain plane pair information corresponding to the target two-sided structure, wherein the plane pair information is used to indicate whether there is a weld seam in the corresponding target two-sided structure;
[0009] Repeat the determination of the target two-surface structure and the weld analysis until the target two-surface structure cannot be determined, thereby obtaining a first plane pair information set of the target workpiece, wherein the first plane pair information set includes plane pair information corresponding to each determined two-surface structure.
[0010] In a second aspect, an embodiment of the present application provides a weld identification device, the device comprising:
[0011] A list acquisition module is used to obtain a plane list based on a target point cloud of a target workpiece;
[0012] an analysis module, configured to determine a target two-surface structure to be analyzed based on the plane list, wherein the target two-surface structure is a structure composed of two planes having a theoretical intersection line in the currently determined target workpiece, and the two planes in the target two-surface structure have not been used to form a two-surface structure in a previous weld recognition process;
[0013] The analysis module is further configured to analyze, based on the target point cloud, whether there is a weld seam between two planes of the target two-sided structure, so as to obtain plane pair information corresponding to the target two-sided structure, wherein the plane pair information is used to indicate whether there is a weld seam in the corresponding target two-sided structure;
[0014] The analysis module is also used to repeat the determination of the target two-sided structure and the weld analysis until the target two-sided structure cannot be determined, and a first plane pair information set of the target workpiece is obtained, wherein the first plane pair information set includes plane pair information corresponding to each determined two-sided structure.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising 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 weld identification method described in the aforementioned embodiment.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the weld identification method as described in the aforementioned embodiment.
[0017] The weld identification method, device, electronic device and readable storage medium provided by the embodiments of the present application first obtain a plane list obtained based on the target point cloud of the target workpiece; then, based on the plane list, a target two-sided structure to be analyzed is determined, and the target two-sided structure is a structure composed of two planes with theoretical intersection lines in the target workpiece currently determined, and the two planes in the target two-sided structure have not been used to form a two-sided structure in the weld identification process that has been performed; then, based on the target point cloud, whether there is a welded weld between the two planes in the target two-sided structure to obtain the plane pair information corresponding to the target two-sided structure; thereafter, the above-mentioned determination of the target two-sided structure and the weld analysis are repeated until the target two-sided structure cannot be determined, and the first plane pair information set of the target workpiece is obtained. The first plane pair information set includes the plane pair information corresponding to each determined two-sided structure. In this way, the welded welds in the target workpiece can be identified to provide important information for subsequent robot automatic welding, thereby reducing repeated welding. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. 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 relevant drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;
[0020] Figure 2 One of the flow charts of the weld identification method provided in the embodiment of the present application;
[0021] Figure 3 for Figure 2 Schematic diagram of the flow of sub-steps included in step S200;
[0022] Figure 4 for Figure 2 Schematic diagram of the flow of sub-steps included in step S300;
[0023] Figure 5 for Figure 4 A schematic flow chart of the sub-steps included in sub-step S330;
[0024] Figure 6 A schematic diagram of a process for obtaining edge points from a planar point cloud corresponding to a structural surface provided in an embodiment of the present application;
[0025] Figure 7 A schematic diagram of the positional relationship between point i and point j provided in an embodiment of the present application;
[0026] Figure 8 for Figure 4 A schematic flow chart of the sub-steps included in sub-step S340;
[0027] Figure 9 for Figure 8 A schematic flow chart of the sub-steps included in sub-step S342;
[0028] Figure 10 for Figure 9 A schematic flow chart of the sub-steps included in sub-step S3422;
[0029] Figure 11 A schematic diagram of a process for obtaining edge straight line segments based on edge points corresponding to a structural surface provided in an embodiment of the present application;
[0030] Figure 12 for Figure 4 A schematic flow chart of the sub-steps included in sub-step S350;
[0031] Figure 13 The second flow chart of the weld identification method provided in the embodiment of the present application;
[0032] Figure 14 A schematic diagram of the process of identifying a weld seam on a target workpiece provided in an embodiment of the present application;
[0033] Figure 15 A schematic block diagram of a weld identification device provided in an embodiment of the present application.
[0034] Icons: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - weld seam identification device; 210 - list acquisition module; 220 - analysis module. DETAILED DESCRIPTION
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0036] 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 protection, 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 making any creative efforts shall fall within the scope of protection of the present application.
[0037] 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 actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0038] Existing weld seam recognition methods generally use the identified intersection line as the weld to be welded. During the weld seam recognition process, it is often impossible to determine whether the current weld has been welded before (it may have been welded manually or by a robot). For welds that have already been welded, since the robot does not need to re-weld them, it should be identified as having been welded before. For welds that have not been welded before, it should be identified as not having been welded before. The robot can use the weld mark to determine whether welding is necessary.
[0039] In order to solve the problem of weld identification in the workpiece to be welded, the embodiments of the present application provide a weld identification method, device, electronic device and readable storage medium, which can identify the welded welds in the target workpiece to provide important information for subsequent robot automatic welding, thereby reducing repeated welding.
[0040] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0041] Please refer to Figure 1 , Figure 1 This is a 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 enable data transmission or exchange. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.
[0042] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0043] 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 a weld identification device 200, which includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes the software programs and modules stored in the memory 110, such as the weld identification device 200 in the embodiment of the present application, to perform various functional applications and data processing, thereby implementing the weld identification method in the embodiment of the present application.
[0044] 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.
[0045] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0046] Please refer to Figure 2 , Figure 2 This is a schematic diagram of a flow chart of a weld seam identification method provided in an embodiment of the present application. The method can be applied to the electronic device described above. The specific flow of the weld seam identification method is described in detail below. In this embodiment, the method may include steps S100 to S400.
[0047] Step S100 : obtaining a plane list based on a target point cloud of a target workpiece.
[0048] In this embodiment, the target workpiece is a workpiece that requires weld identification. The point cloud of the target workpiece can be first obtained as the target point cloud, and then plane detection can be performed on the target point cloud to obtain a plane list; or, a plane list obtained by other devices through plane detection on the target point cloud can be received. The specific method of obtaining the plane list by detection is not specifically limited here. The plane list includes multiple detected planes. Optionally, the plane list is also used to indicate the plane point cloud corresponding to each plane in the target point cloud. The point cloud points included in the plane point cloud corresponding to a plane are the point cloud points in the target point cloud that are located near the plane.
[0049] Step S200: determining a target two-surface structure to be analyzed according to the plane list.
[0050] Once the plane list is obtained, a two-sided structure to be analyzed can be determined as a target two-sided structure by combining the planes in pairs. The target two-sided structure is a structure composed of two planes that have a theoretical intersection line in the target workpiece, and the two planes in the target two-sided structure have not been used to form a two-sided structure during the weld identification process. In other words, the target two-sided structure is a newly identified two-sided structure, and the two-sided structure is a structure composed of two planes that have a theoretical intersection line.
[0051] The theoretical intersection line can be a line segment or a straight line. Optionally, if a plane intersection line can be calculated based on two planes, it can be determined that there is a theoretical intersection line between the two planes, and the plane intersection line can be used as the theoretical intersection line. Alternatively, when a plane intersection line is calculated based on two planes, if there are more than a certain number of points in the plane point clouds of the two planes respectively located near the plane intersection line, it can be determined that there is a theoretical intersection line between the two planes. At this time, the plane intersection line can be used as the theoretical intersection line, or the points in the plane point clouds of the two planes located near the plane intersection line can be projected onto the plane intersection line to determine the starting point and the end point, and the line segment with the two determined points on the plane intersection line as the starting point and the end point can be used as the theoretical intersection line. The method for determining whether there is a theoretical intersection line between two planes and the specific determination of the theoretical intersection line can be determined in combination with actual needs and are not specifically limited here.
[0052] Step S300 : analyzing whether there is a weld between two planes in the target two-surface structure according to the target point cloud, so as to obtain plane pair information corresponding to the target two-surface structure.
[0053] In this embodiment, the presence of a weld seam between two planes in the target two-sided structure can be determined based on the distribution of the point cloud points in the target point cloud. If a weld seam has been welded manually or robotically, it can be considered a weld seam. After this determination, plane pair information corresponding to the target two-sided structure can be obtained. This plane pair information indicates whether a weld seam exists between two planes in the two-sided structure. This plane pair information can also include other information, which can be determined based on actual needs.
[0054] Step S400 , repeating the determination of the target two-surface structure and the weld analysis until the target two-surface structure cannot be determined, thereby obtaining a first plane pair information set of the target workpiece.
[0055] After obtaining plane pair information for a target dihedral structure, it is saved as plane pair information for a dihedral structure. Steps S200 to S300 are then repeated, along with the newly obtained plane pair information for the dihedral structure, until no target dihedral structure to be analyzed can be determined. At this point, it is considered that all welds in the target workpiece have been identified, and first plane pair information for the target workpiece is obtained. This first plane pair information includes plane pair information corresponding to each determined dihedral structure (i.e., the structure designated as the target dihedral structure during the analysis process).
[0056] In this way, it is possible to identify which two-sided structures in the target workpiece have welded seams between the two planes. When the robot subsequently performs automatic welding, it can combine this information with the identified welds to screen out the welds that need to be welded, and then perform automatic welding, thereby reducing repeated welding.
[0057] In some welds, the welds are relatively flat. These flat welds may be detected as planes during plane detection, that is, some planes in the plane list correspond to the planes of the target workpiece, and some planes correspond to welds. The planes corresponding to the welds can be called welding planes, that is, weld planes. In this embodiment, a current plane information set corresponding to the plane list can be obtained. The number of plane information in the plane information set is the same as the number of planes in the plane list. One plane information is used to indicate whether a corresponding plane in the plane list is currently considered to be a welding plane. The plane information set can be obtained in advance and no longer updated, or it can be updated during the weld identification process. The specific acquisition method and update method of the plane information set are not specifically limited here.
[0058] To avoid unnecessary weld identification, Figure 3 The target two-face structure is determined in the manner shown. Figure 3 , Figure 3 for Figure 2 Schematic diagram of the flow of sub-steps included in step S200. In this embodiment, step S200 may include sub-steps S210 to S220.
[0059] Sub-step S210: determining from the plane list two planes that are not currently marked as welding planes to form an initial two-plane structure.
[0060] Sub-step S220 : determining whether to use the initial two-surface structure as a target two-surface structure according to whether a theoretical intersection line exists between two planes in the initial two-surface structure.
[0061] In this embodiment, a traversal process can be performed to identify a plane from the plane list. The traversal process then combines the aforementioned plane information set to determine whether the plane is currently marked as a welding plane. If the plane is currently marked as a welding plane, the traversal process continues. If the plane is not currently marked as a welding plane, the plane can be selected from the plane list as a plane to form the initial two-sided structure. After a plane is identified as forming the initial two-sided structure, the same traversal process can be performed for the plane following the plane in the plane list to select a second plane that is not currently marked as a welding plane to form the initial two-sided structure. This traversal process avoids omissions, and the combined use of the plane information set for screening reduces unnecessary analysis and processing.
[0062] After determining the initial dihedral structure, it can be determined whether a theoretical intersection exists between the two planes of the initial dihedral structure. If no theoretical intersection exists between the two planes of the initial dihedral structure, a new initial dihedral structure can be determined. Optionally, when re-determining the new initial dihedral structure, the first plane selected from the plane list to form the initial dihedral structure can remain unchanged, and the planes in the plane list that follow the second plane previously selected to form the initial dihedral structure can be traversed to select a new second plane to form the initial dihedral structure. If a theoretical intersection exists between the two planes of the initial dihedral structure, the initial dihedral structure can be used as the target dihedral structure to be analyzed.
[0063] As a possible implementation method, the concavity and convexity of the target two-sided structure can be combined to analyze whether there are welded seams in the target two-sided structure. Figure 4 , Figure 4 for Figure 2 Schematic diagram of the flow of sub-steps included in step S300. In this embodiment, step S300 may include sub-steps S310 to S350.
[0064] Sub-step S310: analyzing and obtaining the concavity and convexity of the target dihedral structure.
[0065] In this embodiment, the position of the point cloud acquisition device used for the target point cloud can be obtained, and the concavity and convexity of the target two-surface structure can be obtained based on the position analysis. The specific analysis method can be determined based on actual needs.
[0066] Optionally, when a point cloud acquisition device is mounted on a robot end, a tool center point (TCP) can be obtained as the location of the point cloud acquisition device. A dihedral structure segmentation can be performed on the two planes of the target dihedral structure to obtain two planes after segmentation. Dihedral structure segmentation utilizes the TCP, retaining the points on each plane that lie on the TCP side. The structure formed by the two planes after segmentation is then analyzed for convexity and concavity, and the analysis results are used as the convexity and concavity analysis results of the target dihedral structure.
[0067] Sub-step S320 , when the concavity and convexity of the target two-surface structure is convex, determining that no weld seam exists in the target two-surface structure.
[0068] Welds are generally located in two-sided structures with concave convexity. When the concave-convexity of a structure composed of two planes is convex, it is impossible for a weld to exist between the two planes. Therefore, when the concave-convexity of the target two-sided structure is convex, it can be directly determined that no weld exists between the two planes in the target two-sided structure, thereby obtaining plane pair information for the target two-sided structure. In this case, the plane pair information of the target two-sided structure indicates that no weld exists between the two planes in the two-sided structure, that is, indicates that no weld exists in the two-sided structure.
[0069] In sub-step S330, when the convexity of the target two-sided structure is concave, for each structural surface of the target two-sided structure, according to the plane point cloud corresponding to the target point cloud and the theoretical intersection line of the structural surface in the target two-sided structure, the edge points in the plane point cloud located near the theoretical intersection line are determined.
[0070] In this embodiment, the two planes in the target two-sided structure may be referred to as structural planes. When the concavity and convexity of the target two-sided structure is concave, for each structural plane in the target two-sided structure, the position of each point cloud point in the plane point cloud corresponding to the structural plane in the target point cloud and the theoretical intersection line in the target two-sided structure may be used to determine the edge points of the plane result of each structural plane located near the theoretical intersection line.
[0071] Alternatively, as a possible implementation, for a structural surface, based on the distance between each point in the plane point cloud of the structural surface and the straight line containing the theoretical intersection, the point cloud points with a distance less than a distance threshold are regarded as the edge points corresponding to the structural surface. In this way, the edge points corresponding to a plane can be quickly determined.
[0072] Alternatively, as another possible implementation, Figure 5 The edge points are determined in the manner shown. Figure 5 , Figure 5 for Figure 4Flowchart of sub-steps included in sub-step S330. In this embodiment, sub-step S330 may include sub-steps S331 to S337.
[0073] Sub-step S331 , for each point cloud point in the planar point cloud of the structural surface, if it is not determined whether the point cloud point is an edge point, a neighborhood point set of the point cloud point is determined from the planar point cloud of the structural surface.
[0074] In this embodiment, the point cloud points in the planar point cloud of the structural surface can be traversed. For the traversed point cloud point, it can be determined whether the point cloud point has been determined to be an edge point or has been determined not to be an edge point. If the point cloud point has been determined to be an edge point or has been determined not to be an edge point, the next point cloud point can be traversed directly. If the point cloud point has not been determined to be an edge point, a K-nearest neighbor search can be performed for the edge point in the planar point cloud of the structural surface to obtain a neighborhood point set for the point cloud point, which includes multiple neighborhood points of the found point cloud point.
[0075] Sub-step S332: traverse the neighborhood points in the neighborhood point set to determine whether a first connecting line between the point cloud point and the currently traversed neighborhood point is perpendicular to the theoretical intersection line.
[0076] Traverse the neighborhood points in the neighborhood point set of the point cloud point and obtain a first line formed by the traversed neighborhood point and the point cloud point. The starting point of the first line is the point cloud point and the end point is the traversed neighborhood point. Then, determine whether the first line is perpendicular to the theoretical intersection line. Optionally, determine whether the following conditions are met: ij t≤preset threshold 1, where p ij represents the first straight line, and t represents the direction vector of the theoretical intersection line. If true, it can be determined that the first connecting line is perpendicular to the theoretical intersection line. If not, it can be determined that the first connecting line and the theoretical intersection line are not perpendicular. In this case, the neighboring points in the neighboring point set are traversed. In other words, at this time, it is impossible to determine whether the point cloud point and the traversed neighboring point are edge points. The traversal object of the current neighboring point is updated to the next neighboring point in the neighboring point set.
[0077] Sub-step S333: If the first connecting line is perpendicular to the theoretical intersection line, determine whether the first connecting line points to the negative direction of the second coordinate axis.
[0078] In this embodiment, a second coordinate axis can be constructed based on the theoretical intersection line. The second coordinate axis is perpendicular to the theoretical intersection line and the target normal of the structural surface, and the positive direction of the second coordinate axis points to the theoretical intersection line. The target normal points to the inside of the structural surface. When the first connecting line is perpendicular to the theoretical intersection line, it is determined whether the first connecting line points to the negative direction of the second coordinate axis. Optionally, it can be determined whether the following conditions are met: p ij t2<0, this condition determines p ij The relative position of the t2 axis (i.e. the second coordinate axis) is less than 0, indicating that p ij Points in the opposite direction of the t2 axis (i.e., the negative direction).
[0079] If the first connecting line points to the negative direction of the second coordinate axis, sub-step S334 is executed: determining that the neighborhood point is not an edge point.
[0080] If the first connecting line does not point to the negative direction of the second coordinate axis, sub-step S335 is executed: determining whether the first connecting line points to the positive direction of the second coordinate axis and the projection length on the second coordinate axis is greater than a preset projection length.
[0081] If the first connecting line points in the positive direction of the second coordinate axis and the projection length on the second coordinate axis is greater than the preset projection length, then sub-step S336 is executed: determining that the point cloud point is not an edge point and stopping the traversal of the neighboring points of the point cloud point. Otherwise, the traversal of the neighboring points in the neighboring point set continues.
[0082] Sub-step S337: If it cannot be determined that the point cloud point is not an edge point after all the neighborhood points of the point cloud point have been traversed, then the point cloud point is determined to be an edge point.
[0083] In this embodiment, when the first connecting line does not point to the negative direction of the second coordinate axis, it can be determined whether the first connecting line points to the positive direction of the second coordinate axis, and the projection length of the first connecting line on the second coordinate axis is calculated, and then it can be determined whether the second projection length is greater than the preset projection length. Among them, the preset projection length is greater than 0, and can be determined in combination with actual needs. If the first connecting line points to the positive direction of the second coordinate axis and the projection length on the second coordinate axis is greater than the preset projection length, it can be determined that the point cloud point is not an edge point; on the contrary, if the first connecting line does not point to the positive direction of the second coordinate axis, or the projection length of the first connecting line on the second coordinate axis is less than or equal to the preset projection length, it cannot be determined whether the point cloud point is an edge point. At this time, the neighboring points in the neighboring point set of the point cloud point continue to be traversed, that is, the traversal object of the current neighboring point is updated to the next neighboring point in the neighboring point set.
[0084] The above judgment can be realized by judging whether the following conditions are met: ij ·t2> preset threshold 2, this condition indicates that p ij Pointing to the positive direction of the t2 axis, and the projection value on the t2 axis exceeds one value, this means that the point cloud point currently traversed cannot be an edge point.
[0085] If after traversing the last neighboring point of a point cloud point, it is still not determined based on the last neighboring point that the point cloud point is not an edge point, the point cloud point is directly determined as an edge point.
[0086] The following combination Figure 6 , which gives an example of how to obtain the edge points corresponding to a structural surface. Figure 6 , Figure 6 Schematic diagram of the process of obtaining edge points from a planar point cloud corresponding to a structural surface provided in an embodiment of the present application. In the following method, the input is: a planar point cloud of a structural surface, a first coordinate axis, and a second coordinate axis, and the output is: an edge point cloud, where the points in the edge point cloud are the determined edge points.
[0087] Assume that the two planes (i.e., two structural surfaces) of the target two-sided structure are plane 1 and plane 2. The relevant parameters of plane 1 and plane 2 can be obtained, including: the normal n1, ρ1, and center of mass m1 of plane 1, the normal n2, ρ2, and center of mass m2 of plane 2. Calculate p 12 =m2-m1,p 12 represents a vector pointing from the center of mass of plane 1 to the center of mass of plane 2. 12 Adjust n1 and n2 so that n1 and n2 point to the inside of the two planes, that is, n1 and p 12 The inner product of n2 and p is greater than 0. 12 The inner product is less than 0. After the above processing, n1 is the target normal of plane 1, and n2 is the target normal of plane 2.
[0088] The theoretical intersection line of planes 1 and 2 is calculated, and the intersection direction vector is t. The method for finding the theoretical intersection line is as follows: determine the intersection direction vector: t = n1 × n2, and then normalize t; determine a point through which the theoretical intersection line passes, let this point be p0, and the coordinates of this point are (x0, y0, z0), and the coordinates of this point satisfy a specific equation. The equation satisfied by p0 is:
[0089] n 1,x x0+n 1,y y0+n 1,z z0=ρ1
[0090] n 2,x x0+n 2,y y0+n 2,z z0=ρ2
[0091] t x x0+t y y0+t z z0=0
[0092] Among them, n 1,x represents the x component of n1, n 1,y represents the y component of n1, n 1,z represents the z component of n1, n 2,x represents the x component of n2, n 2,y represents the y component of n2, n 2,z represents the z component of n2, t x represents the x-component of t, t y represents the y component of t, t z represents the z component of t.
[0093] Construct the first coordinate axis t of the coordinate system on plane 1 based on n1 and t 11 , the second coordinate axis t 12 Among them, t 11 Parallel to t, t 12 =n1×t 11 , then t 12 Normalized. t 11 , t 12 are two coordinate axes located in plane 1, t 11 , t 12 Considered as x and y coordinate axes, n1 points in the direction of the z coordinate axis.
[0094] Then, the edge detection function can be used to find the edge points of plane 1 close to the theoretical intersection line, and the edge points of plane 2 close to the theoretical intersection line. Figure 6 is an example of finding the edge points of a plane.
[0095] A kd-tree is built for the planar point cloud of the plane, and the processed array is initialized. The size of the processed array is the same as the number of point cloud points in the planar point cloud of the plane. The value of each element of the processed array is used to indicate whether the corresponding point cloud point has been processed, that is, whether it has been determined to be an edge point or has been determined not to be an edge point. The array is initialized to an array of all 0s.
[0096] Use i to traverse the points on the plane point cloud. Initially, i=0. Determine whether i is less than the number of plane point cloud points (that is, the number of point cloud points in the plane point cloud of plane 1). If i is not less than the number of plane point cloud points, the algorithm ends. If i is less than the number of plane point cloud points, determine whether processed[i] is 1. If processed[i] is 1, jump to the step of increasing i. If processed[i] is not 1, perform p in the kd tree. i Search the K nearest neighbors of a point and get the indices of the neighboring points.
[0097] Use j to traverse indices and determine whether j is less than the size of indices, that is, determine whether the neighborhood points have been traversed. If j is not less than the size of indices, go to the next step: determine whether edge_sign is 1. If j is less than the size of indices, set edge_sign = 1, that is, assume that p i Point is an edge point, and calculate p ij =p j -p i , p ij This is the first connection mentioned above. Next, determine whether the following conditions are met: ij ·t1<=preset threshold 1. The above conditions indicate that the line connecting point j and point i is approximately perpendicular to the t1 axis, where the t1 axis is t 11 or t 21 , that is, the axis parallel to the theoretical intersection line, or directly use the direction vector t of the theoretical intersection line as the t1 axis in the above conditions. If the above conditions are not met, then p cannot be determined at this time i Whether point j is an edge point or not, it is not possible to determine whether point j is an edge point, so jump to the step of increasing j.
[0098] If the above conditions are met, the following judgment is made: ij t2<0, this condition determines p ij The relative position of the t2 axis, if it is less than 0, it means that p ij Pointing to the opposite direction of the t2 axis. Among them, the t2 axis is perpendicular to the t1 axis and is the axis pointing to the direction of the theoretical intersection (that is, the t 12 or t 22 ). If p ij points in the opposite direction of the t2 axis, then point j cannot be an edge point, and set processed[indices[j]] = 1 to indicate that the point has been processed. ij If it does not point to the opposite direction of the t2 axis, the following judgment is made: p ij ·t2> preset threshold 2, this condition indicates that p ijPointing to the direction of the t2 axis, and the projection value on the t2 axis exceeds a value, if the condition is met, it means that point i cannot be an edge point, set edge_sign = 0, and jump to step: determine whether edge_sign is 1. If p ij If t2 > preset threshold 2 does not hold, then jump to the step of increasing j.
[0099] Point i (i.e. p i point) and point j (i.e. p j The relationship diagram of point) is as follows Figure 7 shown. Figure 7 In a, the case where point j is not an edge point is given. In this case, point j is closer to the inside than point i. Figure 7 The case where point i is not an edge point is given in b. In this case, point i is closer to the inside than point j. Figure 7 In the figure, the positions of the axes t1 and t2 are also given, and the position of the theoretical intersection line is represented by a dotted line, where t1 is parallel to t.
[0100] When edge_sign=0 and j is not less than the size of indices, determine whether edge_sign is 1. If edge_sign is 1, it means that point i is an edge point, and p i Stored in the edge point cloud. When i is traversed, the algorithm terminates and the edge points close to the theoretical intersection line on the plane are obtained.
[0101] Sub-step S340 : determining the edge straight line segment corresponding to the structural surface according to the edge point corresponding to the structural surface.
[0102] After obtaining the edge points corresponding to a structural surface, the edge straight line segment corresponding to the structural surface can be obtained by analysis. The edge straight line segment can be obtained by performing linear analysis on the edge points.
[0103] As a possible implementation, Figure 8 The method shown is to obtain the edge straight line segment corresponding to a structural surface. Figure 8 , Figure 8 for Figure 4 Flowchart of sub-steps included in sub-step S340. In this embodiment, sub-step S340 may include sub-steps S341 to S346.
[0104] Sub-step S341 , calculating and obtaining a first distance between each edge point in the structural surface and the theoretical intersection line.
[0105] Sub-step S342: determining the target distance according to the obtained first distance.
[0106] In this embodiment, the distance between each edge point on the structural surface and the theoretical intersection line can be calculated as the first distance, and then the target distance can be determined based on the obtained first distance analysis. For example, the median, mode, or average of the obtained first distance can be used as the target distance, or the target distance can be obtained through analysis using other methods.
[0107] As a possible implementation, Figure 9 The target distance is obtained in the manner shown. Figure 9 , Figure 9 for Figure 8 Flowchart of sub-steps included in sub-step S342. In this embodiment, sub-step S342 may include sub-steps S3421 to S3424.
[0108] Sub-step S3421, sorting the obtained first distances in descending order to obtain a distance array.
[0109] Sub-step S3422: judging whether the edge points corresponding to the consecutive first distances in the distance array are continuous, based on whether the consecutive first distances in the distance array meet a preset continuity condition, to determine whether the starting point of the continuous edge is found.
[0110] In this embodiment, the obtained first distances are sorted in descending order to obtain a distance array. The distance array is then traversed, and based on whether multiple consecutive first distances in the distance array meet a preset continuity condition, it is determined whether the multiple edge points corresponding to the multiple first distances are continuous, thereby determining whether the starting point of the continuous edge has been found. The preset continuity condition specifies that the distance difference between two first distances that differ by a preset number of sorted positions is less than a first preset distance.
[0111] As a possible implementation, Figure 10 The method shown is used to determine whether the starting point of the continuous edge is found. Figure 10 , Figure 10 for Figure 9 Flowchart of sub-steps included in sub-step S3422. In this embodiment, sub-step S3422 may include sub-steps S34221 to S34229.
[0112] Sub-step S34221, traverse the distance array and set the current consecutive times to 0.
[0113] In this embodiment, the largest first distance in the distance array is used as the first object to be traversed, and the first distance currently traversed can be referred to as the first distance to be analyzed. Furthermore, before traversing the distance array, the current consecutive count can be set to 0. The current consecutive count indicates the number of consecutive edge points identified while maintaining the currently traversed first distance unchanged.
[0114] Sub-step S34222: for the first distance to be analyzed currently traversed, determine a second distance to be analyzed according to the first distance to be analyzed and the current consecutive times, and determine a third distance to be analyzed according to the second distance to be analyzed and the preset number of positions.
[0115] For the first distance to be analyzed that is currently traversed, a first distance is determined from the distance array as the second distance to be analyzed based on the order of the first distance in the distance array, the position of the first distance to be analyzed in the distance array, and the current consecutive number of times. The difference in the number of positions of the first distance to be analyzed and the second distance to be analyzed in the distance array is equal to the current consecutive number of times. Thereafter, based on the second distance to be analyzed and the number of preset positions, a first distance is determined from the distance array as the third distance to be analyzed. The difference in the number of positions of the second distance to be analyzed and the third distance to be analyzed in the distance array is equal to the number of preset positions. The number of preset positions can be determined based on actual needs, such as 10, and is not specifically limited here.
[0116] Sub-step S34223: determining whether the distance difference between the second distance to be analyzed and the third distance to be analyzed is greater than a first preset distance.
[0117] After determining the second distance to be analyzed and the third distance to be analyzed, the difference between the second distance to be analyzed and the third distance to be analyzed is calculated. A determination is made as to whether the difference is greater than a first preset distance. The first preset distance can be determined based on actual needs, for example, 5 mm.
[0118] If the distance difference is greater than the first preset distance, sub-step S34224 is executed: determining that the current continuity flag indicates discontinuity, and updating the next first distance of the second distance to be analyzed in the distance array to the first distance to be analyzed currently traversed.
[0119] If the distance difference is not greater than the first preset distance, sub-step S34225 is executed: determining that the current continuous flag indicates continuity, and updating the current continuous number, wherein the updating method is to add 1.
[0120] After the current consecutive number is updated, sub-step S34226 is executed: determining whether the current consecutive number is less than a preset consecutive number, wherein the preset consecutive number is a preset number, which can be determined according to actual needs, such as 3.
[0121] When the current continuous number is less than the preset continuous number, sub-step S34222 is executed again, that is, the second distance to be analyzed is determined again according to the first distance to be analyzed and the current continuous number.
[0122] When the current continuous number is not less than the preset continuous number, sub-step S34227 is executed: determining whether the current continuous flag indicates continuous.
[0123] If the current continuous flag indicates continuous, sub-step S34228 is executed: the edge point corresponding to the current first distance to be analyzed is used as the starting point of the continuous edge.
[0124] When the current continuous number is not less than the preset continuous number, if the current continuous flag indicates discontinuity, execute sub-step S3422: update the next first distance of the second distance to be analyzed in the distance array to the first distance to be analyzed currently traversed, and then jump to sub-step S34222.
[0125] If the current continuous flag indicates discontinuity when the distance array is traversed, it is determined that the starting point of the continuous edge is not found.
[0126] Sub-step S3423 : When the starting point of the continuous edge is determined to be found, the target distance is determined according to the first distance corresponding to the starting point of the continuous edge.
[0127] When the starting point of a continuous edge is determined, the first distance corresponding to the starting point of the continuous edge can be used as the target distance, or the smallest first distance in the distance array that is located within a certain position range after the starting point can be used as the target distance. Alternatively, it can be determined whether there is a target position in the distance array. If so, the first distance corresponding to the target position is used as the target distance. If not, the first distance between the starting point of the point and the theoretical intersection line (i.e., the corresponding first distance) is used as the target distance. The first distance corresponding to the target position and the starting point differs by the preset number of positions in the distance array.
[0128] Sub-step S3424: If it is determined that the starting point of the continuous edge is not found, the last first distance in the distance array is used as the target distance.
[0129] If the starting point of the continuous edge has not been found when the distance array is traversed, the last first distance in the distance array may be directly used as the target distance, that is, the smallest first distance may be used as the target distance.
[0130] Sub-step S343 : determining, from the edge points of the structural surface, an edge point whose corresponding first distance is close to the target distance as a target edge point.
[0131] After determining the target distance, the first distance between each edge point of the structural surface and the theoretical intersection line can be compared with the target distance. If the difference between a first distance and the target distance is less than a threshold, the first distance can be determined to be close to the target distance. If the difference between a first distance and the target distance is not less than a threshold, the first distance can be determined to be not close to the target distance. Through this analysis and judgment, edge points whose corresponding first distances are close to the target distance can be selected as target edge points.
[0132] Sub-step S344: Calculate and obtain the edge centroid of the determined target edge point.
[0133] Sub-step S345 , determining a target straight line according to the edge centroid and the direction of the theoretical intersection line.
[0134] Sub-step S346 , projecting the point cloud points in the plane point cloud of the structural surface near the target straight line onto the target straight line to obtain the edge straight line segment corresponding to the structural surface.
[0135] After determining the target edge points, the centroid of these target edge points can be calculated as the edge centroid. Then, the edge centroid is used as the point through which the target line passes, and the direction of the theoretical intersection is used as the direction of the target line, thereby determining the target line. Next, based on a distance threshold, point cloud points located near the target line are screened from the planar point cloud of the structural surface, and these point cloud points are projected onto the target line to obtain the start and end points of the edge line segment. If the distance between a point cloud point and the target line is less than the distance threshold, it can be determined that the point cloud point is located near the target line; if the distance between a point cloud point and the target line is not less than the distance threshold, it can be determined that the point cloud point is not located near the target line.
[0136] Please refer to Figure 11 , Figure 11 A schematic diagram of the process of obtaining edge straight line segments based on edge points corresponding to a structural surface provided in the embodiment of the present application. Figure 11 The process of obtaining the edge straight line segment of a structural surface is explained.
[0137] First, the distance from the edge point to the theoretical intersection line (i.e., the first distance mentioned above) is calculated, and the distances are sorted from large to small to obtain the sorted array dis (i.e., the distance array mentioned above).
[0138] Use i to traverse the array dis and set the preset number of continuations to 3, that is, continuous_num = 3. The definition of edge continuity is: the difference between the distances of two edge points 10 apart in the distance array to the theoretical intersection line is less than 5.
[0139] Determine whether i is less than the number of edge points. If i is not less than the number of edge points, then dis_use = dis[i-1], where dis_use represents the theoretical distance used, i.e., the target distance described above. If i is less than the number of edge points, then set continuous_sign = 1 (i.e., assume that the current continuous flag indicates continuity), use t for traversal, initially t = 0, and determine whether t is less than continuous_num. If t is less than continuous_num, then set i_1 = i+t and j_1 = i_1+10, and determine whether j_1 is greater than or equal to the number of edge points. If j_1 is greater than or equal to the number of edge points, then determine whether the current continuous_sign is 0. If j_1 is less than the number of edge points, then determine whether the following condition holds: dis[i_1]-dis[j_1]>5. If the condition holds, it means that the difference in distances between points i_1 and j_1 to the theoretical intersection line is greater than 5, and the edge points are discontinuous. Set continuous_sign = 0, and then execute the step of determining whether the current continuous_sign is 0. If the condition is not met, jump to the step of increasing t.
[0140] After determining whether continuous_sign is 0, if continuous_sign is 0, set i = i_1, increase i, and then execute: determine whether i is less than the number of edge points; if continuous_sign is 1, it means that the starting point of the continuous edge is found.
[0141] When the starting point of the continuous edge is found, determine whether i+10 is less than the number of edge points. If i+10 is less than the number of edge points, set dis_use = dis[i+10]; if i+10 is not less than the number of edge points, set dis_use = dis[i].
[0142] After determining the dis_use, select the points that meet the requirements from the edge points of the structural surface and calculate the centroid of these points. The calculated centroid is used as the point p through which the target line passes. 0,line Among them, the distance between the point that meets the requirements and the theoretical intersection line is close to dis_use. According to p 0,lineThe target line is determined by the direction vector t of the theoretical line. The point on the structural surface that is closest to the target line is projected onto the target line to obtain the starting point and end point of the edge line segment.
[0143] Sub-step S350 : judging whether there is a weld seam in the target two-surface structure according to the two obtained edge straight line segments.
[0144] After obtaining the edge straight line segments corresponding to the two planes (i.e., two structural surfaces) in the target two-sided structure, it can be determined whether there is a weld between the two planes in the target two-sided structure based on the position distribution of the two obtained edge straight line segments.
[0145] As a possible implementation, Figure 12 The method shown is based on the analysis of the welded seam using two straight edge segments. Figure 12 , Figure 12 for Figure 4 Flowchart of sub-steps included in sub-step S350. In this embodiment, sub-step S350 may include sub-steps S351 to S353.
[0146] Sub-step S351 : calculating the second distance between the two edge straight line segments.
[0147] Sub-step S352: determining whether the second distance is less than a second preset distance.
[0148] If the second distance is less than the second preset distance, sub-step S353 may be executed: determining whether there is no welded seam in the target two-surface structure.
[0149] In this embodiment, a line formed by the midpoints of two edge straight line segments is determined as the second line. This second line is then projected onto the line containing one of the edge straight line segments to obtain a projection value. The dot product of this projection value and the direction vector of the line containing the edge straight line segment used for projection is calculated. A new vector is then calculated by subtracting this dot product from the second line segment, and the modulus of this new vector is used as the second distance. Next, a determination is made as to whether this second distance is less than a threshold. If so, it is determined that no weld seam exists between the two planes of the target two-sided structure.
[0150] Assume that the two planes of the target two-sided structure are planes 1 and 2, the edge straight line segment of plane 1 is edge straight line segment 1, and the edge straight line segment of plane 2 is edge straight line segment 2. The midpoint p of edge straight line segment 1 is obtained center,1 , and get the midpoint p of edge line segment 2 center,2 , calculate p center,diff =p center,2 -p center,1, p center,diff Project it onto the line t1| where the edge line segment 1 is located, and judge whether the projection distance is less than the preset threshold 3, that is, judge whether |p center,diff -(p center,diff ·t1)t1|<preset threshold 3, if it is less than, it is judged that there is no weld between plane 1 and plane 2. |p center,diff -(p center,diff ·t1)t1| represents the vertical distance between two edge straight line segments. When a weld exists between two planes, the vertical distance between the two edge straight line segments cannot be very close. Therefore, when the vertical distance between the two edge straight line segments is very close, it is determined that there is no weld between the two planes.
[0151] Please refer again Figure 12 Sub-step S350 may further include sub-steps S354 to S359. If the second distance is not less than the second preset distance, sub-step S354 is executed.
[0152] Sub-step S354: determining a projection plane based on the straight line where the two edge straight line segments are located.
[0153] In this embodiment, the straight line on which the two edge straight line segments are located can be regarded as a straight line through which a plane passes, thereby determining a plane as a projection plane, and the projection plane is infinite.
[0154] Sub-step S355: determining projectable points in other point clouds.
[0155] The other point clouds are point clouds in the target point cloud excluding the plane point clouds corresponding to the target two-face structure. When all point cloud points in the target point cloud are assigned to a plane in the plane list, the other point clouds are the point clouds corresponding to the planes in the plane list excluding the two planes corresponding to the target two-face structure in the target point cloud. When there are point cloud points in the target point cloud that are not assigned to any plane in the plane list, the other point clouds include the point clouds corresponding to the planes in the plane list excluding the two planes corresponding to the target two-face structure in the target point cloud, as well as points not assigned to a plane.
[0156] Projectable points can be determined from other point clouds based on preset projection point conditions. The projection point conditions specify that the projectable point is located near the projection plane and that the projection point on the projection plane is between the lines containing the two obtained edge line segments. In other words, for a point in other point clouds to be projected onto the projection plane, the following conditions must be met: First, the point is projected onto the projection surface, and a determination is made as to whether the projection point is between Line 1 (edge line segment 1) and Line 2 (edge line segment 2), and whether the distance from the point to the projection plane meets a distance threshold. This distance threshold can be determined based on actual needs, for example, 10 mm.
[0157] Sub-step S356 , determining a plurality of sampling points within the quadrilateral formed by the two edge straight line segments.
[0158] A quadrilateral can be determined by connecting the adjacent endpoints of the two edge straight line segments. A plurality of sampling points can be determined within the quadrilateral. Optionally, the plurality of sampling points can be uniformly generated within the quadrilateral.
[0159] Sub-step S357 : for each sampling point, determining whether the first quantity corresponding to the sampling point is greater than a first preset quantity.
[0160] Sub-step S358 , obtaining by counting a second number of sampling points whose corresponding first number is greater than the first preset number.
[0161] Sub-step S359, if the total number of projectable points is greater than a second preset number and the ratio of the second number to the total number of sampling points is greater than a first preset ratio, it is determined that there are welded welds in the target two-sided structure; otherwise, it is determined that there are no welded welds in the target two-sided structure.
[0162] After determining the multiple sampling points and projectable points, the following analysis can be performed for each sampling point. Using the sampling point as the center and the third preset distance as the radius, the number of projectable points within the circle determined in the above manner is determined, and this number is used as the first number corresponding to the sampling point. That is, the first number is the number of projectable points among the determined projectable points whose distance from the sampling point is less than the third preset distance. Next, a determination is made as to whether the first number corresponding to the sampling point is greater than the first preset number. The first preset number can be set based on actual needs. Then, the number of sampling points whose corresponding first number is greater than the first preset number is counted as the second number.
[0163] When the second number is obtained, it can be determined whether the total number of projectable points is greater than a second preset number and the ratio of the second number to the total number of sampling points is greater than a first preset ratio. If the total number of projectable points is greater than the second preset number and the ratio of the second number to the total number of sampling points is greater than the first preset ratio, it is determined that a weld seam exists in the target two-sided structure, that is, a weld seam exists between the two planes of the target two-sided structure. Otherwise, it is determined that no weld seam exists in the target two-sided structure; that is, if the total number of projectable points is not greater than the second preset number, or if the ratio of the second number to the total number of sampling points is not greater than the first preset ratio, it is determined that no weld seam exists between the two planes of the target two-sided structure.
[0164] Optionally, after determining the multiple sampling points and projectable points, for each sampling point, a projectable point within a range with a third preset distance as a radius of the sampling point can be found, and it can be determined whether the number of projectable points found is greater than the first preset number. If it is greater, the flag of the sampling point is set to 1. Thereafter, the following judgment can be made: the number of projectable points ≥ the preset number 1 and the number of sampling points with a flag of 1 / the total number of sampling points ≥ the preset ratio 1. If the above conditions are met, it is determined that there is a welded seam between plane 1 and plane 2 (i.e., the two planes in the target two-sided structure). The above conditions indicate that there are a large number of points that can be projected between the two planes, and these points are generated by the weld, indicating that there is a welded seam between the planes. If the above conditions are not met, it is determined that there is no welded seam between the two planes.
[0165] In this embodiment, the plane information set can be updated during the analysis of whether a weld seam exists. Initially, the plane information set indicates that none of the planes in the plane list is marked as a weld plane, that is, initially, none of the planes in the plane list is considered a weld plane. For example, an array is set as the plane information set, and initially, all elements in the array are 0. An element of 0 indicates that the corresponding plane is not considered a weld plane, and an element of 1 indicates that the corresponding plane is considered a weld plane. The element represents a weld plane flag.
[0166] Please refer to Figure 13 , Figure 13 This is a second flow chart of the weld identification method provided in an embodiment of the present application. In this embodiment, the method may further include steps S510 to S520. The plane information set may be updated through steps S510 to S520.
[0167] Step S510 : For each plane to be analyzed, obtain by counting a third number of projectable points in the plane point cloud corresponding to the plane to be analyzed.
[0168] Step S520: If the ratio of the third number to the total number of point cloud points in the plane point cloud corresponding to the plane to be analyzed is greater than a second preset ratio, it is determined that the plane to be analyzed is a welding plane.
[0169] In this embodiment, each plane to be analyzed may be determined first. The plane to be analyzed is each plane in the plane list other than the two planes in the target two-sided structure that is not currently considered as a welding plane.
[0170] After determining the projectable points in other point clouds through sub-step S355, the third number of projectable points in the plane point cloud corresponding to the plane to be analyzed in the target point cloud can be statistically obtained for each plane to be analyzed. Then, the ratio of the third number corresponding to the plane to be analyzed to the total number of point cloud points in the plane point cloud corresponding to the plane to be analyzed is calculated, and it is determined whether the calculated ratio is greater than the second preset ratio. The second preset ratio can be determined in combination with actual needs, for example, it is set to 0.8. If the calculated ratio is greater than the second preset ratio, the plane to be analyzed is determined to be a welding plane, that is, the plane to be analyzed is marked as a welding plane. If the calculated ratio is not greater than the second preset ratio, the plane to be analyzed is not determined to be a welding plane, that is, the plane to be analyzed is not marked as a welding plane.
[0171] Please refer again Figure 13 In this embodiment, the method may further include step S600.
[0172] Step S600: Delete the plane pair information corresponding to the two-side structure including the welding plane in the first plane pair information set to obtain a second plane pair information set, and save the current plane information set.
[0173] In this embodiment, after obtaining the first plane pair information set, the first plane pair information can be corrected according to the current plane information set, and the correction method is to delete the plane pair information corresponding to the two-sided structure including the welding plane in the first plane pair information to obtain the second plane pair information. That is, when a plane in a plane pair (i.e., a two-sided structure) is marked as a welding plane, the plane pair in the first plane pair information set is deleted, because the required plane pair must be a plane from the workpiece, and all plane pairs containing welding planes need to be deleted. The second plane pair information set contains the identification results of all welded welds. The current plane information set can also be saved to provide information for subsequent welding. The plane information in the plane information set is used to indicate whether the plane in the plane list is a welding plane.
[0174] Optionally, the plane information may also include: the identifiers of the two planes of the two-sided structure; the direction vector, starting point, and end point of the theoretical intersection line of the two-sided structure; the convexity of the two-sided structure; and a weld mark between the two planes of the two-sided structure. The weld mark indicates whether a weld exists between the two planes. For example, a value of 0 for the convexity indicates convexity; a value of 1 for the convexity indicates concaveness. A value of 1 for the weld mark indicates the presence of a weld; a value of 0 for the weld mark indicates the absence of a weld. This facilitates providing more information.
[0175] Please refer to Figure 14 , Figure 14 The process diagram of the weld seam identification of the target workpiece provided in the embodiment of the present application is as follows. Figure 14 , the execution process of the above-mentioned weld identification method is illustrated by examples.
[0176] The input is TCP points, a list of planes, and unassigned points in the point cloud. Unassigned points are points that are not assigned to any plane. For an input point cloud, plane detection is first performed to obtain a list of planes and unassigned points in the current point cloud (i.e., the target point cloud).
[0177] ① Initialize an empty array 1, namely plane_weld_infor. Plane_weld_infor is used to store the intersecting plane pair structure (i.e., plane pair information). An intersecting plane pair structure can contain the following information: the labels of planes 1 and 2, the direction vector, starting point, and end point of the theoretical intersection line between planes 1 and 2, the concave-convexity of the two-surface structure formed by planes 1 and 2, and the weld seam flag between planes 1 and 2. Also initialize an array 2 of all zeros, namely weld_plane. weld_plane is a 2-value array whose size is the same as the plane list. Its element value is 0 or 1. 0 indicates that the corresponding plane is not a welded plane, and 1 indicates that the plane is a welded plane. Array 2 stores the weld plane flag of the corresponding plane.
[0178] ② Use i to traverse the plane list and determine whether i is less than the plane list size. If i is not less than the plane list size, the algorithm ends. If i is less than the plane list size, determine whether the weld plane flag bit of plane i is 1. If the weld plane flag bit of plane i is 1, jump to the step of increasing i. If the weld plane flag bit of plane i is not 1, proceed to the next step ③. Because once a plane is already a weld plane, it no longer participates in subsequent calculations.
[0179] ③ Use j to traverse the plane list, starting at i+1, and determine whether j is less than the plane list size. If j is not less than the plane list size, jump to the step of increasing i. If j is less than the plane list size, determine whether the welding plane flag bit of plane j is 1. If the welding plane flag bit of plane j is 1, jump to the step of increasing j. If the welding plane flag bit of plane j is not 1, determine whether there is an intersection between planes i and j. If there is no intersection, jump to the step of increasing j. If there is an intersection, proceed to the next step ④.
[0180] ④ Calculate the theoretical intersection line of planes i and j. Enter the intersection direction vector t, the starting point, and the end point into weld_infor_ij, which is the intersecting plane pair structure. Perform a dihedral split on planes i and j to obtain the split planes i and j. Dihedral splitting utilizes TCP, retaining the points on each plane that lie on the TCP side.
[0181] ⑤ Determine whether the concavity of planes i and j after segmentation is convex. If so, set the convexity flag in weld_infor_ij to 0 and the welded seam flag to 0, then jump to the step of adding j. If concave, determine whether there is a weld between planes i and j. In this step, the welded plane flag is also updated. If the result is that a weld exists between the two planes, set the convexity flag in weld_infor_ij to 1 and the welded seam flag to 1. If the result is that there is no weld between the two planes, set the convexity flag in weld_infor_ij to 1 and the welded seam flag to 0. Store weld_infor_ij in plane_weld_infor.
[0182] ⑥ Repeat the above i and j traversal process until completion. After the traversal is complete, the contents of plane_weld_infor can be corrected based on the weld plane flag. When a plane in a plane pair is marked as a weld plane, the plane pair in plane_weld_infor is deleted. The corrected plane_weld_infor now contains the identification results of all welded seams.
[0183] In this embodiment, it can be determined whether there is a welded seam between each two-sided structure in the workpiece. If so, the welded seam flag of the two-sided structure is 1; if not, the welded seam flag of the two-sided structure is 0.
[0184] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a weld identification device 200 is given below. Optionally, the weld identification device 200 can adopt the above Figure 1 The device structure of the electronic device 100 is shown in FIG. Figure 15 , Figure 15 This is a block diagram of a weld identification device 200 provided in an embodiment of the present application. It should be noted that the basic principles and technical effects of the weld identification device 200 provided in this embodiment are the same as those in the aforementioned embodiments. For the sake of brevity, any details not mentioned in this embodiment are referred to the corresponding contents in the aforementioned embodiments. In this embodiment, the weld identification device 200 may include: a list acquisition module 210 and an analysis module 220.
[0185] The list obtaining module 210 is used to obtain a plane list based on the target point cloud of the target workpiece.
[0186] The analysis module 220 is configured to determine a target two-surface structure to be analyzed based on the plane list. The target two-surface structure is a structure formed by two planes having a theoretical intersection line in the target workpiece, and the two planes in the target two-surface structure have not been used to form a two-surface structure in the weld identification process.
[0187] The analysis module 220 is further configured to analyze, based on the target point cloud, whether there is a weld seam between two planes of the target two-sided structure, so as to obtain plane pair information corresponding to the target two-sided structure. The plane pair information is used to indicate whether there is a weld seam in the corresponding target two-sided structure.
[0188] The analysis module 220 is further configured to repeat the determination of the target two-surface structure and the weld analysis until the target two-surface structure cannot be determined, thereby obtaining a first plane pair information set of the target workpiece. The first plane pair information set includes plane pair information corresponding to each determined two-surface structure.
[0189] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in FIG. 110 or the operating system (OS) of the electronic device 100 may be fixed and may be used by Figure 1 Meanwhile, the data, program codes, etc. required to execute the above modules may be stored in the memory 110.
[0190] An embodiment of the present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the weld identification method is implemented.
[0191] In summary, the embodiments of the present application provide a weld identification method, device, electronic device and readable storage medium. First, a plane list is obtained based on the target point cloud of the target workpiece; then, a target two-sided structure to be analyzed is determined based on the plane list. The target two-sided structure is a structure composed of two planes with theoretical intersection lines in the target workpiece currently determined, and the two planes in the target two-sided structure have not been used to form a two-sided structure in the weld identification process that has been performed; then, whether there is a welded weld between the two planes in the target two-sided structure is analyzed based on the target point cloud to obtain the plane pair information corresponding to the target two-sided structure; thereafter, the above-mentioned determination of the target two-sided structure and the weld analysis are repeated until the target two-sided structure cannot be determined, and the first plane pair information set of the target workpiece is obtained. The first plane pair information set includes the plane pair information corresponding to each determined two-sided structure. In this way, the welded welds in the target workpiece can be identified to provide important information for subsequent robot automatic welding, thereby reducing repeated welding.
[0192] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0193] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0194] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0195] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A weld identification method, characterized in that: The method comprises: Obtain a plane list based on the target point cloud of the target workpiece; Determining a target two-surface structure to be analyzed based on the plane list, wherein the target two-surface structure is a structure composed of two planes having a theoretical intersection line in the currently determined target workpiece, and the two planes in the target two-surface structure have not been used to form a two-surface structure in a previous weld recognition process; Analyzing whether there is a weld seam between two planes of the target two-sided structure according to the target point cloud to obtain plane pair information corresponding to the target two-sided structure, wherein the plane pair information is used to indicate whether there is a weld seam in the corresponding target two-sided structure; Repeat the determination of the target two-surface structure and the weld analysis until the target two-surface structure cannot be determined, thereby obtaining a first plane pair information set of the target workpiece, wherein the first plane pair information set includes plane pair information corresponding to each determined two-surface structure.
2. The method according to claim 1, characterized in that The two planes in the target two-sided structure are structural planes, and the analyzing whether there is a weld between the two planes of the target two-sided structure according to the target point cloud to obtain plane pair information corresponding to the target two-sided structure includes: Analyze and obtain the concavity and convexity of the target two-surface structure; When the concavity and convexity of the target two-sided structure is concave, for each structural surface of the target two-sided structure, according to a plane point cloud corresponding to the target point cloud and a theoretical intersection line of the structural surface in the target two-sided structure, determining an edge point in the plane point cloud that is located near the theoretical intersection line; Determine the edge straight line segment corresponding to the structural surface according to the edge point corresponding to the structural surface; According to the obtained two edge straight line segments, it is determined whether there is a welded seam in the target two-surface structure.
3. The method according to claim 2, characterized in that For each structural surface of the target two-sided structure, determining edge points in the plane point cloud located near the theoretical intersection line according to the plane point cloud corresponding to the target point cloud and the theoretical intersection line in the two-sided structure, includes: For each point cloud point in the planar point cloud of the structural surface, if it is not determined whether the point cloud point is an edge point, a neighborhood point set of the point cloud point is determined from the planar point cloud of the structural surface; Traversing the neighborhood points in the neighborhood point set, and determining whether a first line connecting the point cloud point and the currently traversed neighborhood point is perpendicular to the theoretical intersection line, wherein the end point of the first line is the currently traversed neighborhood point; If the first connecting line is perpendicular to the theoretical intersection line, determining whether the first connecting line points to the negative direction of a second coordinate axis, wherein the second coordinate axis is perpendicular to the theoretical intersection line and the target normal of the structural surface, and the positive direction of the second coordinate axis points to the theoretical intersection line; If the first connecting line points to the negative direction of the second coordinate axis, it is determined that the neighborhood point is not an edge point.
4. The method according to claim 3, characterized in that For each structural surface of the target two-sided structure, determining edge points in the plane point cloud located near the theoretical intersection line according to the plane point cloud corresponding to the target point cloud and the theoretical intersection line in the two-sided structure, further comprising: If the first connecting line does not point to the negative direction of the second coordinate axis, determining whether the first connecting line points to the positive direction of the second coordinate axis and a projection length of the first connecting line on the second coordinate axis is greater than a preset projection length; If the first connecting line points to the positive direction of the second coordinate axis and the projection length on the second coordinate axis is greater than the preset projection length, it is determined that the point cloud point is not an edge point, and the traversal of the neighborhood points of the point cloud point is stopped; otherwise, the traversal of the neighborhood points in the neighborhood point set is continued; If it is still not certain that the point cloud point is not an edge point after all the neighborhood points of the point cloud point have been traversed, the point cloud point is determined to be an edge point.
5. The method according to claim 2, characterized in that The step of determining the edge straight line segment corresponding to the structural surface according to the edge point corresponding to the structural surface includes: Calculating a first distance between each edge point in the structural surface and the theoretical intersection line; determining a target distance according to the obtained first distance; Determine, from the edge points of the structural surface, an edge point whose corresponding first distance is close to the target distance as a target edge point; Calculate the edge centroid of the determined target edge point; Determining a target straight line according to the edge centroid and the direction of the theoretical intersection line; Point cloud points located near the target straight line in the plane point cloud of the structural surface are projected onto the target straight line to obtain edge straight line segments corresponding to the structural surface.
6. The method according to claim 5, characterized in that Determining the target distance according to the obtained first distance includes: Sort the first distances obtained in descending order to obtain a distance array; Determining whether a plurality of edge points corresponding to the plurality of first distances are continuous based on whether a plurality of first distances in consecutive positions in the distance array meet a preset continuity condition, so as to determine whether a starting point of a continuous edge has been found, wherein the preset continuity condition indicates that a distance difference between two first distances whose sorted positions differ by a preset number of positions is less than a first preset distance; When the starting point of the continuous edge is determined, the target distance is determined according to the first distance corresponding to the starting point of the continuous edge; If it is determined that the starting point of the continuous edge is not found, the last first distance in the distance array is used as the target distance.
7. The method according to claim 6, characterized in that The determining whether a plurality of edge points corresponding to the plurality of first distances are continuous based on whether the plurality of first distances in the distance array satisfy a preset continuity condition, so as to determine whether a starting point of a continuous edge is found, includes: Traverse the distance array and set the current consecutive times to 0; For the first distance to be analyzed currently traversed, determine a second distance to be analyzed based on the first distance to be analyzed and the current consecutive number, and determine a third distance to be analyzed based on the second distance to be analyzed and the preset number of positions, and determine whether the distance difference between the second distance to be analyzed and the third distance to be analyzed is greater than the first preset distance, wherein the difference in the number of positions of the first distance to be analyzed and the second distance to be analyzed in the distance array is equal to the current consecutive number; If the distance difference is greater than the first preset distance, determining that the current continuity flag indicates discontinuity, and updating the next first distance of the second distance to be analyzed in the distance array to the first distance to be analyzed currently traversed; If the distance difference is not greater than the first preset distance, determining that the current continuous flag indicates continuity, updating the current continuous number, and if the updated current continuous number is less than the preset continuous number, performing the step of determining the second distance to be analyzed based on the first distance to be analyzed and the current continuous number again; When the current continuous number is not less than the preset continuous number, if the current continuous flag indicates continuous, the edge point corresponding to the current first distance to be analyzed is used as the starting point of the continuous edge; When the current continuous number is not less than the preset continuous number, if the current continuous flag indicates discontinuity, the next first distance of the second distance to be analyzed in the distance array is updated to the first distance to be analyzed currently traversed; If the current continuous flag indicates discontinuity when the distance array is traversed, it is determined that the starting point of the continuous edge is not found.
8. The method according to claim 2, characterized in that The step of judging whether there is a weld seam in the target two-surface structure based on the two obtained edge straight line segments includes: Calculating a second distance between the two edge straight line segments; Determining whether the second distance is less than a second preset distance; If the second distance is less than the second preset distance, it is determined that no weld seam exists in the target two-surface structure.
9. The method according to claim 8, characterized in that The step of determining whether the weld in the target two-surface structure is a welded weld based on the two obtained edge straight line segments further includes: If the second distance is not less than the second preset distance, determining a projection plane based on the straight line on which the two edge straight line segments lie; Determining projectable points in other point clouds, wherein the other point clouds are point clouds in the target point cloud excluding the plane point cloud corresponding to the target two-face structure, the projectable points are located near the projection plane, and the projection points on the projection plane are between the two obtained edge straight line segments; Determining a plurality of sampling points within the quadrilateral formed by the two edge straight line segments; For each sampling point, determine whether a first number corresponding to the sampling point is greater than a first preset number, wherein the first number is the number of projectable points among the determined projectable points whose distance from the sampling point is less than a third preset distance; Counting a second number of sampling points corresponding to the first number and obtaining a second number that is greater than the first preset number; If the total number of projectable points is greater than a second preset number and the ratio of the second number to the total number of sampling points is greater than a first preset ratio, it is determined that there are welded welds in the target two-sided structure; otherwise, it is determined that there are no welded welds in the target two-sided structure.
10. The method according to claim 9, characterized in that After determining the projectable points in other point clouds, the method further includes: For each plane to be analyzed, obtaining by counting a third number of projectable points in the plane point cloud corresponding to the plane to be analyzed, wherein the plane to be analyzed is each plane in the plane list other than the two planes in the target two-sided structure that is not currently considered as a welding plane, and initially, each plane in the plane list is not considered as a welding plane; If the ratio of the third number to the total number of point cloud points in the plane point cloud corresponding to the plane to be analyzed is greater than a second preset ratio, it is determined that the plane to be analyzed is a welding plane.
11. The method according to claim 10, characterized in that Determining a target two-surface structure to be analyzed based on the plane list includes: Determine from the plane list two planes that are not currently marked as welding planes to form an initial two-plane structure; Whether to use the initial two-surface structure as a target two-surface structure is determined according to whether a theoretical intersection line exists between two planes in the initial two-surface structure.
12. The method according to claim 10, characterized in that The method further comprises: Deleting the plane pair information corresponding to the two-surface structure including the welding plane in the first plane pair information set to obtain a second plane pair information set, and saving the current plane information set, wherein the plane information in the plane information set is used to indicate whether the plane in the plane list is a welding plane; and / or, When the concavity and convexity of the target two-surface structure is convex, it is determined that no weld seam exists in the target two-surface structure.
13. A weld identification device, characterized in that: The device comprises: A list acquisition module is used to obtain a plane list based on a target point cloud of a target workpiece; an analysis module, configured to determine a target two-surface structure to be analyzed based on the plane list, wherein the target two-surface structure is a structure composed of two planes having a theoretical intersection line in the currently determined target workpiece, and the two planes in the target two-surface structure have not been used to form a two-surface structure in a previous weld recognition process; The analysis module is further configured to analyze, based on the target point cloud, whether there is a weld seam between two planes of the target two-sided structure, so as to obtain plane pair information corresponding to the target two-sided structure, wherein the plane pair information is used to indicate whether there is a weld seam in the corresponding target two-sided structure; The analysis module is also used to repeat the determination of the target two-sided structure and the weld analysis until the target two-sided structure cannot be determined, and a first plane pair information set of the target workpiece is obtained, wherein the first plane pair information set includes plane pair information corresponding to each determined two-sided structure.
Citation Information
Cited By
Welding seam identification method, device and equipment based on point cloud geometric analysis
CN121147223A