Weld joint identification method and device, electronic equipment and storage medium

By using connectivity domain division and Plato stereoscopic shape model in Hough transform linear detection, combining least squares fitting and endpoint recognition, the computational complexity and noise-sensitive problems in traditional methods are solved, and the accuracy of weld recognition is improved and robustness.

CN119107295APending Publication Date: 2024-12-10FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411130494.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Traditional Hough transform linear detection is complex in large-scale point cloud data, sensitive to noise and outliers, and difficult to select parameters, resulting in misdetection and missed detection.

Method used

By obtaining the straight edge points of the point cloud to be detected, dividing the connection domain, conducting straight lines detection and merging for each connected area, using the Plato three-dimensional shape model to reduce noise sensitivity, using the least squares method to fit straight lines, and combining endpoint recognition to improve noise Weld recognition accuracy.

Benefits of technology

It improves the accuracy and robustness of weld recognition, reduces the calculation complexity and subjectivity of parameter selection, and reduces the impact on noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119107295A_ABST
    Figure CN119107295A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a welding seam identification method and device, electronic equipment and a storage medium, and relates to the field of data processing, and the method comprises the steps: obtaining linear edge points of a to-be-detected point cloud, carrying out the connected domain division of the linear edge points, obtaining a plurality of connected regions, carrying out the linear detection of each connected region, obtaining a plurality of to-be-detected straight lines, and obtaining a plurality of to-be-detected straight lines; and merging the to-be-detected straight lines to obtain the target straight line, performing endpoint identification on the target straight line to obtain the first endpoint and the second endpoint, and obtaining the welding seam of the to-be-detected point cloud based on the first endpoint and the second endpoint, thereby improving the accuracy of welding seam identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a weld identification method, device, electronic equipment and storage medium. Background Art

[0002] Hough transform line detection is a method for finding parametric shapes. Unlike other shape detection algorithms, it detects the parameters of lines directly on the point cloud. It does this by discretizing all possible parameters of lines in space and allowing each point to vote for the line it belongs to in this parameter space. Draw a regular grid on the point cloud in a two-dimensional plane, with the horizontal axis as the angle and the vertical axis as the length. Set the step size and transform the point cloud from the y=kx+b space to the Hough space according to the formula ρ=x*cosθ+y*sinθ:

[0003] Some disadvantages of traditional Hough transform line detection: Traditional Hough transform methods require discretization in parameter space, which may lead to high computational complexity. For large-scale point cloud data, especially in high-dimensional parameter space, the computational cost may be very high. Due to the discretization process, the traditional Hough transform is sensitive to noise or outliers. Noise points may generate additional votes in the parameter space, resulting in false detection or sensitivity to noise points. In the traditional Hough transform, parameters such as step size, threshold, etc. need to be manually selected. The selection of these parameters may become difficult due to different data sets, and different parameter selections may lead to different detection results. In the traditional method, the line parameters are determined by local maximum points, but this method is easily affected by noise or dense line segments, which may lead to missed detection or false detection. Summary of the invention

[0004] The object of the present invention is to provide a weld identification method, device, electronic device and storage medium, which can improve the accuracy of weld identification.

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

[0006] In a first aspect, an embodiment of the present application provides a weld identification method, the method comprising:

[0007] Get the straight line edge points of the point cloud to be detected;

[0008] Divide the straight line edge points into connected domains to obtain multiple connected regions;

[0009] Performing straight line detection on each of the connected areas to obtain a plurality of straight lines to be detected;

[0010] Merging the straight lines to be detected to obtain a target straight line;

[0011] Performing endpoint recognition on the target straight line to obtain a first endpoint and a second endpoint;

[0012] A weld of the point cloud to be detected is obtained based on the first endpoint and the second endpoint.

[0013] Optionally, the step of performing straight line detection on each of the connected regions to obtain a plurality of straight lines to be detected includes:

[0014] For each connected region, mapping a first edge point set in the connected region to a Platonic solid shape model, and obtaining a plurality of discrete points satisfying a straight line condition from the Platonic solid shape model;

[0015] Based on the discrete points, a plurality of first straight lines are obtained;

[0016] The plurality of first straight lines are fitted by the least square method to obtain a plurality of straight lines to be detected corresponding to each of the connected regions.

[0017] Optionally, for each connected region, mapping the first edge point set in the connected region to a Platonic solid shape model, and obtaining a plurality of discrete points satisfying a straight line condition from the Platonic solid shape model comprises:

[0018] For each connected area, the first edge point set in the connected area is mapped to the Platonic solid shape model, the discrete point with the largest number of votes is obtained as the target discrete point, and the first edge point corresponding to the target discrete point is obtained, wherein each of the connected areas corresponds to each first edge point set, the first edge point set includes multiple edge points, the Platonic solid shape model includes multiple discrete points, and the target discrete point indicates a discrete point with the largest number of edge points less than a preset threshold value in the distance between each of the discrete points and each point in the first edge point set;

[0019] Acquire first straight line parameters corresponding to the target discrete points and first edge points corresponding to the target discrete points;

[0020] Based on the first straight line parameters, construct a first straight line, wherein the first edge point set includes each of the first edge points;

[0021] Removing each of the first edge points from the corresponding first edge point set to obtain a second edge point set;

[0022] The second edge points are aggregated into the Platonic solid shape model, and the discrete points with the most votes are obtained as new target discrete points;

[0023] Acquire the second straight line parameters corresponding to the new target discrete points and the second edge points corresponding to the new target discrete points;

[0024] Based on the second straight line parameter, construct a first straight line;

[0025] Removing each second edge point from the second edge point set to obtain a third edge point set;

[0026] Projecting the third edge point set into the Platonic solid shape model, obtaining the discrete point with the most votes as a new target discrete point, until the number of points in the latest edge point set meets the preset number of points, thereby obtaining a plurality of target discrete points;

[0027] The straight line parameters corresponding to each target discrete point are obtained to obtain a plurality of first straight lines.

[0028] Optionally, the step of merging the straight lines to be detected to obtain a target straight line includes:

[0029] Determine the straight line direction vector corresponding to each of the straight lines to be detected;

[0030] For each of the straight line direction vectors, calculating the angle between the straight line direction vector and each first straight line direction vector other than the straight line direction vector;

[0031] Comparing each of the angles with a preset angle;

[0032] Acquire target angles that are less than or equal to the preset angle;

[0033] Obtaining the straight lines to be detected corresponding to the target angles;

[0034] Merging the straight lines to be detected corresponding to the target angles to obtain second straight lines;

[0035] A second straight line having the largest number of edge points among the second straight lines is obtained as a target straight line.

[0036] Optionally, the step of performing endpoint recognition on the target straight line to obtain a first endpoint and a second endpoint includes:

[0037] Determine each target edge point corresponding to the target straight line;

[0038] Determine the point with the longest distance from each target edge point as the first endpoint based on the shortest path algorithm;

[0039] The first endpoint is used as a starting point, and the point farthest from each target edge point based on the shortest path algorithm is used as a second endpoint.

[0040] Optionally, the step of dividing the straight line edge points into connected domains to obtain a plurality of connected regions includes:

[0041] For each of the straight line edge points, calculate the distance between the straight line edge point and the straight line edge points other than the straight line edge point;

[0042] comparing the distance to a preset distance;

[0043] Determine the straight line edge points greater than the preset distance as the first connected area;

[0044] The straight line edge points that are less than or equal to the preset distance are determined as the second connected area.

[0045] In a second aspect, an embodiment of the present application provides a weld identification device, the device comprising:

[0046] An acquisition module is used to acquire straight line edge points of the point cloud to be detected;

[0047] A division module, used for dividing the straight line edge points into connected domains to obtain multiple connected regions;

[0048] A straight line detection module, used for performing straight line detection on each of the connected areas to obtain a plurality of straight lines to be detected;

[0049] A fitting module, used for merging the straight lines to be detected to obtain a target straight line;

[0050] An identification module, used for performing endpoint identification on the target straight line to obtain a first endpoint and a second endpoint;

[0051] A determination module is used to obtain the weld of the point cloud to be detected based on the first endpoint and the second endpoint.

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

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

[0054] This application has the following beneficial effects:

[0055] The present application obtains straight line edge points of a point cloud to be detected, divides the straight line edge points into connected domains to obtain multiple connected areas, performs straight line detection on each connected area to obtain multiple straight lines to be detected, merges the straight lines to be detected to obtain a target straight line, performs endpoint recognition on the target straight line to obtain a first endpoint and a second endpoint, and obtains a weld of the point cloud to be detected based on the first endpoint and the second endpoint, thereby improving the accuracy of weld recognition. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0058] Figure 2 One of the flow charts of a weld identification method provided by an embodiment of the present invention;

[0059] Figure 3 A second flow chart of a weld identification method provided by an embodiment of the present invention;

[0060] Figure 4 A third flow chart of a weld identification method provided by an embodiment of the present invention;

[0061] Figure 5 A fourth flow chart of a weld identification method provided by an embodiment of the present invention;

[0062] Figure 6 A fifth flow chart of a weld identification method provided by an embodiment of the present invention;

[0063] Figure 7 A structural block diagram of a weld identification device provided in an embodiment of the present invention. DETAILED DESCRIPTION

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

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

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

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

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

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

[0070] After extensive research, the inventors found that Hough transform line detection is a method for finding parametric shapes. Unlike other shape detection algorithms, it detects the parameters of the line directly on the point cloud. This is achieved by discretizing all possible parameters of the line in space and allowing each point to vote for the line it belongs to in this parameter space. Draw a regular grid of the point cloud in a two-dimensional plane, with the horizontal axis as the angle and the vertical axis as the length. Set the step size and convert the point cloud from the y=kx+b space to the Hough space according to the formula ρ=x*cosθ+y*sinθ: The intercept-type line equation often intersects at one point. In order to avoid the situation where the slope is infinite, polar coordinates are used to represent the line. The principle is similar and they will intersect at one point. Usually, points are discrete points and cannot intersect at one point completely. Therefore, it is necessary to find the local maximum point, solve the length value corresponding to each point and each angle step, calculate which grid it belongs to, calculate all points, accumulate the values ​​in the grid, count each grid, and if the number of points in the grid is greater than the number of points in the 8-neighborhood grids, the grid is considered to be an extreme point. At the same time, a threshold is set. If the minimum number of points in the grid is greater than it, it can be judged as an extreme point.

[0071] Some disadvantages of traditional Hough transform line detection: Traditional Hough transform methods require discretization in parameter space, which may lead to high computational complexity. For large-scale point cloud data, especially in high-dimensional parameter space, the computational cost may be very high. Due to the discretization process, the traditional Hough transform is sensitive to noise or outliers. Noise points may generate additional votes in the parameter space, resulting in false detection or sensitivity to noise points. In the traditional Hough transform, parameters such as step size, threshold, etc. need to be manually selected. The selection of these parameters may become difficult due to different data sets, and different parameter selections may lead to different detection results. In the traditional method, the line parameters are determined by local maximum points, but this method is easily affected by noise or dense line segments, which may lead to missed detection or false detection.

[0072] In view of the discovery of the above problems, the present embodiment provides a weld identification method, device, electronic device and storage medium, which can obtain the straight line edge points of the point cloud to be detected, divide the straight line edge points into connected domains, obtain multiple connected areas, perform straight line detection on each connected area to obtain multiple straight lines to be detected, merge the straight lines to be detected to obtain a target straight line, perform endpoint identification on the target straight line to obtain a first endpoint and a second endpoint, obtain the weld of the point cloud to be detected based on the first endpoint and the second endpoint, and improve the accuracy of weld identification. The solution provided in this embodiment is elaborated in detail below.

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

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

[0075] The electronic device 100 includes a weld identification device 110 , a memory 120 and a processor 130 .

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

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

[0078] Please refer to Figure 2 , Figure 2 For application Figure 1 A flow chart of a weld identification method of an electronic device 100 is provided, and the method including each step is described in detail below.

[0079] S201: Obtain straight line edge points of the point cloud to be detected.

[0080] S202: Divide the straight line edge points into connected domains to obtain multiple connected regions.

[0081] S203: Perform straight line detection on each connected area to obtain a plurality of straight lines to be detected.

[0082] S204: Merge the straight lines to be detected to obtain a target straight line.

[0083] S205: Perform endpoint recognition on the target straight line to obtain a first endpoint and a second endpoint.

[0084] S206: Obtain the weld of the point cloud to be detected based on the first endpoint and the second endpoint.

[0085] The first point cloud to be spliced ​​can be divided into multiple connected domains by using a region growing or Euclidean clustering algorithm. The straight line edge points of the point cloud to be detected can be divided into multiple connected regions. Line detection is performed in the multiple connected regions respectively, and multiple straight lines to be detected are obtained in each connected region.

[0086] There are many ways to implement straight line detection for each connected area to obtain multiple straight lines to be detected. In one implementation method: for each connected area, the first edge point set in the connected area is mapped to a Platonic solid shape model, and multiple discrete points that meet the straight line conditions are obtained from the Platonic solid shape model. Based on each discrete point, multiple first straight lines are obtained, and the multiple first straight lines are fitted by least squares method to obtain multiple straight lines to be detected corresponding to each connected area.

[0087] In one example, in order to improve the accuracy of straight line fitting, when determining multiple straight lines to be detected in each connected area, for each straight line to be detected, a set of edge points on the straight line to be detected is determined, the distance between each point in the edge point set and the straight line to be detected is calculated, and edge points greater than a preset distance are eliminated, and the straight lines to be detected after the edge points are eliminated are merged.

[0088] A Platonic solid shape model is used to obtain multiple discrete points that meet the straight line condition from each connected area. Compared with the manual selection of parameter step size, the discretization of the Platonic solid shape model can cover the entire parameter space more evenly and reduce the subjectivity of manual parameter selection.

[0089] The use of Platonic solid shape models reduces the sensitivity to noise. Platonic shape models provide a more ordered and structured discretization method, which helps to suppress the impact of noise on the parameter space. In general, the use of the discretization space of Platonic solid shape models can improve the robustness and efficiency of the Hough transform method in line detection.

[0090] Line detection is performed in each connected area, and multiple first straight lines are obtained in each connected domain. The least squares method is used for fitting to obtain the straight line to be detected. The straight lines to be detected corresponding to each connected area are merged. The straight lines to be detected can be merged based on the straight line direction vectors corresponding to each straight line to be detected to obtain a target straight line, and finally the weld is identified from the target straight line.

[0091] For each connected region, the first edge point set in the connected region is mapped to the Platonic solid shape model. There are many ways to obtain multiple discrete points that meet the straight line condition from the Platonic solid shape model. In one implementation, Figure 3 As shown, the following steps are included:

[0092] S301: For each connected region, map the first edge point set in the connected region to a Platonic solid shape model, obtain the discrete point with the largest number of votes as the target discrete point, and obtain the first edge point corresponding to the target discrete point.

[0093] Among them, each connected area corresponds to each first edge point set, the first edge point set includes multiple edge points, the Platonic solid shape model includes multiple discrete points, and the target discrete point indicates the discrete point with the largest number of edge points less than a preset threshold in the distance between each discrete point and each point in each first edge point set.

[0094] S302: Obtain first straight line parameters corresponding to the target discrete point and first edge points corresponding to the target discrete point.

[0095] S303: constructing a first straight line based on the first straight line parameters.

[0096] The first edge point set includes each first edge point.

[0097] S304: removing each first edge point from the corresponding first edge point set to obtain a second edge point set.

[0098] S305: Aggregate the second edge points into the Platonic solid shape model, and obtain the discrete point with the most votes as a new target discrete point.

[0099] S306: Obtain the second straight line parameters corresponding to the new target discrete point and each second edge point corresponding to the new target discrete point.

[0100] S307: Constructing a first straight line based on the second straight line parameters.

[0101] S308: Remove each second edge point from the second edge point set to obtain a third edge point set.

[0102] S309: Projecting the third edge point set into the Platonic solid shape model, obtaining the discrete point with the most votes as a new target discrete point, until the number of points in the latest edge point set meets the preset number of points, and obtaining multiple target discrete points.

[0103] S310: Obtain straight line parameters corresponding to each target discrete point to obtain a plurality of first straight lines.

[0104] For each connected area, the first edge point set in each connected area is mapped to the Platonic solid shape model, and multiple first straight lines in each connected area are obtained from the Platonic solid shape model through continuous iteration.

[0105] Specifically, in each iteration, the edge point corresponding to the determined target discrete point is deleted from the first edge point set corresponding to the connected area, and the number of edge points in the second edge point set after the edge point is deleted is determined, and the ratio of the number of edge points in the second edge point set to the number of edge points in the first edge point set is calculated. If the ratio of the number of edge points in the second edge point set to the number of edge points in the first edge point set is greater than a preset ratio, the second edge point set after the edge point is deleted is projected again onto the Platonic solid shape model to obtain a new target discrete point with the most votes, and the edge point corresponding to the new target discrete point is deleted from the second edge point set to obtain a third edge point set, and the ratio of the number of edge points in the third edge point set to the number of edge points in the first edge point set is calculated. If the ratio of the number of edge points in the third edge point set to the number of edge points in the first edge point set is less than the preset ratio, the step of obtaining the first straight line in the connected area is terminated, the straight line parameters of the target discrete point are determined to obtain the first straight line, the straight line parameters corresponding to the new target discrete point are determined to form the first straight line, and the first straight line corresponding to the target discrete point and the first straight line corresponding to the new target discrete point are fitted by the least squares method to obtain the straight line to be detected.

[0106] In one example, when the ratio of the number of edge points in a certain latest edge point set to the number of edge points in the first edge point set is less than a preset ratio, the iteration is terminated.

[0107] In another example, if the number of edge points in a certain latest edge point set is less than a preset number of points, the iteration is terminated.

[0108] The straight line parameters corresponding to the target discrete points obtained in each iteration are obtained, wherein the straight line parameters include an anchor point on the straight line and a direction vector of the straight line, and the corresponding first straight line is obtained based on the anchor point on the straight line and the direction vector of the straight line.

[0109] There are many ways to merge the lines to be detected to obtain the target line. In one implementation, Figure 4 As shown, the following steps are included:

[0110] S401: Determine the straight line direction vector corresponding to each straight line to be detected.

[0111] S402: For each straight line direction vector, calculate the angle between the straight line direction vector and each first straight line direction vector other than the straight line direction vector.

[0112] S403: Compare each angle with a preset angle.

[0113] S404: Acquire target angles that are less than or equal to a preset angle.

[0114] S405: Obtain the straight lines to be detected corresponding to each target angle.

[0115] S406: Merge the straight lines to be detected corresponding to the target angles to obtain second straight lines.

[0116] S407: Obtain the second straight line with the largest number of edge points among the second straight lines as the target straight line.

[0117] A number of lines to be detected are obtained, and the line direction vectors of each detected line are calculated. The lines to be detected with an angle difference of no more than 3° are merged, and the merged target lines are compared according to the number of points contained in the lines to be detected. The line to be detected with a larger number of edge points is the optimal line, and the points on the line are retained.

[0118] Exemplarily, the straight lines to be detected include a first straight line to be detected, a second straight line to be detected, a third straight line to be detected, and a fourth straight line to be detected, the first straight line to be detected corresponds to 100 edge points, the second straight line to be detected includes 300 edge points, the third straight line to be detected includes 101 edge points, and the fourth straight line to be detected includes 200 edge points, when the angle between the straight line direction vector of the first straight line to be detected and the straight line direction vector of the second straight line to be detected is less than or equal to the preset angle, the first straight line to be detected and the second straight line to be detected are merged to obtain the second straight line, and when the straight line direction vector of the third straight line to be detected is equal to the preset angle, the first straight line to be detected and the second straight line to be detected are merged to obtain the second straight line, and the straight line direction vector of the third straight line to be detected is equal to the preset angle. When the angle between the third straight line to be detected and the straight line direction vector of the fourth straight line to be detected is less than the preset angle, the third straight line to be detected and the fourth straight line to be detected are merged to obtain a second straight line, the first straight line to be detected and the second straight line to be detected are merged to obtain 400 edge points corresponding to the second straight line, the third straight line to be detected and the fourth straight line to be detected are merged to obtain 301 edge points corresponding to the second straight line, then the second straight line with the largest number of edge points is obtained from the two second straight lines as the target straight line, that is, the second straight line obtained by merging the first straight line to be detected and the second straight line to be detected is taken as the target straight line.

[0119] It should be noted that the preset angle can be set to 3°, 5°, 7°, etc., and the embodiments of the present application do not impose specific limitations on this.

[0120] There are many ways to divide the edge points of the straight line into connected domains to obtain multiple connected regions. In one implementation, for example, Figure 5 As shown, the following steps are included:

[0121] S501: For each straight line edge point, calculate the distance between the straight line edge point and the straight line edge points other than the straight line edge point.

[0122] S502: Compare the distance with a preset distance.

[0123] S503: Determine the straight line edge points that are greater than a preset distance as the first connected area.

[0124] S504: Determine the straight line edge points that are less than or equal to the preset distance as the second connected area.

[0125] In order to improve the detection efficiency, when there are multiple connected areas, the number of edge points in each connected area can be determined, and the number of each edge point can be compared with a preset number. When the number of edge points is less than the preset number, the connected area corresponding to the number of edge points is deleted, that is, straight line detection is not performed on the connected area.

[0126] There are many ways to perform endpoint recognition on the target straight line to obtain the first endpoint and the second endpoint. In one implementation, Figure 6 As shown, the following steps are included:

[0127] S601: Determine each target edge point corresponding to the target straight line.

[0128] S602: Determine the point with the longest distance from each target edge point as the first endpoint based on the shortest path algorithm.

[0129] S603: Taking the first endpoint as the starting point, and taking the point farthest from each target edge point as the second endpoint based on the shortest path algorithm.

[0130] A graph data structure is established to represent the relationship between points in the point cloud. For each point, KNN is used to find the nearest points to it, and these points are linked as edges in the graph. The weight of the edge is the distance between them. The Dijkstra shortest path algorithm is used to calculate the shortest path set from a starting point, that is, a target edge point, to all other target edge points. In the results calculated by the Dijkstra algorithm, the farthest target edge point is found as a first endpoint. Rerun the Dijkstra algorithm, use the first endpoint found in the previous step as the starting point, rerun the Dijkstra algorithm, and find another endpoint farthest from the first endpoint as the second endpoint.

[0131] Please refer to Figure 7 The present application embodiment also provides a method for applying Figure 1 The weld seam identification device 110 of the electronic device 100 includes:

[0132] An acquisition module 111 is used to acquire straight line edge points of a point cloud to be detected;

[0133] A division module 112 is used to divide the straight line edge points into connected domains to obtain multiple connected regions;

[0134] A straight line detection module 113 is used to perform straight line detection on each of the connected areas to obtain a plurality of straight lines to be detected;

[0135] A fitting module 114 is used to merge the straight lines to be detected to obtain a target straight line;

[0136] An identification module 115 is used to identify the endpoints of the target straight line to obtain a first endpoint and a second endpoint;

[0137] The determination module 116 is used to obtain the weld of the point cloud to be detected based on the first endpoint and the second endpoint.

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

[0139] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the weld identification method is implemented.

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

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

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

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

Claims

1. A weld identification method, characterized in that: The method comprises: Get the straight line edge points of the point cloud to be detected; Divide the straight line edge points into connected domains to obtain multiple connected regions; Performing straight line detection on each of the connected areas to obtain a plurality of straight lines to be detected; Merging the straight lines to be detected to obtain a target straight line; Performing endpoint recognition on the target straight line to obtain a first endpoint and a second endpoint; A weld of the point cloud to be detected is obtained based on the first endpoint and the second endpoint.

2. The method according to claim 1, characterized in that The step of performing straight line detection on each of the connected regions to obtain a plurality of straight lines to be detected comprises: For each connected region, a first edge point set in the connected region is mapped to a Platonic solid shape model, and a plurality of discrete points satisfying a straight line condition are obtained from the Platonic solid shape model. Based on the discrete points, a plurality of first straight lines are obtained; The plurality of first straight lines are fitted by the least square method to obtain a plurality of straight lines to be detected corresponding to each of the connected regions.

3. The method according to claim 2, characterized in that The step of mapping the first edge point set in each connected region to a Platonic solid shape model, and obtaining a plurality of discrete points satisfying a straight line condition from the Platonic solid shape model comprises: For each connected area, the first edge point set in the connected area is mapped to the Platonic solid shape model, the discrete point with the largest number of votes is obtained as the target discrete point, and the first edge point corresponding to the target discrete point is obtained, wherein each of the connected areas corresponds to each first edge point set, the first edge point set includes multiple edge points, the Platonic solid shape model includes multiple discrete points, and the target discrete point indicates a discrete point with the largest number of edge points less than a preset threshold value in the distance between each of the discrete points and each point in the first edge point set; Acquire first straight line parameters corresponding to the target discrete points and first edge points corresponding to the target discrete points; Based on the first straight line parameters, construct a first straight line, wherein the first edge point set includes each of the first edge points; Removing each of the first edge points from the corresponding first edge point set to obtain a second edge point set; The second edge points are aggregated into the Platonic solid shape model, and the discrete points with the most votes are obtained as new target discrete points; Acquire the second straight line parameters corresponding to the new target discrete points and the second edge points corresponding to the new target discrete points; Based on the second straight line parameter, construct a first straight line; Removing each second edge point from the second edge point set to obtain a third edge point set; Projecting the third edge point set into the Platonic solid shape model, obtaining the discrete point with the most votes as a new target discrete point, until the number of points in the latest edge point set meets the preset number of points, thereby obtaining a plurality of target discrete points; The straight line parameters corresponding to each target discrete point are obtained to obtain a plurality of first straight lines.

4. The method according to claim 3, characterized in that The step of merging the straight lines to be detected to obtain a target straight line comprises: Determine the straight line direction vector corresponding to each of the straight lines to be detected; For each of the straight line direction vectors, calculating the angle between the straight line direction vector and each first straight line direction vector other than the straight line direction vector; Comparing each of the angles with a preset angle; Acquire target angles that are less than or equal to the preset angle; Obtaining the straight lines to be detected corresponding to the target angles; Merging the straight lines to be detected corresponding to the target angles to obtain second straight lines; A second straight line having the largest number of edge points among the second straight lines is obtained as a target straight line.

5. The method according to claim 1, characterized in that The step of performing endpoint recognition on the target straight line to obtain a first endpoint and a second endpoint includes: Determine each target edge point corresponding to the target straight line; Determine the point with the longest distance from each target edge point as the first endpoint based on the shortest path algorithm; The first endpoint is used as a starting point, and the point farthest from each target edge point based on the shortest path algorithm is used as a second endpoint.

6. The method according to claim 1, characterized in that The step of dividing the straight line edge points into connected domains to obtain a plurality of connected regions comprises: For each of the straight line edge points, calculate the distance between the straight line edge point and the straight line edge points other than the straight line edge point; comparing the distance to a preset distance; Determine the straight line edge points greater than the preset distance as the first connected area; The straight line edge points that are less than or equal to the preset distance are determined as the second connected area.

7. A weld identification device, characterized in that: The device comprises: An acquisition module is used to acquire straight line edge points of the point cloud to be detected; A division module, used for dividing the straight line edge points into connected domains to obtain multiple connected regions; A straight line detection module, used for performing straight line detection on each of the connected areas to obtain a plurality of straight lines to be detected; A fitting module, used for merging the straight lines to be detected to obtain a target straight line; An identification module, used for performing endpoint identification on the target straight line to obtain a first endpoint and a second endpoint; A determination module is used to obtain the weld of the point cloud to be detected based on the first endpoint and the second endpoint.

8. The device according to claim 7, characterized in that The straight line detection module is specifically used for: For each connected region, a first edge point set in the connected region is mapped to a Platonic solid shape model, and a plurality of discrete points satisfying a straight line condition are obtained from the Platonic solid shape model. Based on the discrete points, a plurality of first straight lines are obtained; The plurality of first straight lines are fitted by the least square method to obtain a plurality of straight lines to be detected corresponding to each of the connected regions.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

Citation Information

Patent Citations

  • Region growth labeling-based weld joint visual recognition method

    CN106469312A

  • Method and device for determining straight line outline of scanned object and storage medium

    CN109785335A

  • Workpiece weld seam positioning method and system based on three-dimensional visual information

    CN113042939A

  • 3D point cloud intelligent sensing weld joint pose extraction method, system and equipment

    CN117576094A

  • Linear welding seam recognition method and device and electronic equipment

    CN118212233A