Welding seam detection method and device and electronic equipment

By calculating the intersection line between the plane and the cylinder in the object point cloud of the target object, the position information of the elliptical weld is obtained, which solves the versatility and accuracy problems of elliptical weld recognition in the existing technology and realizes an efficient and accurate welding process. , reducing dependence on positioning sensors.

CN118587160APending Publication Date: 2024-09-03FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD

Patent Information

Application Number
CN202410625762.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing weld detection technology lacks versatility when identifying elliptical welds of different structures, the calculation accuracy is not high, and it requires the use of positioning sensors to assist, which limits welding efficiency and adaptability.

Method used

By determining the object point cloud of the target object, calculating the intersection center position of the target plane and the cylindrical surface, obtaining the short axis and long axis direction vectors and semi-axis length of the elliptical weld, achieving accurate detection of the elliptical weld without the assistance of positioning sensors. .

Benefits of technology

It achieves high-precision identification of elliptical welds on different structural objects, improves welding efficiency and adaptability, reduces work costs, and enhances welding quality and work space utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587160A
    Figure CN118587160A
Patent Text Reader

Abstract

The invention provides a welding seam detection method and device and electronic equipment, and relates to the technical field of computers. The method comprises the steps of determining a first target plane and a target cylindrical surface based on an object point cloud of a target object under the condition that an arc welding seam needs to be detected; according to the axis direction vectors of the first target plane and the target cylindrical surface, the center position of the ellipse intersecting line of the first target plane and the target cylindrical surface is calculated; according to the first normal vector and the axis direction vector of the first target plane, calculating to obtain a short axis direction vector and a long axis direction vector of an ellipse intersecting line; and according to the first normal vector, the axis direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, the semi-minor axis length and the semi-major axis length of the ellipse intersecting line are obtained, so that ellipse welding seam information is obtained. Therefore, the elliptical weld joints on the objects with different structures can be recognized, the universality is high, the calculation precision is high, and meanwhile, a positioning sensor does not need to be arranged to assist in weld joint recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a weld detection method, device and electronic equipment. Background Art

[0002] Manual welding has three obvious disadvantages: first, extreme or dangerous working environments (such as high temperature, radiation, etc.) are harmful to welders; second, some working environments are limited in space (such as shipbuilding applications, nuclear power plants), and welders cannot reach them; third, welders' work efficiency is affected by natural or human factors. Welding robots have outstanding advantages in efficiency, welding quality, adaptability and work space utilization, and reduce work costs, so they play an increasingly important role in the automation industry.

[0003] During the operation of the welding robot, extracting the weld position is one of the keys to the welding robot's welding work. Only by extracting the correct weld information and feeding it back to the robot / mechanical arm can the welding work be performed correctly. Therefore, how to perform weld detection has become a technical problem that technicians in this field need to solve urgently. Summary of the invention

[0004] The embodiments of the present application provide a weld detection method, device, electronic device and readable storage medium, which can identify elliptical welds on objects with different structures, have strong versatility and high calculation accuracy, and do not require the setting of a positioning sensor to assist in weld identification.

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

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

[0007] In the case where arc welds need to be detected, a first target plane and a target cylindrical surface are determined, wherein the first target plane and the target cylindrical surface are obtained based on an object point cloud of a target object;

[0008] Calculating the center position of the ellipse intersection line between the first target plane and the target cylindrical surface according to the axial direction vectors of the first target plane and the target cylindrical surface;

[0009] Calculating the minor axis direction vector and the major axis direction vector of the ellipse intersection line according to the first normal vector of the first target plane and the axis direction vector;

[0010] According to the first normal vector, the axial direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, the semi-minor axis length and the semi-major axis length of the elliptical intersection line are obtained, wherein the elliptical weld information obtained by weld detection includes the center position, the minor axis direction vector, the major axis direction vector, the semi-minor axis length and the semi-major axis length.

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

[0012] A determination module, used for determining a first target plane and a target cylindrical surface when arc weld detection is required, wherein the first target plane and the target cylindrical surface are obtained based on an object point cloud of a target object;

[0013] A processing module, configured to calculate a center position of an ellipse intersection line between the first target plane and the target cylindrical surface according to the axis direction vectors of the first target plane and the target cylindrical surface;

[0014] The processing module is further used to calculate the short axis direction vector and the long axis direction vector of the ellipse intersection line according to the first normal vector of the first target plane and the axis direction vector;

[0015] The processing module is also used to obtain the semi-minor axis length and semi-major axis length of the elliptical intersection line based on the first normal vector, the axial direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, wherein the elliptical weld information obtained by weld detection includes the center position, the minor axis direction vector, the major axis direction vector, the semi-minor axis length and the semi-major axis length.

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

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

[0018] The weld detection method, device, electronic device and readable storage medium provided by the embodiment of the present application, when it is necessary to detect the arc weld, first determine the first target plane and target cylindrical surface required for detection, the first target plane and target cylindrical surface are obtained based on the object point cloud of the target object; then, based on the axis direction vector of the first target plane and the target cylindrical surface, calculate the center position of the ellipse intersection line of the first target plane and the target cylindrical surface; and, according to the first normal vector and the axis direction vector of the first target plane, calculate the minor axis direction vector and the major axis direction vector of the ellipse intersection line; and, according to the first normal vector, the axis direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, obtain the semi-minor axis length and the semi-major axis length of the ellipse intersection line. In this way, the ellipse weld position information for indicating the detected ellipse weld can be obtained, and the ellipse weld information includes the above-mentioned center position, minor axis direction vector, major axis direction vector, semi-minor axis length and semi-major axis length. In this way, the ellipse welds on objects with different structures can be identified, with strong versatility and high calculation accuracy, and no positioning sensor is required to assist weld identification. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0021] Figure 2 One of the flow charts of the weld detection method provided in the embodiment of the present application;

[0022] Figure 3 It is a schematic diagram of a cylinder and a space plane;

[0023] Figure 4 A second flow chart of the weld detection method provided in the embodiment of the present application;

[0024] Figure 5 The third flow chart of the weld detection method provided in the embodiment of the present application;

[0025] Figure 6 A schematic diagram of a cylindrical micro-curved surface and its projection provided in an embodiment of the present application;

[0026] Figure 7 for Figure 5 A schematic flow chart of the sub-steps included in step S130;

[0027] Figure 8 for Figure 2 A schematic flow chart of the sub-steps included in step S210;

[0028] Fig. 9 A fourth flow chart of a weld detection method provided in an embodiment of the present application;

[0029] Fig.10 It is a schematic diagram of two spatial planes intersecting at a straight line;

[0030] Fig.11 One of the block diagrams of the weld detection device provided in the embodiment of the present application;

[0031] Fig.12 A second block diagram of a weld detection device provided in an embodiment of the present application;

[0032] Fig.13 A third block diagram of a weld detection device provided in an embodiment of the present application;

[0033] Fig.14 This is a fourth block diagram of a weld detection device provided in an embodiment of the present application.

[0034] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - weld detection device; 210 - update module; 220 - registration module; 230 - judgment module; 240 - determination module; 250 - processing module. DETAILED DESCRIPTION

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

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

[0037] The inventor of the present application has found through research that the current weld extraction technologies are mainly divided into the following types.

[0038] ① Weld recognition in specific scenarios. Set a fixed mathematical expression in advance to represent the weld. When welding the physical object, control the robot to reach the zero point required by the above mathematical expression, and then weld according to the mathematical expression. That is, in this way, a coordinate system corresponding to the zero point is used as the coordinate system used by the mathematical expression of the weld, and the lines represented by the mathematical expression are directly used as the welds on the physical object. This method has strict requirements on the specifications and scenarios of the physical object and is not very applicable. For example, the mathematical expression is determined based on the standard model corresponding to the physical object, and there is a processing deviation between the physical object and the standard model, which will lead to inaccurate weld recognition. A mathematical expression in the above method can only correspond to one physical object and cannot be universal.

[0039] ② Use positioning sensors to assist in positioning. For example, a moving laser source obtains the deviation distance between the laser source point and the reflected light target point on the horizontal projection plane, and obtains the weld position based on the deviation distance corresponding to all detection points. In addition to the laser source, a displacement sensor can also be used to determine the position of the weld by the change in posture caused by rotation. In addition, an ultrasonic detector is also used for detection to locate the weld position. Another commonly used sensor is the arc sensor, whose arc voltage and current characteristics change with the height of the welding torch. However, this method of using positioning sensors for positioning is highly dependent on the shape of the weld.

[0040] ③Use morphological features of two-dimensional images to extract welds. Weld extraction from images based on deep learning or morphological processing methods usually includes three sub-processes: image preprocessing, line extraction, and feature processing. The weld detection method based on feature extraction of two-dimensional images is highly sensitive to ambient light; and when extracting welds based on deep learning methods, a large amount of training data is required in the early stage, and it is unstable in practical applications.

[0041] In response to the above situation, the embodiments of the present application provide a weld detection method, device, electronic device and readable storage medium, which can identify elliptical welds on objects with different structures, have strong versatility and high calculation accuracy, and do not require the setting of positioning sensors to assist in weld identification.

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

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

[0044] The memory 110 is used to store programs or data. 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.

[0045] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a weld detection device 200, and the weld detection device 200 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 various functional applications and data processing by running software programs and modules stored in the memory 110, such as the weld detection device 200 in the embodiment of the present application, that is, realizing the weld detection method in the embodiment of the present application.

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

[0047] It should be understood that Figure 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 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.

[0048] Please refer to Figure 2 , Figure 2 This is one of the flow diagrams of the weld detection method provided in the embodiment of the present application. The method can be applied to the above-mentioned electronic device 100. The specific flow of the weld detection method is described in detail below. In this embodiment, the method may include steps S210 to S240.

[0049] Step S210, when arc weld detection is required, a first target plane and a target cylindrical surface are determined.

[0050] In this embodiment, it can be determined in any way whether it is currently necessary to detect the arc weld on the target object. The target object is an object that needs to be welded, for example, the target object is a workpiece that needs to be welded. The arc weld can be an ellipse or a part of an ellipse. It is worth noting that the standard circle is a special ellipse. When it is determined that the target object needs to be inspected for arc welds, a plane can be determined as the first target plane and a cylindrical surface can be determined as the target cylindrical surface.

[0051] like Figure 3 As shown in a, the cylinder includes a cylindrical side and two circular bottom surfaces, the bottom surface radius is r, and the cylindrical side is the cylindrical surface. The axis of the cylinder is the straight line where the center of the upper and lower bottom circles is located, and the axis is also the axis of the cylindrical surface. The general formula of the target cylindrical surface is: (x, y, z) represents the coordinates of any point on the target cylindrical surface; p cl =(x cl ,y cl ,z cl ) represents the coordinates of a point on the axis of the target cylindrical surface, the coordinates are known, and the point is hereinafter referred to as the axis point; The direction vector of the axis of the target cylindrical surface, i.e., the axis direction vector, can be a unit vector; r represents the radius of the upper and lower bases of the cylinder. Two points with known normal vectors can uniquely construct a candidate cylindrical shape.

[0052] like Figure 3 As shown in b, the plane is a spatial plane in three-dimensional space. The general formula of the first target plane is: Ax+By+Cz+D=0, (x, y, z) represents the coordinates of any point on the first target plane; The plane normal vector of the first target plane is hereinafter referred to as the first normal vector, and D represents the plane intercept. The first normal vector may be a unit vector. The non-collinear points of the three known normal vectors can uniquely construct a candidate plane shape.

[0053] Wherein, the first target plane is obtained by performing plane detection on the object point cloud of the target object, and the target cylindrical surface is obtained by performing cylindrical surface detection on the object point cloud. Optionally, the object point cloud of the target object can be obtained in advance, and the object point cloud can be subjected to plane detection and cylindrical surface detection, so as to determine the plane and cylindrical surface in the object point cloud, and then determine the first target plane and target cylindrical surface from the plane and cylindrical surface in the object point cloud. Then, other devices obtain the object point cloud in advance, and determine the plane and cylindrical surface in the object point cloud through plane detection and cylindrical surface detection, and then send the determined plane and cylindrical surface to the electronic device, and the electronic device determines the first target plane and target cylindrical surface from the received plane and cylindrical surface. Wherein, the object point cloud can be a point cloud obtained by a point cloud acquisition device through a point cloud acquisition, that is, the object point cloud is a local point cloud; the object point cloud can be a point cloud obtained by splicing multiple point clouds of the target object, that is, the object point cloud can also be a global point cloud.

[0054] When the plane and the cylindrical surface are not parallel, the intersection line of the plane and the cylindrical surface is an elliptical intersection line. Optionally, the non-parallel planes and cylindrical surfaces in the determined object point cloud can be taken as a group to be processed, and the plane of the group to be processed is the first target plane, and the cylindrical surface is the target cylindrical surface. Steps S220 to S240 can be performed for each group to be processed to determine the corresponding elliptical weld, thereby determining multiple elliptical welds. Alternatively, based on actual needs, a plane can be determined from all the determined planes as the first target plane, and a cylindrical surface can be determined from all the cylindrical surfaces as the target cylindrical surface, thereby determining an elliptical weld. It can be understood that the above-mentioned method of determining the first target plane and the target cylindrical surface is only for example, and the specific method can be determined in combination with actual needs.

[0055] Step S220: Calculate the center position of the ellipse intersection line between the first target plane and the target cylindrical surface according to the axial direction vectors of the first target plane and the target cylindrical surface.

[0056] Step S230, calculating the short axis direction vector and the long axis direction vector of the ellipse intersection line according to the first normal vector of the first target plane and the axis direction vector.

[0057] Step S240, obtaining the semi-minor axis length and the semi-major axis length of the ellipse intersection line according to the first normal vector, the axis direction vector and the radius of the cylinder bottom surface corresponding to the target cylindrical surface.

[0058] In this embodiment, the case where the target cylindrical surface is not parallel to the first target plane is mainly considered, that is, the case where the intersection line of the two is an ellipse intersection line is mainly considered. To determine the ellipse weld, three quantities need to be calculated: the coordinates of the ellipse center (i.e., the center of the ellipse), the direction and size of the ellipse major axis, and the direction and size of the ellipse minor axis.

[0059] In this embodiment, according to the direction vector of the first target plane and the target axis, based on the principle that the straight line passing through the center of the ellipse intersection on the first target plane is perpendicular to the first normal vector of the first target plane, the coordinates of the center of the ellipse intersection are calculated, that is, the center position of the ellipse line is obtained. The minor axis direction vector and the major axis direction vector can also be calculated according to the first normal vector and the axis direction vector, combined with the relationship between the minor axis direction vector and the major axis direction vector of the ellipse intersection and the first normal vector and the axis direction vector. Among them, the minor axis direction vector and the length direction vector can be represented by a unit vector or not, which can be determined in combination with actual needs. And, according to the first normal vector, the axis direction vector, the radius of the bottom surface of the cylinder, and the formation principle of the ellipse intersection, the semi-minor axis length b and the semi-major axis length a of the ellipse intersection can be obtained. Among them, steps S220 to S240 can be executed in parallel or in sequence, and the execution order is not specifically limited here. In this way, ellipse weld information can be obtained, and the ellipse weld information is used to indicate the position of the ellipse intersection on the target object. The elliptical weld information may include a center position, a minor axis direction vector, a major axis direction vector, a semi-minor axis length b, and a semi-major axis length a.

[0060] Optionally, when the target elliptical weld actually required is only a part of the elliptical intersection line, the target elliptical weld can be determined from the elliptical intersection line in combination with other conditions, for example, the target elliptical weld can be determined in combination with the start point and end point specified on the elliptical intersection line.

[0061] In this embodiment, information about the elliptical weld on the target object is calculated based on the relevant information of the first target plane and the target cylindrical surface in the object point cloud of the target object. In this way, elliptical welds on objects with different structures can be identified. Compared with the method of presetting the elliptical equation (i.e., a fixed mathematical expression indicating the elliptical intersection line in advance), the above method has strong versatility and high calculation accuracy, and there is no need to set a positioning sensor to assist in weld identification.

[0062] Generally, there are straight welds and elliptical welds on an object with welds. Figure 4 Step S204 in the embodiment determines which type of weld needs to be inspected. Figure 4 , Figure 4 The second flow chart of the weld detection method provided in the embodiment of the present application is as follows. In this embodiment, before step S210, the method further includes step S204.

[0063] Step S204: Determine whether a circular arc weld or a linear weld needs to be inspected based on the obtained weld reference information.

[0064] In this embodiment, the weld reference information is used to indicate whether the weld to be detected is a straight weld or an arc weld. The weld reference information may be calculated by other devices, or determined by the electronic device based on a received user input operation, or may be determined by other methods, which are not specifically limited here.

[0065] Optionally, the weld reference information may directly include a type identifier of a straight weld or an arc weld, so that it is convenient to directly determine which type of weld needs to be detected currently. For example, a straight weld type or an arc weld type is directly selected manually, and weld reference information including the type is obtained according to the received user selection operation. Alternatively, the weld reference information may include the positions of multiple reference points, and it is possible to determine which type of weld needs to be detected currently based on the number of manual reference points. For example, if only two reference points are included, it can be determined that a straight weld needs to be detected currently, and the two reference points are used to indicate the desired straight weld position on the target object; if three reference points are included, it can be determined that an arc weld needs to be detected currently, and the three reference points are used to indicate the desired elliptical weld position on the target object.

[0066] When it is determined according to the weld reference information that an arc weld needs to be detected, steps S210 to S240 may be performed to obtain the position of an elliptical weld. When it is determined according to the weld reference information that a linear weld needs to be detected, linear weld detection may be performed in combination with a plane detected from the object point cloud, thereby obtaining linear weld information. The specific method for obtaining the linear weld information may be determined in combination with actual needs and is not specifically limited here.

[0067] The inventor of this application has found through research that when extracting cylindrical surfaces and planes, the plane may be mistakenly identified as a micro-curved surface of a cylinder, which will affect the accuracy of the first target plane and target cylindrical surface, and thus lead to poor weld detection results. To avoid the above situation, the plane obtained by detecting the object point cloud can be summarized as the initial plane detection result, and the cylindrical surface obtained by detection can be used as the initial cylindrical surface and summarized as the initial cylindrical surface detection result, and the above two detection results can be updated. Please refer to Figure 5 , Figure 5 The third flow chart of the weld detection method provided in the embodiment of the present application. In the present embodiment, before determining the first target plane and the target cylindrical surface, the method may further include steps S110 to S140.

[0068] Step S110, for each initial cylindrical surface in the initial cylindrical surface detection result, project each point cloud point in the point cloud set corresponding to the initial cylindrical surface onto the bottom surface of the cylinder corresponding to the initial cylindrical surface to obtain a plurality of projection points.

[0069] Step S120, calculating a plurality of first angles according to respective normal vectors of a plurality of projection points.

[0070] Step S130: judging whether the initial cylindrical surface is a plane according to the multiple first angles.

[0071] In this embodiment, plane detection and cylindrical surface detection are performed on the object point cloud to obtain initial plane detection results and initial cylindrical surface detection results. The initial plane detection results and initial cylindrical surface detection results may be calculated by other devices and sent to the electronic device, or may be obtained by the electronic device based on the calculation of the object point cloud. The initial plane detection results may include multiple initial planes, and the initial cylindrical surface detection results may include multiple initial cylindrical surfaces, which are specifically determined based on the detection of the object point cloud.

[0072] When the initial cylindrical surface detection result is obtained, for each initial cylindrical surface in the initial cylindrical surface detection result, it can be determined whether the initial cylindrical surface is a cylindrical surface or a plane. For ease of understanding, an initial circular surface M is taken as an example to introduce how to determine whether an initial circular surface is a cylindrical surface or a plane.

[0073] For the initial cylindrical surface M, all the point cloud points in the object point cloud corresponding to the initial cylindrical surface M are projected onto a bottom surface of the cylinder corresponding to the initial circular surface M, thereby obtaining a plurality of projection points. Among them, the point cloud points in the object point cloud corresponding to the initial cylindrical surface M are located on or near the initial distant surface M. The plurality of projection points can be obtained by projecting the initial cylindrical surface M along the axial direction of the initial cylindrical surface M. Figure 6 As shown, the normal vector of a point on the side of the cylinder is away from the center of the circle and perpendicular to the axial direction. When a cylindrical micro-curved surface is projected along the axial direction, the projected two-dimensional figure is a part of the circle.

[0074] When the multiple projection points corresponding to the initial cylindrical surface M are obtained, multiple first angles can be calculated based on the normal vectors of each of the multiple projection points, wherein a first angle is the angle between the normal vectors of two projection points. Optionally, multiple first angles can be calculated based on the normal vectors of every two projection points in the multiple projection points. For example, if there are three projection points 1, 2, and 3, the following can be calculated: the normal vector angle of projection points 1 and 2; the normal vector angle of projection points 1 and 3; the normal vector angle of projection points 2 and 3. Multiple first angles can also be calculated randomly based on the normal vectors of each of the multiple projection points. For example, if there are four projection points 1-4, only the following can be calculated: the normal vector angle of projection points 1 and 4; the normal vector angle of projection points 2 and 3; the normal vector angle of projection points 1 and 3.

[0075] The multiple first angles describe the curvature of the two-dimensional figure formed by the multiple projection points, and the multiple first angles can be analyzed to determine whether the initial cylindrical surface is a cylindrical surface or a plane. For example, the maximum angle among the multiple first angles is selected, and it is determined whether the maximum angle is greater than a threshold value, if it is greater, the initial cylindrical surface M is determined to be a cylindrical surface, and if it is not greater, the initial cylindrical surface M is determined to be a plane.

[0076] As a possible implementation, Figure 7 The method shown is based on the analysis of the multiple first angles to obtain an accurate judgment result. Figure 7 , Figure 7 for Figure 5 Schematic diagram of the flow of sub-steps included in step S130. In this embodiment, step S130 may include sub-steps S131 to S135.

[0077] Sub-step S131, selecting a first angle greater than a first preset angle from the plurality of first angles as a first selected angle.

[0078] In this embodiment, the multiple first angles can be compared with the first preset angle respectively, so as to select the first angle greater than the first preset angle as the first candidate angle. In this way, the first angle with a larger angle can be selected from the multiple first angles for subsequent judgment, which can reduce the influence of the normal vector angle of the similar projection points on the judgment result, and ensure the accuracy of the judgment result. Among them, the first preset angle can be set according to actual needs, for example, set to 30 degrees.

[0079] Sub-step S132, determining a preset number of first candidate angles from the selected first candidate angles as first angles to be used.

[0080] Optionally, a preset number of first angles to be selected may be selected from the selected first angles to be selected in descending order as the first angles to be used. Alternatively, a preset number of first angles to be selected may be randomly selected from the selected first angles to be selected as the first angles to be used. The preset number may be determined in combination with actual needs, for example, the preset number is 10.

[0081] Sub-step S133, calculating an average value of the determined first angle to be used, and determining whether the average value is greater than a second preset angle.

[0082] If the average value is greater than the second preset angle, sub-step S134 is executed.

[0083] Sub-step S134, determining that the initial cylindrical surface is a cylindrical surface.

[0084] If the average value is not greater than the second preset angle, sub-step S135 is executed.

[0085] Sub-step S135, determining that the initial cylindrical surface is a plane.

[0086] When a preset number of first angles to be used are obtained, the average value of the preset number of first angles to be used can be calculated. Then, the average value is compared with the second preset angle. Among them, the second preset angle is greater than the first preset angle, which can be determined in combination with actual needs. When the average value is greater than the second preset angle, it can be determined that the initial cylindrical surface M is a cylindrical surface; when the average value is less than or equal to the second preset angle, it can be determined that the initial cylindrical surface M is a plane. In this way, the cylindrical micro-curved surface and the plane in the cylindrical surface can be accurately distinguished.

[0087] By performing the above determination of whether the initial cylindrical surface M is a cylindrical surface or an average on each initial cylindrical surface in the initial cylindrical surface detection result, the determination result corresponding to each initial cylindrical surface can be obtained. The determination result corresponding to an initial cylindrical surface is used to indicate whether the initial cylindrical surface is a plane or a cylindrical surface.

[0088] Step S140, updating the initial plane detection result and the initial cylindrical surface detection result according to the judgment results corresponding to each initial cylindrical surface, to obtain a cylindrical surface detection result and a plane detection result.

[0089] In the case of obtaining a judgment result corresponding to an initial cylindrical surface, if the judgment result corresponding to the initial cylindrical surface indicates that the initial cylindrical surface is a cylindrical surface, the initial cylindrical surface can be retained as a cylindrical surface in the initial cylindrical surface detection result; if the judgment result corresponding to the initial cylindrical surface indicates that the initial cylindrical surface is a plane, the initial cylindrical surface plane is deleted from the initial cylindrical surface detection result, and the initial cylindrical surface plane is added as a plane to the initial plane detection result to update the initial cylindrical surface detection result and the initial plane detection result. After performing the above update according to the judgment results corresponding to all the initial cylindrical surfaces obtained, the final updated initial cylindrical surface detection result can be used as the cylindrical surface detection result, and the final updated initial plane detection result can be used as the plane detection result. In the case of arc weld detection, the first target plane can be determined from the plane detection result, and the target cylindrical surface can be determined from the cylindrical surface detection result. In this way, the situation of wrong surface selection can be reduced, thereby ensuring the accuracy of weld detection.

[0090] In the method of using the intersection of the surface identified based on the point cloud as the weld identification method, since there are many identified surfaces, this will result in many welds being identified, and the required welds cannot be quickly obtained. To avoid the above situation, optionally, as a possible implementation method, Figure 8 The first target plane and the target cylindrical surface are determined in the manner shown, thereby determining the required elliptical weld. Figure 8 , Figure 8 for Figure 2 Schematic diagram of the flow of sub-steps included in step S210. In this embodiment, step S210 may include sub-steps S211 to S213.

[0091] Sub-step S211, determining at least three arc weld reference points based on the obtained weld reference information.

[0092] In this embodiment, the weld reference information is used to indicate the approximate position of the weld to be detected. In the case where an arc weld needs to be detected, the weld reference information is used to indicate the reference position of the arc weld to be detected, that is, to indicate the approximate position of the elliptical weld to be detected. According to the weld reference information, the coordinates of at least three arc weld reference points can be obtained, and the at least three arc weld reference points determine an arc reference weld. The arc reference weld is a reference weld of the elliptical weld to be detected, that is, the elliptical weld detection is performed on the target object with reference to the position of the arc reference weld. Optionally, the at least three arc weld reference points may include a starting point, an intermediate point and an end point, a total of three points. The coordinates of the determined arc weld reference points are located in the coordinate system used by the object point cloud, so that it is convenient to select a face based on the coordinates of the arc weld reference points.

[0093] Optionally, as a possible implementation, a selection can be made manually in the object point cloud to designate multiple point cloud points as the coordinates of at least three arc weld reference points included in the weld reference information, so as to facilitate rapid acquisition of the at least three arc weld reference points.

[0094] Optionally, as another possible implementation, the at least three arc weld reference points may be obtained in combination with the object model of the target object. Fig. 9 , Fig. 9 The fourth flow chart of the weld detection method provided in the embodiment of the present application is as follows. In this embodiment, before step S210, the method may further include steps S201 to S202.

[0095] Step S201: obtaining the object point cloud of the target object and obtaining the model point cloud of the object model corresponding to the target object.

[0096] Step S202: obtaining a transformation matrix by registering the object point cloud and the model point cloud.

[0097] In this embodiment, the object model is a standard three-dimensional model corresponding to the target object, and a model point cloud of the object model can be obtained. Then, the object point cloud and the model point cloud are registered to obtain a transformation matrix between the two. Optionally, the transformation matrix can be obtained by an ICP (Iterative Closest Point) algorithm.

[0098] As a possible implementation manner, the conversion matrix may be obtained in the following manner.

[0099] First, point cloud data of multiple poses can be collected for the target object, that is, multiple point clouds can be obtained; then, the multiple point clouds can be spliced ​​to obtain a global point cloud of the target object; then, the global point cloud and the model point cloud can be registered to obtain a registration result. After that, the object point cloud of the target object can be obtained, and the object point cloud is point cloud data of one pose, that is, compared with the above-mentioned global point cloud, the object point cloud is a local point cloud. Finally, the above-mentioned registration result is used as the initial value of the registration of the object point cloud and the model point cloud for registration, so as to obtain the transformation matrix. In this way, a transformation matrix with better accuracy can be obtained. Among them, in the welding scene, the above-mentioned global point cloud, model point cloud, and object point cloud can all be converted to the base coordinate system of the welding robot to facilitate subsequent welding according to the data in the base coordinate system, wherein the welding robot can include a robot body, a welding gun, and a visual camera for obtaining point clouds, and the robot body can be used to perform translation, rotation and other actions for welding.

[0100] In this embodiment, the welding reference information may be obtained based on a point manually specified on the object model. The welding reference information may include an initial reference point manually specified on the model, and a reference trajectory determined by the initial reference point is located on the object model. In the case of detecting an arc weld, the welding reference information includes the coordinates of at least three initial reference points, and the arc weld reference points corresponding to each initial reference point may be calculated based on the coordinates of the at least three initial reference points and the above-mentioned conversion torque. The at least three initial reference points may include only three points: a welding start point, an intermediate point, and an end point. In this way, a unique plane and a cylindrical surface may be selected based on the prior knowledge of the selected initial reference point on the object model, thereby determining the position of a single required arc weld.

[0101] Wherein, in the case of determining the initial reference point manually designated on the object model, a welding trajectory may also be generated on the object model and displayed to the user so that the user can check whether the initial reference point is designated correctly.

[0102] Sub-step S212: taking the plane closest to the reference plane in the plane detection result as the first target plane.

[0103] In this embodiment, when at least three arc weld reference points are determined, a plane can be determined as a reference plane based on the at least three arc weld reference points, and the at least three arc weld reference points are located on the reference plane. The distance between each plane parallel to the reference plane in the plane detection result and the reference plane can be calculated, and then the plane corresponding to the minimum distance is used as the first target plane. In this way, the plane with the closest distance can be selected as the first target plane. Among them, the plane detection result used when selecting the first target plane can be obtained based on conventional plane algorithm detection, or it can be obtained based on steps S110 to S140 as described above.

[0104] The distance to the reference plane can be calculated as follows: The normal vector of the reference plane is n, and the corresponding cross-sectional distance (i.e., plane intercept) is ρ; the normal of a plane i in the plane detection result is n i , the cross-sectional distance is ρ i If n and n i If the inner product of is greater than 0, the distance between plane i and the reference plane is calculated as follows: |ρ i (n·n i )-ρ|; if n and n i If the inner product of is less than 0, the distance between plane i and the reference plane is calculated as follows: |ρ i (-n·n i )-ρ|.

[0105] Sub-step S213, taking the cylindrical surface corresponding to the smallest distance and value in the cylindrical surface detection result as the target cylindrical surface.

[0106] In this embodiment, when at least three arc weld reference points are determined, the cylindrical surface in the cylindrical surface detection result can be traversed. For the traversed cylindrical surface, the distance from each arc weld reference point to the cylindrical surface is calculated, and the sum of the distances corresponding to at least three arc weld reference points is calculated as the distance and value corresponding to the cylindrical surface. Afterwards, the distances and values ​​corresponding to each cylindrical surface in the cylindrical surface detection result can be compared, and the cylindrical surface corresponding to the smallest distance and value can be used as the target cylindrical surface. In this way, the cylindrical surface with the closest distance can be selected as the target cylindrical surface. Among them, the cylindrical surface detection result used when selecting the target cylindrical surface can be obtained based on the conventional cylindrical surface detection algorithm, or it can be obtained based on steps S110 to S140 as described above.

[0107] In this embodiment, when the first target plane and the target cylindrical surface are determined, the center position of the ellipse intersection line can be calculated in the following manner.

[0108] like Figure 3 As shown in b in the figure, a point p on the first target plane can be obtained. p The coordinates (x p ,y p ,z p ), and take this point as the first point. The general formula of the first target plane is: Ax+By+Cz+D=0. The general formula of the target cylindrical surface is: p cl =(x cl ,y cl ,z cl ) represents the coordinates of an axis point, the coordinates are known; represents the unit direction vector of the axis of the target cylindrical surface; r represents the radius of the upper and lower bases of the cylinder.

[0109] The center position can be calculated based on the principle that a straight line passing through the center of the ellipse intersection and the first point is perpendicular to the first normal vector and according to the first target plane and the axis direction vector. The specific calculation process is as follows.

[0110] Assume that the center of the ellipse intersection line between the first target plane and the target cylindrical surface is c. The axis equation is:

[0111]

[0112] Since the center c of the ellipse intersection and the first point p p The first normal vector of the straight line and the first target plane vertical, therefore, because Therefore, A*(xx p )+B*(yy p )+C*(zz p )=0, we can solve for t1, and substitute t1 into the axis equation to obtain the coordinates of the center c of the ellipse intersection (x c ,y c ,z c ).

[0113] The minor axis of the ellipse is the intersection of the ellipse and the circle passing through the center point c and parallel to the bottom surface of the cylinder, which must be perpendicular to the axial direction. Based on this principle, when the first normal vector is not parallel to the axis direction vector, the minor axis direction vector can be obtained by performing vector cross multiplication on the first normal vector and the axis direction vector. When the first normal vector is parallel to the axis direction vector, the vector perpendicular to the axis direction vector can be used as the short axis direction vector The specific calculation process is as follows. but: like You can choose any one The perpendicular vector is used as the minor axis direction vector In getting the short axis direction vector In the case of Calculate the major axis direction vector

[0114] The bottom radius r of the cylindrical surface corresponding to the target cylindrical surface can also be used as the semi-minor axis length b, that is, b=r. And, the second angle between the first normal vector and the axis direction vector is calculated, and the semi-major axis length a is calculated based on the radius and the second angle. The specific calculation method of the semi-major axis length a is as follows: a=r / cosj, j represents the above-mentioned second angle,

[0115] As a possible implementation method, the above long axis direction vector and the minor axis direction vector are all unit vectors. The long axis direction vector can be and the minor axis direction vector If we regard them as unit vectors of the x and y axes of the two-dimensional rectangular coordinate system on the plane, we can get the equation of the intersection line of the ellipse as: Wherein, V represents the coordinates of the point on the intersection line of the ellipse, 0≤θ≤180°.

[0116] When detecting arc welds, if the first normal vector of the first target plane is perpendicular to the axial direction vector of the target cylindrical surface, that is, the arc intersection line is a standard circle, the arc weld can be solved using the standard equation of the space circle.

[0117] As a possible implementation, Figure 4 As shown, the method may further include steps S310 to S340 for linear weld detection.

[0118] Step S310: When a straight weld needs to be detected, a second target plane and a third target plane are determined.

[0119] In this embodiment, the second target plane and the third target plane can be randomly determined from the plane detection result obtained based on the object point cloud of the target object. Alternatively, weld reference information can be obtained, and the second target plane and the third target plane can be determined from the plane detection result based on the weld reference information. The plane detection result can be obtained based on a conventional plane detection algorithm, or can be obtained based on steps S110 to S140 as described above.

[0120] As a possible implementation, similar to the method of determining the first target plane and the target cylindrical surface, when a linear weld needs to be detected, the coordinates of at least two linear weld reference points can be obtained according to the weld reference information. The coordinates of the linear weld reference points are located in the coordinate system used by the object point cloud.

[0121] Optionally, the weld reference information may include the coordinates of at least two initial reference points manually specified on the object model. According to the coordinates of the at least two initial reference points and the conversion distance obtained in steps S201 to S202, the straight weld reference points corresponding to the initial reference points may be obtained. In this way, the position of the required single straight weld may be determined based on the prior knowledge of the initial reference points selected on the object model.

[0122] The second target plane and the third target plane may be selected from the plane detection result according to the coordinates of the at least two initial reference points. Optionally, the second target plane and the third target plane may be selected in the following manner.

[0123] The at least two linear weld reference points may include two points P and Q, one of which may be a starting point and the other may be an end point. The first distance d1 between each plane point P in the plane detection result may be calculated, and the plane detection in the plane detection result may be sorted in order of the first distance d1 from small to large to obtain a sorting result. The first plane in the sorting result is taken as candidate plane 1, that is, the plane corresponding to the smallest first distance d1 is taken as candidate plane 1. Then, traversal is performed starting from the second plane in the sorting result, and the angle between the normal of the current plane and the normal of the candidate plane 1 is calculated in sequence. If the angle is greater than a preset value, the traversal is stopped and the plane is taken as candidate plane 2. Afterwards, the plane located after candidate plane 2 in the sorting result is continued to be traversed. For the traversed plane, the angle 1 between the normal of the plane and the normal of candidate plane 1 and the angle 2 between the normal of the plane and the normal of candidate plane 2 are calculated. If both the angles 1 and 2 are greater than the preset value, the plane is taken as candidate plane 3. Finally, the distances from each of the candidate planes 1-3 to the point Q are calculated to obtain three distances, and the candidate planes corresponding to the two smaller distances among the three distances are used as the first target plane and the second target plane.

[0124] Step S320: Calculate the direction vector of the target linear weld according to the second normal vector of the second target plane and the third normal vector of the third target plane.

[0125] Step S330: determining an auxiliary straight line according to the second point on the second target plane and the direction vector of the target straight line weld.

[0126] The auxiliary straight line passes through the second point and is perpendicular to the direction vector of the target straight line weld.

[0127] Step S340, calculating the intersection position of the auxiliary straight line and the target straight line weld according to the third point, the second point and the auxiliary straight line on the third target plane.

[0128] like Fig.10 As shown, let the second target plane (i.e. Fig.10 Plane 2 in the middle) and the third target plane (i.e. Fig.10 The plane 3) in the figure intersects at the straight line L0. Let the expression of the intersection line of the two space planes be: The second normal vector of the second target plane is The coordinates of a point (i.e., the second point) p on the second target plane are known; the third normal vector of the third target plane is The coordinates of a point s on the third target plane (i.e., the third point) are known. There are two unknown quantities that need to be calculated: one is the direction vector The other is the intersection point G = (x0, y0, z0).

[0129] First, the direction vector of the target straight weld can be calculated as follows: because With the second normal vector Perpendicular to the third normal vector vertical, so

[0130] Next, the coordinates of the intersection point G are calculated.

[0131] We can first start from point p in the second target plane and draw a perpendicular line to line l0 to obtain auxiliary line L1, with the perpendicular point G. Then we have Therefore, the direction vector of the auxiliary straight line L1 is: Then the auxiliary straight line L1 is

[0132] Next, we can take a point s in the third target plane, and the distance from point p to the third target plane is: Then we have: Among them, based on the straight line expression It can be seen that the ratio of the difference between the coordinates of any two points on the straight line on the X-axis and the X-axis component of the straight line direction vector is a constant. The Y-axis and Z-axis can also be concluded from this. (l2, m2, n2) is a unit vector, so: It can be seen that the length of pG is a constant, which is the t2 to be solved. D1 represents the line segment pp', and p' is the vertical projection point of p in the third target plane.

[0133] Among them, the direction vector of the auxiliary straight line L1 The third normal vector of the third target plane can be a unit vector, then the intersection point G is

[0134] In this way, the linear weld information can be processed and obtained, and the linear weld information includes the intersection position and the direction vector of the target linear weld.

[0135] Optionally, when the target linear weld actually required is only a part of the calculated linear intersection, the target linear weld can be determined from the linear intersection in combination with other conditions, for example, by combining the start point and the end point specified on the linear intersection.

[0136] As a possible implementation, when the elliptical weld information is obtained, the distance between the arc reference weld point and the elliptical intersection line indicated by the elliptical weld information can be calculated. If the distance is less than a preset distance value, it can be determined that the correct elliptical weld information has been obtained. In the welding scene, the welder can be controlled to weld based on the elliptical weld information. If the distance is not less than the preset distance value, the initial reference point can be reselected to perform weld detection again.

[0137] Similarly, when the linear weld information is obtained, the distance between the linear weld reference point and the linear intersection indicated by the linear weld information can be calculated. If the distance is less than the preset distance value, it can be determined that the correct linear weld information is obtained. In the welding scene, the welder can be controlled to weld based on the linear weld information. If the distance is not less than the preset distance value, the initial reference point can be reselected to perform weld detection again.

[0138] After the welding of a single weld of the target object is completed, the required welds can be re-determined and then the corresponding weld inspection can be performed to complete the welding of all welds of the target object.

[0139] The linear weld detection method and arc weld detection method provided in the embodiments of the present application can broaden the application scenarios. All workpieces composed of planes and cylinders can be located by the weld detection method provided in the embodiments of the present application. Moreover, in the present embodiment, the positioning of the weld depends on point cloud data rather than image data. Generally speaking, the point cloud data of smart cameras is dense, and the amount of data can reach millions. Therefore, the calculation accuracy of the position is high and is less affected by ambient light. At the same time, the method provided in the embodiments of the present application has lower requirements for the workpiece than the positioning sensor and has stronger versatility.

[0140] In order to perform the corresponding steps in the above embodiments and various possible methods, a method for implementing a weld detection device is given below. Optionally, the weld detection device can adopt the above Figure 1 The device structure of the electronic device 100 is shown. It should be noted that the basic principle and technical effects of the weld detection device provided in this embodiment are the same as those of the above embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiments.

[0141] Please refer to Fig.11 , Fig.11 This is one of the block diagrams of the weld detection device 200 provided in the embodiment of the present application. In this embodiment, the weld detection device 200 may include: a determination module 240 and a processing module 250.

[0142] The determination module 240 is used to determine a first target plane and a target cylindrical surface when arc weld detection is required, wherein the first target plane and the target cylindrical surface are obtained based on the object point cloud of the target object.

[0143] The processing module 250 is used to calculate the center position of the ellipse intersection line between the first target plane and the target cylindrical surface according to the axis direction vectors of the first target plane and the target cylindrical surface.

[0144] The processing module 250 is further configured to calculate a minor axis direction vector and a major axis direction vector of the ellipse intersection line according to a first normal vector of the first target plane and the axis direction vector.

[0145] The processing module 250 is further used to obtain the semi-minor axis length and the semi-major axis length of the ellipse intersection line according to the first normal vector, the axis direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface. The ellipse weld information obtained by the weld detection includes the center position, the minor axis direction vector, the major axis direction vector, the semi-minor axis length and the semi-major axis length.

[0146] Please refer to Fig.12 , Fig.12 The second block diagram of the weld detection device provided in the embodiment of the present application. In this embodiment, the weld detection device may further include an update module 210 .

[0147] The updating module 210 is used for: for each initial cylindrical surface in the initial cylindrical surface detection result, projecting each point cloud point in the point cloud set corresponding to the initial cylindrical surface onto the bottom surface of the cylinder corresponding to the initial cylindrical surface to obtain a plurality of projection points, wherein the initial cylindrical surface detection result is obtained by performing cylindrical surface detection on the object point cloud; calculating a plurality of first angles according to the normal vectors of each of the plurality of projection points, wherein the first angle is the angle between the normal vectors of two projection points; judging whether the initial cylindrical surface is a plane according to the plurality of first angles; and updating the initial plane detection result and the initial cylindrical surface detection result according to the judgment results corresponding to each initial cylindrical surface to obtain a cylindrical surface detection result and a plane detection result, wherein the initial plane detection result is obtained by performing plane detection on the object point cloud.

[0148] In this case, the determination module 240 is used to determine a first target plane from the plane detection result, and to determine a target cylindrical surface from the cylindrical surface detection result.

[0149] Please refer to Fig.13 , Fig.13 The third block diagram of the weld detection device 200 provided in the embodiment of the present application. In this embodiment, the weld detection device 200 may further include a registration module 220 .

[0150] The registration module 220 is used to: obtain the object point cloud of the target object and obtain the model point cloud of the object model corresponding to the target object, wherein the object point cloud is the point cloud obtained by performing point cloud collection on the target object; and obtain a transformation matrix by registering the object point cloud and the model point cloud.

[0151] The determination module 240 is specifically used to: determine at least three arc weld reference points according to the obtained weld reference information, wherein, in the case where the arc weld needs to be detected, the weld reference information is used to indicate the reference position of the arc weld to be detected; take the plane closest to the reference plane and parallel to the reference plane in the plane detection result as the first target plane, wherein the reference plane is the plane where at least three arc weld reference points are located, and the plane detection result is obtained by plane detection of the object point cloud; take the cylindrical surface corresponding to the smallest distance and value in the cylindrical surface detection result as the target cylindrical surface, wherein the distance and value is the sum of the distances between each arc weld reference point and the cylindrical surface, and the cylindrical surface detection result is obtained by cylindrical surface detection of the object point cloud. Wherein, the weld reference information includes the positions of at least three initial reference points located on the object model, and the determination module 240 obtains the at least three arc weld reference points according to the weld reference information and the transformation matrix.

[0152] Please refer to Fig.14 , Fig.14 The fourth block diagram of the weld detection device 200 provided in the embodiment of the present application. In this embodiment, the weld detection device 200 may further include a judgment module 230.

[0153] The judgment module 230 is used to determine whether a circular arc weld or a linear weld needs to be detected based on the obtained weld reference information, wherein the weld reference information is used to indicate whether the weld to be detected is a linear weld or a circular arc weld.

[0154] In this embodiment, the determination module 240 is further used to: determine the second target plane and the third target plane when it is necessary to detect the linear weld, wherein the second target plane and the third target plane are obtained based on the object point cloud. The processing module 250 is further used to: calculate the direction vector of the target linear weld according to the second normal vector of the second target plane and the third normal vector of the third target plane; determine the auxiliary straight line according to the second point on the second target plane and the direction vector of the target linear weld, wherein the auxiliary straight line passes through the second point and is perpendicular to the direction vector of the target linear weld; calculate the intersection position of the auxiliary straight line and the target linear weld according to the third point, the second point and the auxiliary straight line on the third target plane, wherein the obtained linear weld information includes the intersection position and the direction vector of the target linear weld.

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

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

[0157] In summary, the embodiments of the present application provide a weld detection method, device, electronic device and readable storage medium. When it is necessary to detect an arc weld, first determine the first target plane and target cylindrical surface required for detection, and the first target plane and target cylindrical surface are obtained based on the object point cloud of the target object; then, based on the axis direction vectors of the first target plane and the target cylindrical surface, calculate the center position of the ellipse intersection line between the first target plane and the target cylindrical surface; and, according to the first normal vector and the axis direction vector of the first target plane, calculate the minor axis direction vector and the major axis direction vector of the ellipse intersection line; and, according to the first normal vector, the axis direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, obtain the semi-minor axis length and the semi-major axis length of the ellipse intersection line. In this way, the ellipse weld position information for indicating the detected ellipse weld can be obtained, and the ellipse weld information includes the above-mentioned center position, minor axis direction vector, major axis direction vector, semi-minor axis length and semi-major axis length. In this way, elliptical welds on objects with different structures can be identified, with strong versatility and high calculation accuracy, and there is no need to set up positioning sensors to assist in weld identification.

[0158] In several 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 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 flowchart, and the combination of boxes in the block diagram and / or 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.

[0159] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0160] 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 can be essentially or partly embodied in the form of a software product that contributes to the prior art. 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 methods 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.

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

Claims

1. A weld detection method, characterized in that: The method comprises: In the case where arc welds need to be detected, a first target plane and a target cylindrical surface are determined, wherein the first target plane and the target cylindrical surface are obtained based on an object point cloud of a target object; Calculating the center position of the ellipse intersection line between the first target plane and the target cylindrical surface according to the axial direction vectors of the first target plane and the target cylindrical surface; Calculating the minor axis direction vector and the major axis direction vector of the ellipse intersection line according to the first normal vector of the first target plane and the axis direction vector; According to the first normal vector, the axial direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, the semi-minor axis length and the semi-major axis length of the elliptical intersection line are obtained, wherein the elliptical weld information obtained by weld detection includes the center position, the minor axis direction vector, the major axis direction vector, the semi-minor axis length and the semi-major axis length.

2. The method according to claim 1, characterized in that In the case where the arc weld needs to be detected, before determining the first target plane and the target cylindrical surface, the method further includes: For each initial cylindrical surface in the initial cylindrical surface detection result, project each point cloud point in the point cloud set corresponding to the initial cylindrical surface onto the bottom surface of the cylinder corresponding to the initial cylindrical surface to obtain a plurality of projection points, wherein the initial cylindrical surface detection result is obtained by performing cylindrical surface detection on the object point cloud; Calculate a plurality of first angles according to respective normal vectors of the plurality of projection points, wherein the first angle is an angle between normal vectors of two projection points; According to the multiple first included angles, determining whether the initial cylindrical surface is a plane; According to the judgment results corresponding to each initial cylindrical surface, the initial plane detection result and the initial cylindrical surface detection result are updated to obtain a cylindrical surface detection result and a plane detection result, wherein the initial plane detection result is obtained by performing plane detection on the object point cloud; The step of determining the first target plane and the target cylindrical surface includes: A first target plane is determined from the plane detection result, and a target cylindrical surface is determined from the cylindrical surface detection result.

3. The method according to claim 2, characterized in that The step of judging whether the initial cylindrical surface is a plane according to the plurality of first included angles includes: Selecting a first angle greater than a first preset angle from the plurality of first angles as a first selected angle; Determining a preset number of first angles to be selected from the selected first angles to be selected as first angles to be used; Calculate an average value of the determined first angle to be used, and determine whether the average value is greater than a second preset angle, wherein the second preset angle is greater than the first preset angle; If the average value is greater than the second preset angle, the initial cylindrical surface is determined to be a cylindrical surface; If the average value is not greater than the second preset angle, the initial cylindrical surface is determined to be a plane.

4. The method according to claim 1, characterized in that: The step of determining the first target plane and the target cylindrical surface includes: Determine at least three arc weld reference points according to the obtained weld reference information, wherein, when the arc weld needs to be detected, the weld reference information is used to indicate a reference position of the arc weld to be detected; The plane closest to the reference plane in the plane detection result is used as the first target plane, wherein the reference plane is a plane where at least three arc weld reference points are located, and the plane detection result is obtained by performing plane detection on the object point cloud; The cylindrical surface corresponding to the smallest distance and value in the cylindrical surface detection result is taken as the target cylindrical surface, wherein the distance and value is the sum of the distances between each arc weld reference point and the cylindrical surface, and the cylindrical surface detection result is obtained by performing cylindrical surface detection on the object point cloud.

5. The method according to claim 4, characterized in that The method further comprises: Obtaining the object point cloud of the target object and obtaining a model point cloud of an object model corresponding to the target object, wherein the object point cloud is a point cloud obtained by performing point cloud acquisition on the target object; By registering the object point cloud and the model point cloud, a transformation matrix is ​​obtained; The weld reference information includes positions of at least three initial reference points on the object model, and the at least three arc weld reference points are determined based on the obtained weld reference information, including: According to the weld reference information and the conversion matrix, the at least three arc weld reference points are obtained.

6. The method according to claim 1, characterized in that In the case where the arc weld needs to be detected, before determining the first target plane and the target cylindrical surface, the method further includes: According to the obtained weld reference information, it is determined that an arc weld or a straight weld needs to be detected, wherein the weld reference information is used to indicate that the weld to be detected is a straight weld or an arc weld.

7. The method according to claim 1, characterized in that The calculating the center position of the ellipse intersection line between the first target plane and the target cylindrical surface according to the axial direction vector of the first target plane and the target cylindrical surface comprises: calculating the center position according to the first target plane and the axial direction vector based on the straight line passing through the center of the ellipse intersection line and the first point being perpendicular to the first normal vector, wherein the first point is located on the first target plane; and / or, The method of calculating the short axis direction vector and the long axis direction vector of the ellipse intersection line according to the first normal vector of the first target plane and the axis direction vector comprises: when the first normal vector is not parallel to the axis direction vector, obtaining the short axis direction vector by performing vector cross multiplication on the first normal vector and the axis direction vector; when the first normal vector is parallel to the axis direction vector, taking the vector perpendicular to the axis direction vector as the short axis direction vector; and / or, The method of obtaining the semi-minor axis length and the semi-major axis length of the ellipse intersection line according to the first normal vector, the axial direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface includes: taking the radius as the semi-minor axis length; calculating the second angle between the first normal vector and the axial direction vector, and calculating the semi-major axis length according to the radius and the second angle.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: In the case where a straight weld needs to be detected, a second target plane and a third target plane are determined, wherein the second target plane and the third target plane are obtained based on the object point cloud; Calculating a direction vector of a target straight weld according to a second normal vector of the second target plane and a third normal vector of the third target plane; Determine an auxiliary straight line according to a second point on the second target plane and the direction vector of the target straight line weld, wherein the auxiliary straight line passes through the second point and is perpendicular to the direction vector of the target straight line weld; According to the third point, the second point and the auxiliary straight line on the third target plane, the intersection position of the auxiliary straight line and the target straight line weld is calculated, wherein the obtained straight line weld information includes the intersection position and the direction vector of the target straight line weld.

9. A weld detection device, characterized in that: The device comprises: A determination module, used for determining a first target plane and a target cylindrical surface when arc weld detection is required, wherein the first target plane and the target cylindrical surface are obtained based on an object point cloud of a target object; A processing module, configured to calculate a center position of an ellipse intersection line between the first target plane and the target cylindrical surface according to the axis direction vectors of the first target plane and the target cylindrical surface; The processing module is further used to calculate the short axis direction vector and the long axis direction vector of the ellipse intersection line according to the first normal vector of the first target plane and the axis direction vector; The processing module is also used to obtain the semi-minor axis length and semi-major axis length of the elliptical intersection line based on the first normal vector, the axial direction vector and the radius of the bottom surface of the cylinder corresponding to the target cylindrical surface, wherein the elliptical weld information obtained by weld detection includes the center position, the minor axis direction vector, the major axis direction vector, the semi-minor axis length and the semi-major axis length.

10. An electronic device, characterized in that: It comprises 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 detection method described in any one of claims 1-8.

Citation Information

Patent Citations

  • A method for phased array ultrasonic beam coverage of TKY pipe joint weld seam

    CN102288681A

  • Method for extracting opening amount of shield tunnel segments based on point cloud data

    CN110375722A

  • Intersecting line welding seam detection and trajectory optimization system and method based on structured light camera

    CN117300464A

  • Circular pipe intersecting line welding seam treatment method and device and storage medium

    CN117934432A

  • Image recognition method and apparatus, and computer-readable storage medium

    US20230245457A1

Cited By

  • Improved three-face structure welding seam searching method and device and electronic equipment

    CN118734495A

  • Arc welding seam extraction method and device

    CN118762038A