Welding quality detection track point normal vector estimation method, device, equipment and medium

CN118115474BActive Publication Date: 2026-10-09INNER MONGOLIA UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410303560.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2026-10-09
Estimated Expiration
2044-03-18

AI Technical Summary

Technical Problem

在已有的计算点云法线的方法中,基于最小二乘法的点云法线计算方法因其高效准确而被广泛使用,然而,基于最小二乘法的点云法线计算方法的精度较低,导致焊缝质量检测结果不准确,无法满足用户的需求

Benefits of technology

[0062] The welding quality inspection trajectory point normal vector estimation method provided by the present invention obtains a quadratic surface by fitting point cloud data, and then calculates the normal vector based on the quadratic surface, which improves the estimation accuracy of the normal vector at the junction of irregular structure welds and other surfaces of welded parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118115474B_ABST
    Figure CN118115474B_ABST
Patent Text Reader

Abstract

The present application provides a welding quality detection track point normal vector estimation method, device, equipment and medium, the method comprises: selecting a first target point from the point cloud data of a welded part and searching for a plurality of initial points in the neighborhood of the first target point; determine a plurality of second target points closest to each initial point to form a small neighborhood; use the least square method to fit each small neighborhood, get a plurality of planes, take the normal vector of each plane as the target normal vector of the initial point in each plane, use the angle consistency to judge whether the plurality of target normal vectors meet the requirements, if it meets, determine the initial fitting position of the target point set according to the first target point and the initial point, generate a fitting surface according to the initial fitting position, and calculate the target normal vector according to the fitting surface. The present application fits a quadratic surface through point cloud data, and then calculates the normal vector according to the quadratic surface, which improves the estimation accuracy of the normal vector at the junction of the special-shaped structure weld and other surfaces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of welding and weld inspection technology, and in particular to a method, apparatus, equipment and medium for estimating the normal vector of welding quality inspection trajectory points. Background Technology

[0002] Before robotic arms can assist in the automated inspection of weld quality in welded components using ultrasonic phased arrays, calculating the preset detection normal vector of the weldment to be inspected is an urgent problem to be solved. This is because some scholars have clearly pointed out that the detected defects are only accurate when the ultrasonic beam axis coincides with the normal vector of the weldment. Among existing methods for calculating point cloud normals, the least squares method is widely used due to its efficiency and accuracy. However, the accuracy of the least squares method is relatively low, resulting in inaccurate weld quality inspection results that cannot meet user needs. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to overcome the shortcomings of the prior art and provide a method, apparatus, equipment and medium for estimating the normal vector of welding quality inspection trajectory points.

[0004] This invention provides the following technical solution:

[0005] Firstly, this application provides a method for estimating the normal vector of welding quality inspection trajectory points, including:

[0006] Obtain point cloud data of the welded part, select a first target point from the point cloud data, and use the KD tree method to search for multiple initial points in the neighborhood of the first target point;

[0007] Multiple second target points are determined corresponding to each initial point. Multiple small neighborhoods are obtained by forming small neighborhoods based on each initial point and its corresponding second target point. The multiple second target points corresponding to each initial point are the multiple points that are closest to each initial point.

[0008] The least squares method is used to fit within each small neighborhood to obtain multiple planes. The normal vector of each plane is used as the target normal vector of the initial point in each plane. The initial fitting position of the target point set is determined based on the multiple target normal vectors. The target point set is the set of the first target point and the initial point.

[0009] Calculate the surface equation based on the target point set, generate a fitted surface based on the surface equation, calculate the distance between multiple target neighbor points of each target point and the fitted surface, and record the target neighbor points whose distance does not meet the preset distance.

[0010] For the minimum cuboid circumscribed by the target neighbor, obtain the projection point cloud of the maximum face projection of the minimum cuboid, use the edge detection method to obtain the edge points of the projection point cloud, and use back projection to obtain the contour points of the target neighbor based on the edge points.

[0011] A quadratic surface is generated based on the points within the contour points of the target neighboring points. A normal vector expression is obtained based on the quadratic surface. Each point in the point cloud data is substituted into the normal vector expression to obtain the normal vector of each point. The target normal vector is calculated based on the normal vector of each point.

[0012] In one embodiment, determining the initial fitting position of the target point set based on the plurality of target normal vectors includes:

[0013] Let the normal vector of each point in the target point set be:

[0014] n i =(x i ,y i ,z i ),

[0015] The formula for calculating the angle between point i and the j-th point closest to point i is:

[0016] θ ij =arccos[(n i ·n j ) / (|n i |*|n j |)],

[0017] The size of the included angle determines whether the target point set meets the initial fitting position requirements.

[0018] In one embodiment, determining whether the target point set meets the initial fitting position requirements based on the size of the included angle includes:

[0019] Determine the formula for calculating the consistency of the included angle:

[0020]

[0021] If max(consis(θ) i If the initial point is greater than 1.05, then the initial point is reselected.

[0022] If max(consis(θ) i If the initial value is less than or equal to 1.05, then the position of the initial point is taken as the initial fitting position.

[0023] In one embodiment, calculating the surface equation based on the target point set includes:

[0024] Let the formula for the fitted surface equation be:

[0025]

[0026] Where A, B, C, D, E, F, G, H, I, and J are all coefficients;

[0027] Substituting each of the initial fitting positions into the surface equation formula yields multiple surface equation formulas;

[0028] The least squares method is used to solve multiple surface equations to obtain the values ​​of coefficients A, B, C, D, E, F, G, H, I, and J, as well as the surface equations.

[0029] In one embodiment, calculating the distances between multiple target neighbors of each target point and the fitted surface includes:

[0030] Calculate the distance from each of the initial fitting positions to the fitted surface:

[0031]

[0032]

[0033] Among them, D k ε is the average distance from the initial fitting position to the fitting surface, and ε is the maximum distance.

[0034] In one embodiment, recording the target neighbor points whose distance does not meet the preset distance includes:

[0035] Continuously select the nth nearest neighbor of the first target point, and calculate the distance from the nth nearest neighbor to the fitted surface:

[0036]

[0037] If d≤D k If +ε, then determine that the nth nearest neighbor point belongs to the fitted surface, and update D. k and ε:

[0038]

[0039] Among them, D k+1 For the updated D k If d > ε, then let the new ε = d;

[0040] If d > D k If +ε, then record the coordinates of the nth nearest neighbor.

[0041] When the 2n nearest neighbor point is found to belong to the fitted surface, the fitted surface is refitted using the least squares method to obtain a quadratic surface.

[0042] When none of the 2n consecutive nearest neighbors belong to the quadratic surface, the coefficients of the quadratic surface and the target neighbors in the point cloud that belong to the quadratic surface are recorded. The target neighbors are then removed from the point cloud data, and the removed target neighbors are recorded as follows:

[0043]

[0044] In one embodiment, recording the target neighbor points whose distance does not meet the preset distance includes:

[0045] Select a second initial point, which includes multiple sets of second initial points, but does not include the first initial point;

[0046] Determine whether the second initial point has already been selected;

[0047] If the second initial point has not been selected, then based on the second initial point, identify the second target neighbor that meets the preset distance and the third target neighbor that does not meet the preset distance, and remove the third target neighbor; the third target neighbor includes multiple groups;

[0048] If the second initial point has already been selected, then the removal of the third target neighbor point is terminated, and the removed third target neighbor point is recorded as follows:

[0049]

[0050]

[0051] Where L represents the Lth quadratic surface.

[0052] Secondly, this application provides a device for estimating the normal vector of welding quality inspection trajectory points, including:

[0053] The acquisition module is used to acquire point cloud data of the welded part, select a first target point from the point cloud data, and use the KD tree method to search for multiple initial points in the neighborhood of the first target point.

[0054] The determination module is used to determine a plurality of second target points corresponding to each initial point, and to obtain a plurality of small neighborhoods by forming a small neighborhood between each initial point and the corresponding second target point; the plurality of second target points corresponding to each initial point are the plurality of points closest to each initial point;

[0055] The fitting module is used to fit each small neighborhood using the least squares method to obtain multiple planes, and uses the normal vector of each plane as the target normal vector of the initial point in each plane. The initial fitting position of the target point set is determined based on the multiple target normal vectors; the target point set is the set of the first target point and the initial point.

[0056] The calculation module is used to calculate the surface equation based on the target point set, generate a fitted surface based on the surface equation, calculate the distance between multiple target neighbor points of each target point and the fitted surface, and record the target neighbor points whose distance does not meet the preset distance.

[0057] The projection module is used to circumscribe a minimum cuboid for the target neighbor point, obtain the projection point cloud of the maximum face projection of the minimum cuboid, obtain the edge points of the projection point cloud using the edge detection method, and obtain the contour points of the target neighbor point by back projection based on the edge points.

[0058] The generation module is used to generate a quadratic surface based on the points within the contour points of the target neighboring points, obtain a normal vector expression based on the quadratic surface, substitute each point in the point cloud data into the normal vector expression to obtain the normal vector of each point, and calculate the target normal vector based on the normal vector of each point.

[0059] Thirdly, this application provides a computer device including a memory and at least one processor, the memory storing a computer program, and the processor executing the computer program to implement the welding quality inspection trajectory point normal vector estimation method as described in the first aspect.

[0060] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed, implements the welding quality inspection trajectory point normal vector estimation method as described in the first aspect.

[0061] The embodiments of the present invention have the following beneficial effects:

[0062] The welding quality inspection trajectory point normal vector estimation method provided by the present invention obtains a quadratic surface by fitting point cloud data, and then calculates the normal vector based on the quadratic surface, which improves the estimation accuracy of the normal vector at the junction of irregular structure welds and other surfaces of welded parts.

[0063] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0064] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0065] Figure 1 A schematic diagram of the method for estimating the normal vector of welding quality inspection trajectory points is shown.

[0066] Figure 2 A flowchart illustrating a method for determining a target point set is shown.

[0067] Figure 3 A schematic diagram of a method for calculating surface equations is shown.

[0068] Figure 4 A schematic diagram of the frame structure of the welding quality inspection trajectory point normal vector estimation device is shown.

[0069] Explanation of key component symbols:

[0070] 400. Welding quality inspection trajectory point normal vector estimation device; 401. Acquisition module; 402. Determination module; 403. Fitting module; 404. Calculation module; 405. Projection module; 406. Generation module. Detailed Implementation

[0071] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0072] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the template description is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0074] Example 1

[0075] See Figure 1 , Figure 1 A schematic diagram of a method for estimating the normal vector of welding quality inspection trajectory points is shown. This estimation method can be used to estimate the normal vector at the interface between welds on irregular structures and other surfaces. The method includes:

[0076] S101. Obtain point cloud data of the welded part, select a first target point from the point cloud data, and use the KD tree method to search for multiple initial points in the neighborhood of the first target point.

[0077] The point cloud data includes the point cloud data of the entire welded workpiece, such as weld point cloud and normal point cloud. Assuming the total number of point clouds is N, a point is randomly selected from the N points as the first target point. Then, the KD tree method is used to find 49 points in its neighborhood as initial points. Users can also determine the number of initial points according to their needs.

[0078] KD-trees, or k-dimensional trees, are tree-structured data methods used to store instances in a k-dimensional space for fast retrieval. They are primarily applied to searching for key data in multidimensional space (e.g., range search and nearest neighbor search). KD-trees are a special case of binary space partitioning trees.

[0079] S102. Determine multiple second target points corresponding to each initial point, and obtain multiple small neighborhoods by forming a small neighborhood between each initial point and the corresponding second target point; the multiple second target points corresponding to the initial point are the multiple points closest to each initial point.

[0080] Based on the 49 initial points in the neighborhood of the first target point, find the 5 points closest to each initial point as the second target point, and form a small neighborhood with each initial point and its corresponding second target point to obtain 49 small neighborhoods, each containing six points.

[0081] S103. Fit each small neighborhood using the least squares method to obtain multiple planes. Use the normal vector of each plane as the target normal vector of the initial point in each plane. Determine the initial fitting position of the target point set based on the multiple target normal vectors. The target point set is the set of the first target point and the initial point.

[0082] The least squares method is used to fit six points in each small neighborhood to form a plane, resulting in 49 planes, each containing an initial point. The normal vector of each plane is used as the normal vector of the initial point in that plane. Then, based on the angle between the 49 normal vectors, it is determined whether to select these 50 points as the initial fitting positions.

[0083] See Figure 2 Step S103 includes:

[0084] S1031. Let the normal vector of each point in the target point set be:

[0085] n i =(x i ,y i ,z i ),

[0086] S1032, the formula for calculating the angle between the i-th point and the j-th point closest to the i-th point is:

[0087] θ ij =arccos[(n i ·n j ) / (|n i |*|n j |)],

[0088] S1033. Determine whether the target point set meets the initial fitting position requirements based on the size of the included angle.

[0089] Determine the formula for calculating the consistency of the included angle:

[0090]

[0091] If max(consis(θ) i If the initial point is greater than 1.05, then the initial point is reselected.

[0092] To improve the speed of finding the initial fitting position, the 50th nearest neighbor of the previously randomly selected point is used as a new random point. A new 49 points within its neighborhood are found using the KD-tree method, where none of these new 49 points are points used in previous iterations. This process is repeated until a suitable initial fitting position is found.

[0093] If max(consis(θ) i If the initial value is less than or equal to 1.05, then the position of the initial point is taken as the initial fitting position.

[0094] S104. Calculate the surface equation based on the target point set, generate a fitted surface based on the surface equation, calculate the distance between multiple target neighbor points of each target point and the fitted surface, and record the target neighbor points whose distance does not meet the preset distance.

[0095] See Figure 3 Step S104 includes:

[0096] S1041. Let the formula for the fitted surface equation be:

[0097]

[0098] Where A, B, C, D, E, F, G, H, I, and J are all coefficients;

[0099] S1042. Substitute each of the initial fitting positions into the surface equation formula to obtain multiple surface equation formulas.

[0100] That is, by substituting the 50 points that meet the initial fitting position into the surface equation formula, 50 surface equation formulas are obtained.

[0101] S1043. Solve the multiple surface equation formulas using the least squares method to obtain the values ​​of coefficients A, B, C, D, E, F, G, H, I, J and the surface equations.

[0102] That is, the least squares method is used to solve the 50 surface equations to obtain the values ​​of coefficients A, B, C, D, E, F, G, H, I, and J, as well as the surface equations.

[0103] Calculate the distance from each of the initial fitting positions to the fitted surface:

[0104]

[0105]

[0106] Among them, D k ε is the average distance from the initial fitting position to the fitted surface, and ε is the maximum distance.

[0107] Continuously select the nth nearest neighbor of the first target point, and calculate the distance from the nth nearest neighbor to the fitted surface:

[0108]

[0109] For example: Let n = 50, select the 50th nearest neighbor of the first target point, and calculate its distance d to the fitted surface.

[0110] If d≤D k If +ε, then determine that the nth nearest neighbor point belongs to the fitted surface, and update D. k and ε:

[0111]

[0112] Among them, D k+1 For the updated D k If d > ε, then let the new ε = d.

[0113] If d > D kIf +ε, then record the coordinates of the nth nearest neighbor and leave them unprocessed for the time being.

[0114] Repeat the above calculation process for the nth nearest neighbor point. When the 2nth nearest neighbor point is found to belong to the fitted surface, the fitted surface is refitted using the least squares method to obtain the quadratic surface.

[0115] When none of the 2n consecutive nearest neighbors belong to the quadratic surface, the coefficients of the quadratic surface and the target neighbors in the point cloud that belong to the quadratic surface are recorded. The target neighbors are then removed from the point cloud data, and the removed target neighbors are recorded as follows:

[0116]

[0117] In one implementation, recording the target neighbor points whose distance does not meet the preset distance includes:

[0118] Select a second initial point, which includes multiple sets of second initial points, but does not include the first initial point;

[0119] Determine whether the second initial point has already been selected;

[0120] If the second initial point has not been selected, then based on the second initial point, identify the second target neighbor that meets the preset distance and the third target neighbor that does not meet the preset distance, and remove the third target neighbor; the third target neighbor includes multiple groups;

[0121] If the second initial point has already been selected, it means that all points in the point cloud data have been traversed. Therefore, the removal of the third target neighbor point is terminated, and the removed third target neighbor point is recorded as follows:

[0122]

[0123]

[0124] Where L represents the Lth quadratic surface, the above method can represent a complete workpiece point cloud map using different quadratic surfaces.

[0125] S105. For the smallest cuboid circumscribed by the target neighbor, obtain the projection point cloud of the maximum face projection of the smallest cuboid, obtain the edge points of the projection point cloud using the edge detection method, and obtain the contour points of the target neighbor using back projection based on the edge points.

[0126] Using the method of Baoluo to give The smallest circumscribed cuboid is defined by its largest face. The projection surface, the projected point cloud is denoted as Then, edge detection methods are used for detection. At the edge, obtain Edge points. Finally, they are obtained through back projection. The outline in the image. Find it using the same method. The outline points.

[0127] S106. Generate a quadratic surface based on the points within the contour points of the target neighboring points, obtain a normal vector expression based on the quadratic surface, substitute each point in the point cloud data into the normal vector expression to obtain the normal vector of each point, and calculate the target normal vector based on the normal vector of each point.

[0128] Using kd-tree For each edge point, find 30 non-belonging Find the nearest neighbor points and the points to which these points belong. Since different quadric surfaces have different parameter values, it is impossible to use d to determine which quadric surface a point is closest to. Therefore, it is necessary to solve for the distance from a point on a quadric surface to its nearest neighbor.

[0129] Let the 30 nearest neighbors be respectively

[0130] To quadric surfaces The distance calculation method is as follows.

[0131] Suppose there exists a point (x0, y0, z0) in the quadratic surface at a distance from a point in space. The closest distance is (x0, y0, z0) and It must be in the direction of the normal vector.

[0132]

[0133] So

[0134]

[0135] The distance1 was determined using Newton's method.

[0136] Similarly, find arrive The distance of the corresponding quadratic surface L If distance L If -distancex < δ, then determine This is the boundary point. Otherwise, compare the distance. L And the size of distance1, will It belongs to the quadratic surface with a smaller distance.

[0137] Similarly, find It belongs to the boundary point or a quadratic surface.

[0138] Repeat the above process until all edge points of the quadratic surface have been calculated.

[0139] Since the normal vector of each point is determined by the equation of the quadratic surface to which it belongs, the normal vector of non-intersection points is calculated as follows:

[0140] Substitute the coordinates of each point in the point cloud into the corresponding normal vector expression n. k =(2Ax i +Dy i +Ez i +G, 2By i +Dx i +Fz i +H, 2Cz i +Ex i +Fy i +I), the value obtained is the normal vector of each point.

[0141] Suppose the intersection point belongs to N quadric surfaces, then the normal vector of that point is:

[0142]

[0143] This embodiment obtains a quadratic surface by fitting point cloud data, and then calculates the normal vector based on the quadratic surface, which improves the estimation accuracy of the normal vector at the junction of irregularly shaped welds and other surfaces of the welded parts.

[0144] Example 2

[0145] See Figure 4 This application also provides a welding quality inspection trajectory point normal vector estimation device 400, including:

[0146] The acquisition module 401 is used to acquire point cloud data of the welded part, select a first target point from the point cloud data, and use the KD tree method to search for multiple initial points in the neighborhood of the first target point;

[0147] The determining module 402 is used to determine a plurality of second target points corresponding to each initial point, and to obtain a plurality of small neighborhoods based on each initial point and the corresponding second target point forming a small neighborhood; the plurality of second target points corresponding to each initial point are the plurality of points closest to each initial point;

[0148] The fitting module 403 is used to fit each small neighborhood using the least squares method to obtain multiple planes, and to use the normal vector of each plane as the target normal vector of the initial point in each plane, and to determine the initial fitting position of the target point set based on the multiple target normal vectors; the target point set is the set of the first target point and the initial point.

[0149] The calculation module 404 is used to calculate the surface equation based on the target point set, generate a fitted surface based on the surface equation, calculate the distance between multiple target neighbor points of each target point and the fitted surface, and record the target neighbor points whose distance does not meet the preset distance.

[0150] Projection module 405 is used to circumscribe a minimum cuboid for the target neighbor point, obtain the projection point cloud of the maximum face projection of the minimum cuboid, obtain the edge points of the projection point cloud using an edge detection method, and obtain the contour points of the target neighbor point by back projection based on the edge points.

[0151] The generation module 406 is used to generate a quadratic surface based on the points within the contour points of the target neighboring point, obtain a normal vector expression based on the quadratic surface, substitute each point in the point cloud data into the normal vector expression to obtain the normal vector of each point, and calculate the target normal vector based on the normal vector of each point.

[0152] The welding quality inspection trajectory point normal vector estimation device provided in this embodiment obtains a quadratic surface by fitting point cloud data, and then calculates the normal vector based on the quadratic surface, which improves the estimation accuracy of the normal vector at the junction of irregular structure welds and other surfaces.

[0153] It is understood that the implementation method of the welding quality inspection trajectory point normal vector estimation method described in Embodiment 1 above is also applicable to this embodiment, so it will not be described again here.

[0154] Example 3

[0155] This application also provides a computer device, which may be, but is not limited to, a desktop computer, a laptop, etc. Its form is not limited, mainly depending on whether it needs to support the interface display function of a web browser. Exemplarily, the computer device includes a memory and at least one processor. The memory stores a computer program, and the processor executes the computer program to implement the welding quality inspection trajectory point normal vector estimation method described in Embodiment 1 above.

[0156] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0157] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM). The memory stores computer programs, and the processor, upon receiving execution instructions, can execute the computer programs accordingly.

[0158] Furthermore, the memory may include a stored program area and a stored data area, wherein the stored program area may store the operating system and application programs required for at least one function; the stored data area may store data created based on the use of the computer device (such as iterative data, version data, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0159] Example 4

[0160] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and run by a processor, the computer-executable instructions cause the processor to run the welding quality inspection trajectory point normal vector estimation method described in Embodiment 1 above.

[0161] It is understood that the implementation method of the welding quality inspection trajectory point normal vector estimation method described in Embodiment 1 above is also applicable to this embodiment, so it will not be described again here.

[0162] The computer-readable storage medium can be either a non-volatile storage medium or a volatile storage medium. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0163] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0164] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0165] If the aforementioned functions are implemented as software functional 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 this application, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0166] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

[0167] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values.

[0168] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0169] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for estimating the normal vector of welding quality inspection trajectory points, characterized in that, include: Obtain point cloud data of the welded part, select a first target point from the point cloud data, and use the KD tree method to search for multiple initial points in the neighborhood of the first target point; Multiple second target points are determined corresponding to each initial point. Multiple small neighborhoods are obtained by forming small neighborhoods based on each initial point and its corresponding second target point. The multiple second target points corresponding to each initial point are the multiple points that are closest to each initial point. The least squares method is used to fit within each small neighborhood to obtain multiple planes. The normal vector of each plane is used as the target normal vector of the initial point in each plane. The initial fitting position of the target point set is determined based on the multiple target normal vectors. The target point set is the set of the first target point and the initial point. Calculate the surface equation based on the target point set, generate a fitted surface based on the surface equation, calculate the distance between multiple target neighbor points of each target point and the fitted surface, and record the target neighbor points whose distance does not meet the preset distance. For the minimum cuboid circumscribed by the target neighbor, obtain the projection point cloud of the maximum face projection of the minimum cuboid, use the edge detection method to obtain the edge points of the projection point cloud, and use back projection to obtain the contour points of the target neighbor based on the edge points. A quadratic surface is generated based on the points within the contour points of the target neighboring points. A normal vector expression is obtained based on the quadratic surface. Each point in the point cloud data is substituted into the normal vector expression to obtain the normal vector of each point. The target normal vector is calculated based on the normal vector of each point.

2. The method for estimating the normal vector of welding quality inspection trajectory points according to claim 1, characterized in that, Determining the initial fitting position of the target point set based on multiple target normal vectors includes: Let the normal vector of each point in the target point set be: n i (x i ,y i ,z i ), The formula for calculating the angle between point i and the j-th point closest to point i is: θ ij =arccos[(n i ·n j ) / (|n i |*|n j |)], The size of the included angle determines whether the target point set meets the initial fitting position requirements.

3. The method for estimating the normal vector of welding quality inspection trajectory points according to claim 2, characterized in that, The step of determining whether the target point set meets the initial fitting position requirements based on the size of the included angle includes: Determine the formula for calculating the consistency of the included angle: If max(consis(θ) i If the initial point is greater than 1.05, then the initial point is reselected. If max(consis(θ) i If the initial value is less than or equal to 1.05, then the position of the initial point is taken as the initial fitting position.

4. The method for estimating the normal vector of welding quality inspection trajectory points according to claim 1, characterized in that, The calculation of the surface equation based on the target point set includes: Let the formula for the fitted surface equation be: Where A, B, C, D, E, F, G, H, I, and J are all coefficients; Substituting each of the initial fitting positions into the surface equation formula yields multiple surface equation formulas; The least squares method is used to solve multiple surface equations to obtain the values ​​of coefficients A, B, C, D, E, F, G, H, I, and J, as well as the surface equations.

5. The method for estimating the normal vector of welding quality inspection trajectory points according to claim 4, characterized in that, The calculation of the distances between multiple target neighbor points of each target point and the fitted surface includes: Calculate the distance from each of the initial fitting positions to the fitted surface: Among them, D k ε is the average distance from the initial fitting position to the fitting surface, and ε is the maximum distance.

6. The method for estimating the normal vector of welding quality inspection trajectory points according to claim 5, characterized in that, The target neighbor points whose recorded distance does not meet the preset distance include: Continuously select the nth nearest neighbor of the first target point, and calculate the distance from the nth nearest neighbor to the fitted surface: If d≤D k If +ε, then determine that the nth nearest neighbor point belongs to the fitted surface, and update D. k and ε: Among them, D k+1 For the updated D k If d > ε, then let the new ε = d; If d>D k If +ε, then record the coordinates of the nth nearest neighbor. When the 2n nearest neighbor point is found to belong to the fitted surface, the fitted surface is refitted using the least squares method to obtain a quadratic surface. When none of the 2n consecutive nearest neighbors belong to the quadratic surface, the coefficients of the quadratic surface and the target neighbors in the point cloud that belong to the quadratic surface are recorded. The target neighbors are then removed from the point cloud data, and the removed target neighbors are recorded as follows:

7. The method for estimating the normal vector of welding quality inspection trajectory points according to claim 6, characterized in that, The target neighbor points whose recorded distance does not meet the preset distance include: Select a second initial point, which includes multiple sets of second initial points, but does not include the first initial point; Determine whether the second initial point has already been selected; If the second initial point has not been selected, then based on the second initial point, identify the second target neighbor that meets the preset distance and the third target neighbor that does not meet the preset distance, and remove the third target neighbor; the third target neighbor includes multiple groups; If the second initial point has already been selected, then the removal of the third target neighbor point is terminated, and the removed third target neighbor point is recorded as follows: Where L represents the Lth quadratic surface.

8. A device for estimating the normal vector of welding quality inspection trajectory points, characterized in that, include: The acquisition module is used to acquire point cloud data of the welded part, select a first target point from the point cloud data, and use the KD tree method to search for multiple initial points in the neighborhood of the first target point. The determination module is used to determine a plurality of second target points corresponding to each initial point, and to obtain a plurality of small neighborhoods by forming a small neighborhood between each initial point and the corresponding second target point; the plurality of second target points corresponding to each initial point are the plurality of points closest to each initial point; The fitting module is used to fit each small neighborhood using the least squares method to obtain multiple planes, and uses the normal vector of each plane as the target normal vector of the initial point in each plane. The initial fitting position of the target point set is determined based on the multiple target normal vectors; the target point set is the set of the first target point and the initial point. The calculation module is used to calculate the surface equation based on the target point set, generate a fitted surface based on the surface equation, calculate the distance between multiple target neighbor points of each target point and the fitted surface, and record the target neighbor points whose distance does not meet the preset distance. The projection module is used to circumscribe a minimum cuboid for the target neighbor point, obtain the projection point cloud of the maximum face projection of the minimum cuboid, obtain the edge points of the projection point cloud using the edge detection method, and obtain the contour points of the target neighbor point by back projection based on the edge points. The generation module is used to generate a quadratic surface based on the points within the contour points of the target neighboring points, obtain a normal vector expression based on the quadratic surface, substitute each point in the point cloud data into the normal vector expression to obtain the normal vector of each point, and calculate the target normal vector based on the normal vector of each point.

9. A computer device, characterized in that, The computer device includes a memory and at least one processor, the memory storing a computer program, and the processor executing the computer program to implement the welding quality inspection trajectory point normal vector estimation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed, implements the method for estimating the normal vector of welding quality inspection trajectory points as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Point cloud noise reduction method and device, electronic equipment and computer readable storage medium

    CN111798398A

  • Target object point cloud feature line and surface extraction method and system

    CN113298833A