Weld joint feature point extraction method and device
The method simplifies weld feature point extraction by preprocessing and edge point identification, addressing misidentification issues in automated welding, thereby improving recognition speed and accuracy.
Patent Information
- Application Number
- CN202411315145.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-24
AI Technical Summary
Existing automated welding technologies face challenges in accurately identifying weld feature points due to multiple extreme points on binarized images, leading to misidentification and complex, slow recognition processes.
A method and device for extracting weld feature points by preprocessing images to obtain a laser line image, extracting the center line, and identifying edge points to determine feature points through neighborhood pixel sum calculations and judgments, simplifying the process and improving recognition speed.
The method achieves faster and more accurate extraction of weld feature points by reducing computational complexity and power requirements, enhancing the accuracy and speed of weld position correction.
Smart Images

Figure CN119180968A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of digital image processing, and in particular to a method and device for extracting weld feature points. Background Art
[0002] Welding is a process widely used in industrial production. The emergence of automated welding has effectively improved the efficiency of welding operations. However, due to workpiece feeding errors, deformation and other reasons, there are certain welding deviations in automated welding, and additional devices need to be set up for deviation correction. For example, a line laser camera is installed at the end of the actuator to correct the position deviation of the workpiece weld. The existing technology usually collects images of the weld, performs second-order difference calculations on the images, confirms the weld feature points through the image mutation points, and then determines the weld position. However, in actual applications, there are often multiple extreme points on the binarized image, but not all extreme points are weld feature points, so it is easy to misidentify, and the calculation is complex and the recognition speed is slow. Summary of the invention
[0003] Based on this, the object of the present invention is to provide a method and device for extracting weld feature points.
[0004] A method for extracting weld feature points, characterized in that it comprises the following steps:
[0005] S10, obtaining a weld image;
[0006] S20, preprocessing the weld image to obtain a laser line image;
[0007] S30, extracting the center line of the laser line image to obtain a center line image;
[0008] S40, extracting edge points from the center line image, and obtaining a feature point group based on edge point calculation and judgment.
[0009] The weld feature point extraction method described in the present invention determines and calculates the feature points by extracting edge points on the center line. Compared with artificial intelligence image recognition or second-order difference and other graphic calculations commonly used in the prior art, the method of the present invention is simpler to calculate, has low computing power requirements, and has a correspondingly faster calculation and recognition speed.
[0010] Furthermore, the preprocessing of step S20 includes denoising, binarization, filtering, and closing operations on the image.
[0011] Furthermore, the step S40 includes the following sub-steps:
[0012] S41, performing addition calculation on the neighborhood pixel values of each point on the center line image to obtain the neighborhood pixel sum of each point;
[0013] S42, judging whether the point is a left edge point or a right edge point according to the neighborhood pixels of each point;
[0014] S43, determining a feature point pair according to the horizontal coordinate difference between the left edge point and the right edge point;
[0015] S44, determining the upper feature point and the lower feature point according to the ordinate size of the feature point pair;
[0016] S45. Calculate a middle feature point based on the upper feature point and the lower feature point, and combine the upper feature point, the lower feature point and the middle feature point to obtain a feature point group.
[0017] Furthermore, the step S41 is specifically to calculate and obtain the neighborhood pixel sum according to the following formula:
[0018]
[0019] Where N L (x,y) represents the sum of the left neighboring pixels of point (x,y), N R (x,y) represents the sum of the right neighborhood pixels of point (x,y), m represents the length of the neighborhood, n represents the height of the neighborhood, and P(x,y) represents the pixel value of point (x,y); and the pixel value of the laser center line in the image is set to 255, and the pixel values of the remaining points are set to 0.
[0020] Furthermore, the step S42 is specifically judged according to the following conditions:
[0021] If N L (x,y)>255×m and N R (x,y)=0, then the point is judged to be the left edge point P L ;
[0022] If N R (x,y)>255×m and N L (x, y) = 0, then the point is judged to be the right edge point P R .
[0023] Furthermore, the step S43 is specifically as follows: if the left edge point P L and the right edge point P R If the horizontal coordinate difference of satisfies the following relationship, the two points are marked as feature point pairs:
[0024]
[0025] In the formula Represents the left edge point P L The horizontal axis, Represents the right edge point P R The horizontal axis, s, is the threshold value set according to the weld gap.
[0026] Furthermore, the step S44 is specifically as follows: determining the left edge point P in the feature point pair L and the right edge point P R The size of the vertical coordinate, if Then the left edge point P L Determined as the upper feature point, right edge point P R Determine as the lower feature point, otherwise the left edge point P L Determined as the lower feature point, right edge point P R Determined as the upper feature point; Represents the left edge point P L The vertical axis, Represents the right edge point P R Vertical axis.
[0027] Further, the step S45 is specifically based on Calculate the horizontal coordinates of the feature points according to The ordinate of the middle feature point is obtained by calculation; the upper feature point, the lower feature point and the middle point are combined and output to obtain a feature point group.
[0028] Furthermore, the present invention also provides a device for extracting characteristic points of a weld, comprising:
[0029] An image acquisition unit, used to acquire a weld image with a laser line;
[0030] A preprocessing unit, used for preprocessing the weld image to obtain a laser line image;
[0031] A centerline extraction unit, used for extracting the centerline of the laser line image to obtain a centerline image;
[0032] The feature point extraction unit is used to calculate the neighborhood pixel value of each point on the center line image, and determine the upper edge point, the lower edge point and the middle point according to the calculation results to obtain the feature point.
[0033] Furthermore, the feature point extraction unit includes
[0034] A pixel value calculator is used to perform addition calculation on the neighborhood pixel values of each point on the center line image to obtain the neighborhood pixel sum of each point;
[0035] An edge point judger is used to judge whether the point is a left edge point or a right edge point according to the neighborhood pixels of each point;
[0036] A feature point pair judger, used to determine a feature point pair according to the horizontal coordinate difference between each left edge point and the right edge point;
[0037] A ordinate comparator, used to determine the upper feature point and the lower feature point according to the ordinate size of the feature point pair;
[0038] The coordinate calculator is used to calculate the middle feature point according to the upper feature point and the lower feature point, and to combine the upper feature point, the lower feature point and the middle feature point to obtain a feature point group.
[0039] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of the weld feature point extraction method of the present invention;
[0041] Figure 2 This is a flow chart of sub-steps of step S40 of the weld feature point extraction method of the present invention;
[0042] Figure 3 This is the centerline image shown in Example 1. DETAILED DESCRIPTION
[0043] See also Figure 1 The present invention provides a method for extracting characteristic points of a weld, comprising the following steps:
[0044] S10, obtaining a weld image.
[0045] Specifically, the weld image measured by the warp laser is collected by an image sensor, such as a camera, a CCD, etc.
[0046] S20, preprocessing the weld image to obtain a laser line image.
[0047] Specifically, the collected weld image is preprocessed by denoising, binarization, filtering, closing operation, etc. to obtain a clear laser line image. The preprocessing method is a mature prior art and is not the content of the present invention, so the present invention will not further elaborate on it.
[0048] S30, extracting the center line of the laser line image to obtain a center line image.
[0049] Specifically, the centerline of the laser line image is extracted to obtain an accurate and clear laser centerline image. In different application scenarios, different welds will produce different weld images, and thus form different centerline images. Figure 3 In this embodiment, the centerline image extends along the x-axis direction and is divided into a non-connected left half and a non-connected right half, and the middle disconnected area is the weld area. It should be noted that the weld and centerline image shown in this embodiment are only examples for the convenience of explanation and understanding, and cannot be understood as a limitation of the present invention. The present invention can be applied to any type of weld.
[0050] S40, extracting edge points from the center line image, and obtaining a feature point group based on edge point calculation and judgment.
[0051] See also Figure 2 Specifically, the step S40 further includes the following sub-steps:
[0052] S41, performing addition calculation on the neighborhood pixel values of each point on the center line image to obtain the neighborhood pixel sum of each point.
[0053] In order to facilitate subsequent calculations, the pixel value of the laser center line in the image is set to 255, and the pixel values of the remaining points are set to 0. The pixel values in the left and right neighborhoods of each point on the laser center line are added respectively, and the calculation formula is:
[0054]
[0055] Where N L (x,y) represents the sum of the left neighboring pixels of point (x,y), N R (x,y) represents the sum of the pixels in the right neighborhood of point (x,y), m represents the length of the neighborhood, n represents the height of the neighborhood, and P(x,y) represents the pixel value of point (x,y). The values of m and n are not limited and can be adjusted according to actual conditions to obtain more accurate calculation results.
[0056] S42. Determine whether each point is a left edge point or a right edge point based on the sum of the neighborhood pixels of the point.
[0057] The sum of the left neighboring pixels and the sum of the right neighboring pixels calculated for each point are judged separately. If N L (x,y)>255×m and N R (x, y) = 0, which means that there are a large number of points with a pixel value of 255 in the left neighborhood of the point, that is, the laser center line is located in the left neighborhood of the point, and the pixel values of all points in the right neighborhood are 0, that is, there is no laser line in the right neighborhood. Therefore, it can be judged that the point is the end of the left half of the laser center line and marked as the left edge point P. L ; if N R (x,y)>255×m and N L (x,y)=0 means that there are a large number of points with a pixel value of 255 in the right neighborhood of the point, that is, the laser line is located in the right neighborhood of the point. At the same time, the pixel values of all points in the left neighborhood are 0, that is, there is no laser line in the left neighborhood. Therefore, it can be judged that the point is the end of the right half of the laser center line and marked as the right edge point P. R .
[0058] S43. Determine a pair of feature points according to the difference in the horizontal coordinates of the left edge point and the right edge point.
[0059] Calculate the difference between the horizontal coordinates of each left edge point and the right edge point. Then the left edge point and the right edge point are marked as feature point pairs. Represents the left edge point P L The horizontal axis, Represents the right edge point P R The horizontal axis, s, is the threshold value set according to the weld gap. The size of s can be adjusted according to the actual situation to obtain more accurate calculation results.
[0060] S44. Determine the upper feature point and the lower feature point according to the size of the ordinate of the feature point pair.
[0061] Compare the left edge point P in the feature point pair L and the right edge point P R The size of the ordinate, the larger the ordinate is, the higher it is. For example, the left edge point P can be calculated by calculating the difference L and the right edge point P R The vertical coordinates are compared. If
[0062]
[0063] Then the left edge point P L Determined as the upper feature point, right edge point P R Determine as the lower feature point, otherwise the left edge point P L Determined as the lower feature point, right edge point P R Determined as the upper feature point.
[0064] S45. Calculate a middle feature point based on the upper feature point and the lower feature point, and combine the upper feature point, the lower feature point and the middle feature point to obtain a feature point group.
[0065] The middle feature point is a feature point located at the midpoint between the upper feature point and the lower feature point. Therefore, the coordinates of the middle feature point can be directly calculated from the coordinates of the upper feature point and the lower feature point. The horizontal coordinate of the middle feature point is The vertical axis is Finally, the upper feature points, lower feature points and middle feature points are combined and output together to obtain a feature point group.
[0066] The weld feature point extraction method described in the present invention utilizes edge points to identify weld feature points, and by performing neighborhood pixel sum calculations on the center line image obtained by weld image processing, the edge points on the center line can be quickly and accurately identified, and then the required feature points can be obtained by edge point calculations. Compared with the prior art, the method of the present invention greatly simplifies the calculation process, reduces the computing power requirements for the equipment, and effectively improves the calculation speed. In addition, since the present invention first identifies edge points and then uses edge points to calculate feature points, and the edge point identification can have extremely high accuracy with the help of neighborhood pixels and sum, the present invention has a higher recognition accuracy rate for feature points than the prior art that directly extracts feature points using methods such as image recognition.
[0067] Based on the above feature point extraction method, the present invention also provides a feature point extraction device, including an image acquisition unit, a preprocessing unit, a center line extraction unit and a feature point extraction unit. The image acquisition unit is used to obtain a weld image; the preprocessing unit is used to preprocess the weld image to obtain a laser line image; the center line extraction unit is used to perform skeleton extraction on the laser line image to obtain a center line image; the feature point extraction unit is used to extract edge points from the center line image, and obtain a feature point group based on edge point calculation and judgment.
[0068] Furthermore, the feature point extraction unit includes a pixel value calculator, an edge point judger, a feature point pair judger, a ordinate comparator and a coordinate calculator. The pixel value calculator is used to perform neighborhood pixel value addition calculation on each point on the center line image to obtain the neighborhood pixel sum of each point. The edge point judger is used to judge whether the point is a left edge point or a right edge point based on the neighborhood pixel sum of each point. The feature point pair judger is used to determine the feature point pair based on the horizontal coordinate difference of each left edge point and right edge point. The ordinate comparator is used to determine the upper feature point and the lower feature point based on the ordinate size of the feature point pair. The coordinate calculator is used to calculate the middle feature point based on the upper feature point and the lower feature point, and combine the upper feature point, the lower feature point and the middle feature point to obtain a feature point group.
[0069] Furthermore, the pixel value calculator calculates the neighborhood pixel sum according to the following formula:
[0070]
[0071] Where N L (x,y) represents the sum of the left neighboring pixels of point (x,y), N R (x,y) represents the sum of the right neighborhood pixels of point (x,y), m represents the length of the neighborhood, n represents the height of the neighborhood, and P(x,y) represents the pixel value of point (x,y); and the pixel value of the laser center line in the image is set to 255, and the pixel values of the remaining points are set to 0.
[0072] The edge point judger determines whether it is a left edge point or a right edge point according to the following conditions:
[0073] If N L (x,y)>255×m and N R (x,y)=0, then the point is judged to be the left edge point P L ;
[0074] If N R (x,y)>255×m and N L (x, y) = 0, then the point is judged to be the right edge point P R .
[0075] The feature point pair judger can judge the left edge point P L and the right edge point P R Whether the horizontal coordinate difference of satisfies the following relationship, the two points are marked as feature point pairs:
[0076]
[0077] In the formula Represents the left edge point P L The horizontal axis, Represents the right edge point P R The horizontal axis, s, is the threshold value set according to the weld gap.
[0078] The ordinate comparator compares the left edge point P L and the right edge point P R The size of the vertical coordinate, if Then the left edge point P L Determined as the upper feature point, right edge point P R Determine as the lower feature point, otherwise the left edge point P L Determined as the lower feature point, right edge point P R Determined as the upper feature point; Represents the left edge point P L The vertical axis, Represents the right edge point P R Vertical axis.
[0079] The coordinate calculator is based on Calculate the horizontal coordinates of the feature points according to The ordinate of the middle feature point is calculated and the upper feature point, the lower feature point and the middle point are combined and output to obtain a feature point group.
[0080] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and the present invention is also intended to include these modifications and modifications.
Claims
1. A method for extracting weld feature points, characterized in that: The following steps are involved: S10, obtaining a weld image; S20, preprocessing the weld image to obtain a laser line image; S30, extracting the center line of the laser line image to obtain a center line image; S40, extracting edge points from the center line image, and obtaining a feature point group based on edge point calculation and judgment.
2. The weld feature point extraction method according to claim 1, characterized in that: The preprocessing of step S20 includes denoising, binarization, filtering, and closing operations on the image.
3. The weld feature point extraction method according to claim 1, characterized in that: The step S40 includes the following sub-steps: S41, performing addition calculation on the neighborhood pixel values of each point on the center line image to obtain the neighborhood pixel sum of each point; S42, judging whether the point is a left edge point or a right edge point according to the neighborhood pixels of each point; S43, determining a feature point pair according to the horizontal coordinate difference between the left edge point and the right edge point; S44, determining the upper feature point and the lower feature point according to the ordinate size of the feature point pair; S45. Calculate a middle feature point based on the upper feature point and the lower feature point, and combine the upper feature point, the lower feature point and the middle feature point to obtain a feature point group.
4. The method for extracting weld feature points according to claim 3, characterized in that: The step S41 specifically calculates the neighborhood pixel sum according to the following formula: Where N L (x,y) represents the sum of the left neighboring pixels of point (x,y), N R (x,y) represents the sum of the right neighborhood pixels of point (x,y), m represents the length of the neighborhood, n represents the height of the neighborhood, and P(x,y) represents the pixel value of point (x,y); and the pixel value of the laser center line in the image is set to 255, and the pixel values of the remaining points are set to 0.
5. The method for extracting weld feature points according to claim 4, characterized in that: The step S42 is specifically judged according to the following conditions: If N L (x,y)>255×m and N R (x,y)=0, then the point is judged to be the left edge point P L ; If N R (x,y)>255×m and N L (x, y) = 0, then the point is judged to be the right edge point P R .
6. The feature point extraction method according to claim 5, characterized in that: The step S43 is specifically as follows: if the left edge point P L and the right edge point P R If the horizontal coordinate difference of satisfies the following relationship, the two points are marked as feature point pairs: In the formula Represents the left edge point P L The horizontal axis, Represents the right edge point P R The horizontal axis, s, is the threshold value set according to the weld gap.
7. The method for extracting weld feature points according to claim 6, characterized in that: The step S44 is specifically as follows: determining the left edge point P in the feature point pair L and the right edge point P R The size of the vertical coordinate, if Then the left edge point P L Determined as the upper feature point, right edge point P R Determine as the lower feature point, otherwise the left edge point P L Determined as the lower feature point, right edge point P R Determined as the upper feature point; Represents the left edge point P L The vertical axis, Represents the right edge point P R Vertical axis.
8. The feature point extraction method according to claim 7, characterized in that: The step S45 is specifically based on Calculate the horizontal coordinates of the feature points according to The ordinate of the middle feature point is obtained by calculation; the upper feature point, the lower feature point and the middle point are combined and output to obtain a feature point group.
9. A device for extracting weld feature points, characterized in that: include An image acquisition unit, used to acquire a weld image with a laser line; A preprocessing unit, used for preprocessing the weld image to obtain a laser line image; A centerline extraction unit, used for extracting the centerline of the laser line image to obtain a centerline image; The feature point extraction unit is used to calculate the neighborhood pixel value of each point on the center line image, and determine the upper edge point, the lower edge point and the middle point according to the calculation result to obtain the feature point group.
10. The device for extracting weld feature points according to claim 9, characterized in that: The feature point extraction unit includes A pixel value calculator is used to perform addition calculation on the neighborhood pixel values of each point on the center line image to obtain the neighborhood pixel sum of each point; An edge point judger is used to judge whether the point is a left edge point or a right edge point according to the neighborhood pixels of each point; A feature point pair judger, used to determine a feature point pair according to the horizontal coordinate difference between each left edge point and the right edge point; A ordinate comparator, used to determine the upper feature point and the lower feature point according to the ordinate size of the feature point pair; The coordinate calculator is used to calculate the middle feature point according to the upper feature point and the lower feature point, and to combine the upper feature point, the lower feature point and the middle feature point to obtain a feature point group.
Citation Information
Patent Citations
Method for extracting feature points of plane welds based on laser vision system
CN108132017A
Self-adaptive extraction method for geometrical characteristics of butt weld
CN113649672A
Method for identifying feature points of double-sided submerged arc welding seam and calculating macroscopic parameters
CN115731394A
Weld joint feature extraction method and system for line laser sensor
CN117911516A
