Vision-based weld length measuring method and system
By obtaining the 3D point cloud on the weld surface and segmenting and positioning, the method of calculating the characteristic points of the weld start and end positions is solved, and the problem of low measurement accuracy of weld length in the prior art is achieved, and higher measurement accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411734066.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, the measurement method of weld length has problems such as high interference and low measurement accuracy.
By obtaining the 3D point cloud on the weld surface, dividing the weld area point cloud data, positioning the feature points at the start position and the feature points at the end position of the weld, and calculate the actual length of the weld based on these feature points.
Reduce the degree of interference, improves measurement accuracy, and can calculate the weld length more accurately.
Smart Images

Figure CN119559153A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect recognition, and in particular to a vision-based weld length measurement method and system. Background Art
[0002] In industry, the quality of welds directly determines the performance of welded workpieces. Among them, the failure of weld length to meet requirements is one of the important factors affecting weld quality. A weld length that is too long will affect the assembly of workpieces after welding, while a weld length that is too short will result in insufficient workpiece connection strength. At present, factories generally use manual vernier calipers to measure weld length. Some factories also use visual methods to measure weld length, using 2D cameras to collect weld grayscale images or 3D cameras to collect weld point cloud images to measure weld length. The manual method of using vernier calipers for measurement is inefficient, has a low degree of automation, is inconvenient to operate, and has low stability when repeated measurements. Although the visual method can improve measurement efficiency and is simple to operate, the existing algorithm for length measurement using weld grayscale images is not accurate. When using a single frame point cloud in a weld point cloud image to identify the start and end positions of the weld, it is easily interfered by noise, resulting in incorrect identification, which directly affects the measured weld length value.
[0003] It can be seen that the measurement method of weld length in the prior art has the problems of high interference and low measurement accuracy. Summary of the invention
[0004] The present invention provides a vision-based weld length measurement method and system to solve the problems of large interference degree and low measurement accuracy in the prior art weld length measurement method.
[0005] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0006] In a first aspect, the present invention provides a method for measuring weld length based on vision, comprising:
[0007] S1: Get the 3D point cloud of the weld surface;
[0008] S2: Segment the weld area point cloud data from the 3D point cloud;
[0009] S3: Positioning according to the point cloud data of the weld area to obtain the characteristic points of the weld start position and the weld end position;
[0010] S4: Calculate the actual length of the weld based on the weld start position feature point and the weld end position feature point.
[0011] Optionally, S1 includes:
[0012] All point cloud data of the measured fillet weld are obtained from the 3D camera, and the original 3D point cloud x, y, z, and point cloud intensity values are saved, where the x direction is perpendicular to the fillet weld welding direction, the y direction is parallel to the fillet weld welding direction, and the z direction is perpendicular to the fillet weld surface.
[0013] Optionally, S2 includes:
[0014] Generate a point cloud fusion map based on the 3D point cloud, the point cloud fusion map includes a point cloud depth map and a grayscale map;
[0015] According to the point cloud fusion map, the point cloud data of the weld area is preliminarily obtained through the instance segmentation network model.
[0016] Optionally, a point cloud fusion map is generated according to the 3D point cloud, including:
[0017] Generate a point cloud depth map based on the x, y, and z values of the 3D point cloud;
[0018] Generate a point cloud grayscale image based on the x, y, and point cloud intensity values of the 3D point cloud;
[0019] The pixel values of the grayscale image and the depth image are weighted to form a point cloud fusion image.
[0020] Optionally, the weld area point cloud data is initially obtained through an instance segmentation network model according to the point cloud fusion graph, including:
[0021] The weld area in the point cloud fusion image is divided by the instance segmentation model, and the weld area is back-projected into the 3D point cloud to extract the weld area point cloud data.
[0022] Optionally, S3 includes:
[0023] S31: performing rough positioning of the characteristic points of the starting position and the ending position of the weld according to the point cloud data of the weld area, and obtaining a characteristic point of the first weld starting position and a characteristic point of the first weld ending position;
[0024] S32: accurately positioning the characteristic points of the starting position and the ending position of the weld according to the first weld starting position characteristic point and the first weld ending position characteristic point, to obtain the second weld starting position characteristic point and the second weld ending position characteristic point.
[0025] Optionally, S31 includes:
[0026] The point cloud statistical filtering algorithm is used to eliminate some data interference of the point cloud data in the weld area;
[0027] The point cloud Euclidean clustering algorithm is used to extract the largest cluster point cloud data, and then the y-direction sorting is performed to take the minimum point cloud as the feature point of the starting position of the first weld, and the maximum point cloud as the feature point of the ending position of the first weld.
[0028] Optionally, S32 includes:
[0029] The point cloud data of the vicinity of the feature point of the first weld start position and the feature point of the first weld end position are respectively taken as the original point cloud data for precise positioning;
[0030] The original point cloud data of precise positioning is divided into two segmented areas with the y-axis as the center, and the RANSAC algorithm is used to fit the planes of the two segmented areas respectively, with the two fitted planes being close to vertical as the fitting target;
[0031] The precise positioning original point cloud data is filtered under the condition that the distance to the two fitting planes is the set value, and then the filtered point cloud is fitted with a straight line to segment the straight line point cloud. For the straight line point cloud obtained from the original point cloud data at the starting position in the precise positioning original point cloud data, the y-direction maximum point cloud is taken as the feature point of the starting position of the second weld, and for the straight line point cloud obtained from the original point cloud data at the ending position in the precise positioning original point cloud data, the y-direction minimum point cloud is taken as the feature point of the ending position of the second weld.
[0032] Optionally, S4 includes:
[0033] According to the x and y values of the characteristic points at the starting position of the weld and the ending position of the weld, the square sum of their differences is calculated and added, and the arithmetic square root is taken to obtain the actual length of the weld.
[0034] In a second aspect, the present application provides a vision-based weld length measurement system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.
[0035] Beneficial effects:
[0036] The vision-based weld length measurement method provided by the present invention first obtains the 3D point cloud of the weld surface; segments the weld area point cloud data from the 3D point cloud; locates the weld start position feature point and the weld end position feature point according to the weld area point cloud data; and calculates the actual weld length based on the weld start position feature point and the weld end position feature point. In this way, by locating the weld start position feature point and the weld end position feature point, and further calculating the weld length, the interference degree can be reduced and the measurement accuracy can be improved.
[0037] In a further scheme, the acquired original 3D point cloud data of the weld is processed to obtain a point cloud fusion image based on the point cloud grayscale image and the point cloud depth image, and the image is sent to the instance segmentation network model to obtain the point cloud data of the weld area. Coarse positioning and fine positioning are used to further determine the feature points of the first and last positions of the weld, thereby calculating the actual length of the weld and effectively improving the measurement accuracy of the weld length. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 The present invention is a flowchart of a vision-based weld length measurement method according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0039] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0041] It should be understood that the existing method for measuring the length of a weld has the problem of being greatly interfered with and having low measurement accuracy. Based on this, the present application provides a method for measuring the length of a weld based on vision.
[0042] See also Figure 1 , the present application provides a vision-based weld length measurement method, comprising:
[0043] S1: Obtain the 3D point cloud of the weld surface.
[0044] In this step, the method of obtaining the 3D point cloud of the weld surface can be based on a 3D camera or other acquisition equipment. This is only an example and is not limited.
[0045] Specifically, the generated 3D point cloud contains x, y, z, and point cloud intensity values.
[0046] S2: Segment the weld area point cloud data from the 3D point cloud.
[0047] In this step, the segmentation method may be segmentation through an instance segmentation network model, which is only used as an example and is not limited here.
[0048] S3: Positioning is performed based on the point cloud data of the weld area to obtain the characteristic points of the weld start position and the weld end position.
[0049] In this step, the positioning methods include coarse positioning and fine positioning.
[0050] S4: Calculate the actual length of the weld based on the weld start position feature point and the weld end position feature point.
[0051] The vision-based weld length measurement method first obtains the 3D point cloud of the weld surface; segments the weld area point cloud data from the 3D point cloud; locates the weld start position feature points and weld end position feature points based on the weld area point cloud data; and calculates the actual weld length based on the weld start position feature points and weld end position feature points. In this way, by locating the weld start position feature points and weld end position feature points, and further calculating the weld length, the interference degree can be reduced and the measurement accuracy can be improved.
[0052] Optionally, S1 includes:
[0053] All point cloud data of the measured fillet weld are obtained from the 3D camera, and the original 3D point cloud x, y, z, and point cloud intensity values are saved, where the x direction is perpendicular to the fillet weld welding direction, the y direction is parallel to the fillet weld welding direction, and the z direction is perpendicular to the fillet weld surface.
[0054] In this embodiment, only the directions of X, Y, and Z are illustrated. In other feasible embodiments, the Y direction may be perpendicular to the fillet weld welding direction, the Z direction may be parallel to the fillet weld welding direction, and the X direction may be perpendicular to the fillet weld surface; or the Z direction may be perpendicular to the fillet weld welding direction, the X direction may be parallel to the fillet weld welding direction, and the Y direction may be perpendicular to the fillet weld surface. No matter how it is changed, it is within the protection scope of this application.
[0055] It is worth pointing out that the point cloud intensity value can also be expressed as intensity value, which can reflect the texture information of the surface of the measured workpiece.
[0056] Optionally, S2 includes:
[0057] Generate a point cloud fusion map based on the 3D point cloud, the point cloud fusion map includes a point cloud depth map and a grayscale map;
[0058] According to the point cloud fusion map, the point cloud data of the weld area is preliminarily obtained through the instance segmentation network model.
[0059] Specifically, generating a point cloud fusion map based on the 3D point cloud includes:
[0060] Generate a point cloud depth map based on the x, y, and z values of the 3D point cloud;
[0061] Generate a point cloud grayscale image based on the x, y, and point cloud intensity values of the 3D point cloud;
[0062] The pixel values of the grayscale image and the depth image are weighted to form a point cloud fusion image.
[0063] Specifically, the point cloud data of the weld area is initially obtained through the instance segmentation network model according to the point cloud fusion graph, including:
[0064] The weld area in the point cloud fusion image is divided by the instance segmentation model, and the weld area is back-projected into the 3D point cloud to extract the weld area point cloud data.
[0065] In this way, the acquired original 3D point cloud data of the weld is processed to obtain a point cloud fusion image based on the point cloud grayscale image and the point cloud depth image, and then sent to the instance segmentation network model to obtain the point cloud data of the weld area, so that the actual length of the weld can be calculated in the subsequent steps, which can effectively improve the measurement accuracy of the weld length.
[0066] Optionally, S3 includes:
[0067] S31: performing rough positioning of the characteristic points of the starting position and the ending position of the weld according to the point cloud data of the weld area, and obtaining a characteristic point of the first weld starting position and a characteristic point of the first weld ending position;
[0068] S32: accurately positioning the characteristic points of the starting position and the ending position of the weld according to the first weld starting position characteristic point and the first weld ending position characteristic point, to obtain the second weld starting position characteristic point and the second weld ending position characteristic point.
[0069] Among them, S31 includes:
[0070] The point cloud statistical filtering algorithm is used to eliminate some data interference of the point cloud data in the weld area;
[0071] The point cloud Euclidean clustering algorithm is used to extract the largest cluster point cloud data, and then the y-direction sorting is performed to take the minimum point cloud as the feature point of the starting position of the first weld, and the maximum point cloud as the feature point of the ending position of the first weld.
[0072] Among them, S32 includes:
[0073] The point cloud data of the vicinity of the feature point of the first weld start position and the feature point of the first weld end position are respectively taken as the original point cloud data for precise positioning;
[0074] The original point cloud data of precise positioning is divided into two segmented areas with the y-axis as the center, and the RANSAC algorithm is used to fit the planes of the two segmented areas respectively, with the two fitted planes being close to vertical as the fitting target;
[0075] The precise positioning original point cloud data is filtered under the condition that the distance to the two fitting planes is the set value, and then the filtered point cloud is fitted with a straight line to segment the straight line point cloud. For the straight line point cloud obtained from the original point cloud data at the starting position in the precise positioning original point cloud data, the y-direction maximum point cloud is taken as the feature point of the starting position of the second weld, and for the straight line point cloud obtained from the original point cloud data at the ending position in the precise positioning original point cloud data, the y-direction minimum point cloud is taken as the feature point of the ending position of the second weld.
[0076] In other words, in this embodiment, the first weld start position feature point and the first weld end position feature point are the results of coarse positioning, and the second weld start position feature point and the second weld end position feature point are the results of fine positioning.
[0077] In this embodiment, coarse positioning and fine positioning are used to further determine the characteristic points of the beginning and end positions of the weld, so as to calculate the actual length of the weld, thereby effectively improving the measurement accuracy of the weld length.
[0078] Optionally, S4 includes:
[0079] According to the x and y values of the characteristic points at the starting position of the weld and the ending position of the weld, the square sum of their differences is calculated and added, and the arithmetic square root is taken to obtain the actual length of the weld.
[0080] In summary, the vision-based weld length measurement method provided in the present application processes the acquired original 3D point cloud data of the weld to obtain a point cloud fusion image based on the point cloud grayscale image and the point cloud depth image, and sends it into the instance segmentation network model to obtain the point cloud data of the weld area, and uses coarse positioning and fine positioning to further determine the feature points of the first and last positions of the weld, thereby calculating the actual length of the weld, effectively improving the measurement accuracy of the weld length.
[0081] The present application also provides a vision-based weld length measurement system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the vision-based weld length measurement system method are implemented.
[0082] The vision-based weld length measurement system can implement various embodiments of the above-mentioned vision-based weld length measurement method and can achieve the same beneficial effects, which will not be described in detail here.
[0083] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for measuring weld length based on vision, characterized in that: include: S1: Get the 3D point cloud of the weld surface; S2: Segmenting weld area point cloud data from the 3D point cloud; S3: Positioning according to the weld area point cloud data to obtain weld start position feature points and weld end position feature points; S4: Calculating the actual length of the weld based on the weld start position feature point and the weld end position feature point.
2. The method for measuring weld length based on vision according to claim 1, characterized in that: The S1 includes: All point cloud data of the measured fillet weld are obtained from the 3D camera, and the original 3D point cloud x, y, z, and point cloud intensity values are saved, where the x direction is perpendicular to the fillet weld welding direction, the y direction is parallel to the fillet weld welding direction, and the z direction is perpendicular to the fillet weld surface.
3. The method for measuring weld length based on vision according to claim 1, characterized in that: The S2 includes: Generate a point cloud fusion map according to the 3D point cloud, wherein the point cloud fusion map includes a point cloud depth map and a grayscale map; According to the point cloud fusion map, the weld area point cloud data is preliminarily obtained through the instance segmentation network model.
4. The method for measuring weld length based on vision according to claim 3, characterized in that: Generating a point cloud fusion map according to the 3D point cloud includes: Generate a point cloud depth map based on the x, y, and z values of the 3D point cloud; Generate a point cloud grayscale image based on the x, y, and point cloud intensity values of the 3D point cloud; The pixel values of the grayscale image and the depth image are weighted to form a point cloud fusion image.
5. The method for measuring weld length based on vision according to claim 3, characterized in that: The step of preliminarily acquiring weld area point cloud data through an instance segmentation network model according to the point cloud fusion graph includes: The weld area in the point cloud fusion image is divided by the instance segmentation model, and the weld area is back-projected into the 3D point cloud to extract the weld area point cloud data.
6. The method for measuring weld length based on vision according to claim 1, characterized in that: The S3 includes: S31: performing rough positioning of the characteristic points of the starting position and the ending position of the weld according to the weld area point cloud data, to obtain a first weld starting position characteristic point and a first weld ending position characteristic point; S32: accurately positioning the characteristic points of the starting position and the ending position of the weld according to the first weld starting position characteristic point and the first weld ending position characteristic point to obtain a second weld starting position characteristic point and a second weld ending position characteristic point.
7. The method for measuring weld length based on vision according to claim 6, characterized in that: The S31 includes: A point cloud statistical filtering algorithm is used to eliminate some data interference of the point cloud data in the weld area; The point cloud Euclidean clustering algorithm is used to extract the largest cluster point cloud data, and then the y-direction sorting is performed to take the minimum point cloud as the feature point of the starting position of the first weld, and the maximum point cloud as the feature point of the ending position of the first weld.
8. The method for measuring weld length based on vision according to claim 6, characterized in that: The S32 includes: The point cloud data of the vicinity of the feature point of the first weld start position and the feature point of the first weld end position are respectively taken as the original point cloud data for precise positioning; The precisely positioned original point cloud data is divided into two segmented areas with the y-axis as the center, and the two segmented areas are respectively fitted with the RANSAC algorithm with the two planes being close to perpendicular as the fitting target; The precise positioning original point cloud data is filtered under the condition that the distance to the two fitting planes is the set value, and then the filtered point cloud is fitted with a straight line to segment the straight line point cloud. For the straight line point cloud obtained from the original point cloud data at the starting position in the precise positioning original point cloud data, the y-direction maximum point cloud is taken as the feature point of the starting position of the second weld, and for the straight line point cloud obtained from the original point cloud data at the ending position in the precise positioning original point cloud data, the y-direction minimum point cloud is taken as the feature point of the ending position of the second weld.
9. The method for measuring weld length based on vision according to claim 1, characterized in that: The S4 includes: According to the x and y values of the characteristic points at the starting position of the weld and the ending position of the weld, the square sum of their differences is calculated and added and the arithmetic square root is taken to obtain the actual length of the weld.
10. A vision-based weld length measurement system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 9 are implemented.