Welding seam center line extraction method and system based on pixel points

Through the pixel-based weld centerline extraction method, the local area image enhancement algorithm is used to extract the weld centerline in segments, which solves the problems of insufficient accuracy and low computational efficiency under lighting conditions in the existing technology, and achieves high accuracy and Adaptability improves the automation of the welding system.

CN118735986APending Publication Date: 2024-10-01XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410820964.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing weld centerline extraction methods lack accuracy under different lighting conditions, are difficult to adapt to changes in image features, have low computational efficiency, and lack of universality, resulting in large errors and low automation during the welding process.

Method used

A pixel-based weld centerline extraction method is used, and the weld workpiece image is preprocessed through a local area image enhancement algorithm, and the centerline is extracted and combined in segments, which improves the accuracy and adaptability of the extraction.

Benefits of technology

Accurately extracting the centerline of the weld seam under different lighting conditions improves the accuracy of weld seam extraction and the adaptability of the algorithm, enhances the automation of the welding system, and meets real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735986A_ABST
    Figure CN118735986A_ABST
Patent Text Reader

Abstract

The invention discloses a pixel-point-based weld joint center line extraction method and system, and belongs to the technical field of industrial image processing, and the method comprises the following steps: obtaining a weld joint workpiece image, and extracting a weld joint center line from the weld joint workpiece image by using a pixel-point-based weld joint center line extraction algorithm, the method specifically comprises the following steps: performing image enhancement preprocessing on a welding seam workpiece image by using an image enhancement algorithm based on a local region to obtain an image-enhanced welding seam workpiece image, extracting a welding seam region from the image-enhanced welding seam workpiece image, extracting a welding seam from the welding seam region, extracting a segmented welding seam center line from the welding seam, and extracting a segmented welding seam center line from the segmented welding seam center line; and the segmented weld joint center lines are combined into the whole weld joint center line. According to the method, the axle workpiece welding line center line under different light intensities can be accurately extracted, the adaptability of the algorithm is enhanced while the welding line extraction accuracy is improved, and a foundation is laid for a subsequent intelligent welding system to automatically set welding process parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of industrial image processing, and in particular relates to a method and system for extracting a weld centerline based on pixel points. Background Art

[0002] During the welding process, welding defects are caused by different levels of workers and welding environments. Common welding defects include undercut, weld bead, burn-through, pores, cracks, spatter, and missing welds. Weld defects need to be classified and grinding, repair welding and other measures should be taken for different defects to ensure the welding quality. At present, weld extraction and detection mainly adopt vision-based detection methods. The image information of the weld is obtained through the camera, and the weld image is preprocessed, feature extracted and other operations are performed. The processed weld defect samples are trained by machine learning or deep learning. The feature information of different weld defects is learned through a large number of samples. The trained model has a certain recognition and detection ability for unknown weld defects, and can locate and distinguish the detected weld defects.

[0003] The working environment during industrial welding is generally poor. The quality of images collected by the camera is easily affected by changes in light intensity. The image quality is poor, and it is easy to make misjudgments and missed detections during the classification process. In addition, the camera can only obtain two-dimensional information, thus missing the depth information of weld defects. The obtained weld geometry information is not rich enough, and there are certain limitations under specific needs. Effective image processing and rapid and accurate extraction of weld geometry feature information have become research hotspots. Commonly used edge detection operators in image processing include Roberts, Sobel, Log, Laplacian, Canny, etc. Among them, first-order gradient operators such as Roberts and Sobel have fast operation speed but low accuracy and poor continuity. In 2021, Aisha Baloch et al. mentioned in Hardware Synthesize and Performance Analysis of Intelligent Transportation Using Canny Edge Detection Algorithm: Second-order gradient operators such as Laplacian and Log have large computational complexity but are prone to loss of edge details. In 2020, Che Chang and Lan Wenbao mentioned in the infrared panoramic image stitching of Canny algorithm and median filter method: Canny operator has the advantages of high signal-to-noise ratio, high detection accuracy, and unilateral response, and can better adapt to the high-precision edge extraction requirements of strong noise weld images. In 2018, Dong Yao et al. mentioned in the improved Canny algorithm for welding repair of aircraft engine blades: Secondary screening of non-maximum values ​​and application of Otsu algorithm for threshold selection effectively improve the smoothness and adaptability of edge connection, but it is easy to cause interference when facing strong noise. In 2021, Zhang Pengfan et al. applied k-nearest neighbor mean filtering in the improvement of Canny edge detection based on gradient extreme value Otsu algorithm, and selected high and low thresholds according to gradient extreme value, which can effectively remove noise, but there are discontinuity defects in the detected edge. Liu Duanfei and Shan Baoming introduced bilateral filtering instead of Gaussian filtering for noise reduction in the application of improved Canny algorithm in stainless steel plate weld identification, and applied it to the edge extraction of right-angle welds, enriching the edge features. However, this method requires manual setting of thresholds and has poor adaptability. In order to improve the accuracy of weld extraction, Zhang Jinzhou et al. used the contourlet transform method to grayscale and enhance the intersecting line weld image in the intersecting line weld extraction algorithm integrating convolutional neural network and bilateral filtering in 2023, and denoised the weld image by bilateral filtering, making the weld extraction clearer and more accurate. Du Chunyang et al. applied the improved Sobel operator in the study of weld image edge extraction based on the improved Canny operator, and added the gradient amplitude calculation in the 45° and 135° directions to improve the edge positioning accuracy, but this method has the problem of long weld extraction time.In order to improve the extraction speed of welds, Mao Zhiwei et al. used the maximum pixel gradient to calculate the optimal pixel threshold for segmenting laser stripes and background environment in the adaptive extraction method of butt weld geometric features based on line structured light in 2023. The collected image was scanned row and column according to the pixel threshold, which achieved rapid positioning of the area of ​​interest of weld features. However, this method relies on the setting of the threshold and there is a risk of missing the weld area.

[0004] It is difficult to design a universal processing method based on all quality images with current technology. Generally, the quality of images can be classified, and then corresponding processing methods can be proposed for each type. In order to eliminate the influence of illumination, the existing technology performs preprocessing operations on the image to be processed. However, uniform preprocessing operations on the entire image may weaken or even lose some important information. In particular, image enhancement algorithms, existing technologies include traditional image enhancement algorithms and deep learning enhancement algorithms. Deep learning methods require a lot of computing resources and time for training, model complexity and interpretability, data privacy and security issues, overfitting problems, and insufficient sample diversity leading to poor training results. In actual engineering application problems, traditional image processing methods are more preferred.

[0005] The existing weld centerline extraction methods lack universality, and the images in real environments are easily affected by lighting. Therefore, it is very important to first weaken the influence of lighting. Otherwise, it is not practical to directly extract the centerline based on the weld images obtained under poor lighting conditions, and the error is often large.

[0006] Weld centerline extraction is a key step in weld image processing. The shortcomings of the existing technology are as follows:

[0007] (1) Accuracy issues: In some cases, existing technologies may not be able to accurately extract the weld centerline. In particular, when the weld shape is complex, or there is noise or interference, the extracted centerline may be biased, affecting the accuracy of subsequent weld identification and analysis.

[0008] (2) Robustness issue: The quality and features of different weld images may vary greatly, such as brightness, contrast, texture, etc. Existing technologies often have difficulty adapting to these changes, resulting in the inability to effectively extract the weld centerline in some cases, reducing the robustness of the algorithm.

[0009] (3) Computational efficiency: Weld centerline extraction usually requires processing a large amount of image data, which places high demands on computing resources. Existing technologies may have low computational efficiency when processing large-scale data, making it difficult to meet application scenarios with high real-time requirements.

[0010] (4) Automation level: Although the existing technology has made some progress, there are still some gaps in the accuracy, robustness, computational efficiency and automation level of weld centerline extraction.

[0011] In actual scenes, the weld seam of axle workpieces has insufficient image clarity and contrast due to the influence of lighting, which makes it difficult to extract the workpiece itself and the weld seam, and it is even more difficult to extract the weld centerline. These difficulties become factors that hinder the accuracy of vision-guided welding. Summary of the invention

[0012] The purpose of the present invention is to overcome the problem of insufficient accuracy in the extraction of the center line of the axle weld caused by the difference in light intensity in the prior art, and propose a method and system for extracting the center line of the weld based on pixels. From the perspective of image preprocessing, the image contrast of the axle workpiece image is first increased under different light intensities, and then a method for extracting the center line of the weld based on pixels is proposed. The center line is extracted in segments and finally the entire center line is combined. The result has higher accuracy and is more adaptable to images.

[0013] In order to achieve the above object, the present invention adopts the following technical scheme:

[0014] A method for extracting a weld centerline based on pixel points comprises the following steps:

[0015] A weld workpiece image is acquired, and a weld centerline extraction algorithm based on pixel points is used to extract a weld centerline from the weld workpiece image. Specifically, an image enhancement preprocessing method based on a local area is used to obtain an image enhanced weld workpiece image, a weld area is extracted from the image enhanced weld workpiece image, a weld is extracted from the weld area, a segmented weld centerline is extracted from the weld, and the segmented weld centerlines are combined into the entire weld centerline.

[0016] Furthermore, the local area based image enhancement algorithm includes the following steps:

[0017] S1.1, when i=0, the pixel point p is designated as S0(x, y) and I0(x, y) at the same time, p is the center pixel point, and I0(x, y) contains only one pixel point;

[0018] S1.2, when i=1, S1(x, y) includes all neighboring pixels within one pixel distance of S0(x, y), and S1(x, y) does not include the pixels in I0(x, y);

[0019] I1(x,y)=S0(x,y)∪S1(x,y)

[0020] I1(x, y) includes 3×3 pixels, and S1(x, y) includes 8 pixels;

[0021] S1.3, when i=2, S2(x, y) includes all neighboring pixels within one pixel distance of S1(x, y), and S2(x, y0 does not include the pixels in I1(x, y);

[0022] I2(x,y)=S0(x,y)∪S1(x,y)∪S2(x,y)

[0023] I2(x, y) contains 5×5 pixels, and S2(x, y) contains 16 pixels;

[0024] S1.4, when i=n, ​​S n (x, y) contains S n-1 All neighboring pixels within one pixel distance of (x, y), but not included in I n-1 The pixel at (x, y);

[0025] I n (s, y) = S0 (x, y) ∪ S1 (x, y) ∪ S2 (x, y) ∪...∪S n (x, y)

[0026] I n (x, y) contains (2n+1)×(2n+1) pixels, S n (x, y) contains 8n pixels.

[0027] Furthermore, the pixel-based weld centerline extraction algorithm includes the following steps:

[0028] S2.1, the weld workpiece image is subjected to image enhancement preprocessing operation based on the image enhancement algorithm of the local area;

[0029] S2.2, selecting a region of interest of the weld workpiece image after image enhancement preprocessing operation;

[0030] S2.3, divide the region of interest into several sub-images along the X-axis direction of the weld workpiece image, name the sub-images respectively, and design a selection function to obtain the expression of the center line;

[0031] S2.4. Determine the starting and ending points of the weld centerline through the centerline and pixel grayscale value.

[0032] Furthermore, the selection criteria for selecting the function in S2.3 are:

[0033] S2.3.1. For any sub-image, in the gray value curve, if the number of minimum values ​​of the trough is equal to 1 and the trough value minus the minimum value of the trough is greater than the threshold, then the sub-image is selected, otherwise it is not selected;

[0034] S2.3.2, perform response operations on the selected subgraph;

[0035] S2.3.3. Calculate the average slope and intercept values ​​of the selected subgraph and obtain the expression of the center line.

[0036] Furthermore, S2.3.2 is specifically as follows: divide the sub-image into 8 positions along the X-axis direction by column, and perform the following operations on the grayscale values ​​of these 8 positions: if the number of minimum trough values ​​is greater than 1, the index value is equal to the median value of the minimum trough value, and the point coordinates are the values ​​corresponding to the index value of the selection function; if the number of minimum trough values ​​is less than or equal to 1, return to the selection function of step S2.3.

[0037] Further, S2.4 is specifically as follows: the pixel grayscale value of the area where the start and end points are located is 255, and the grayscale value outside the area where the start and end points are located is 0, and the start and end points of the weld centerline are determined by the intersection of the center line and the center position of the area where the start and end points are located.

[0038] A pixel-based weld centerline extraction system includes a workpiece image acquisition module for acquiring a weld workpiece image;

[0039] The centerline extraction module is used to extract the weld centerline from the weld workpiece image using a pixel-based weld centerline extraction algorithm. Specifically, the weld workpiece image is preprocessed with an image enhancement algorithm based on a local area to obtain an image enhanced weld workpiece image, the weld area is extracted from the image enhanced weld workpiece image, the weld is extracted from the weld area, the segmented weld centerline is extracted from the weld, and the segmented weld centerlines are combined into the entire weld centerline.

[0040] Furthermore, the pixel-based weld centerline extraction algorithm includes the following steps:

[0041] The weld workpiece image is preprocessed with an image enhancement algorithm based on the local area; the region of interest of the weld workpiece image after the image enhancement preprocessing operation is selected; the region of interest is equally divided into several sub-images along the X-axis direction of the weld workpiece image, and the sub-images are named respectively, and a selection function is designed to obtain the expression of the center line, and the sub-image naming suffix is ​​.bmp; the starting and ending points of the weld center line are determined by the center line and the pixel grayscale value.

[0042] An electronic device comprises 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 method for extracting a weld centerline based on pixel points is implemented.

[0043] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the pixel-based weld centerline extraction method is implemented.

[0044] Compared with the prior art, the present invention has the following beneficial technical effects:

[0045] The pixel-based weld centerline extraction method of the present invention can accurately extract the weld centerline of an axle workpiece under different light intensities. In view of the different characteristics of weld images from other images, the weld workpiece image is firstly subjected to image enhancement preprocessing, and then weld extraction and centerline extraction are performed based on the image enhancement. This improves the accuracy of weld extraction and enhances the adaptability of the algorithm, laying a foundation for the subsequent intelligent welding system to automatically set welding process parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The drawings in the specification are used to provide further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0047] Figure 1 It is a schematic diagram of the process of a method for extracting weld centerline based on pixel points of the present invention;

[0048] Figure 2 It is a structural schematic diagram of a weld centerline extraction system based on pixel points of the present invention;

[0049] Figure 3 It is a schematic diagram of the structure of an electronic device for a method for extracting a weld centerline based on pixel points of the present invention;

[0050] FIG4( a ) is an image enhancement effect of the image enhancement method LPIF of the present invention;

[0051] Figure 4(b) shows the image enhancement effect of the image enhancement method AHE;

[0052] Figure 4(c) shows the image enhancement effect of HE image enhancement method;

[0053] Figure 4(d) shows the image enhancement effect of the image enhancement method CLAHE;

[0054] FIG5( a ) is a workpiece region extraction result based on the image enhancement effect of the image enhancement method LPIF of the present invention;

[0055] Figure 5(b) shows the workpiece region extraction result based on the image enhancement effect of the image enhancement method AHE;

[0056] Figure 5(c) shows the workpiece region extraction result based on the HE image enhancement effect of the image enhancement method;

[0057] Figure 5(d) shows the workpiece region extraction result based on the image enhancement effect of the image enhancement method CLAHE;

[0058] FIG6( a ) is a weld extraction result based on the image enhancement effect of the image enhancement method LPIF of the present invention;

[0059] Figure 6(b) shows the weld extraction result based on the image enhancement effect of the image enhancement method AHE;

[0060] Figure 6(c) shows the weld extraction result based on the HE image enhancement effect of the image enhancement method;

[0061] Figure 6(d) shows the weld extraction result based on the image enhancement effect of the image enhancement method CLAHE;

[0062] Figure 7 This is a flowchart of the weld centerline extraction based on pixel points of the present invention.

[0063] FIG8(a) is a graph showing the S in the local area based image enhancement algorithm of the present invention. i Schematic diagram of the calculation of (x, y).

[0064] FIG8( b ) is an image enhancement algorithm based on local regions in the present invention. i Schematic diagram of the calculation of (x, y).

[0065] Fig. 9 This is a shooting scene of a weld image in an embodiment of the present invention.

[0066] Fig.10 The figure is a schematic diagram of dividing a region of interest of an image into 10 sub-images according to an embodiment of the present invention.

[0067] FIG. 11( a ) is a gray value curve corresponding to one of 10 sub-images of a region of interest of an image according to an embodiment of the present invention.

[0068] FIG. 11( b ) is a gray value curve corresponding to the second of the 10 sub-images of the region of interest of a certain image in an embodiment of the present invention.

[0069] FIG. 11( c ) is a gray value curve corresponding to the third of the 10 sub-images of the region of interest of a certain image in an embodiment of the present invention.

[0070] FIG. 11( d ) is a gray value curve corresponding to four of the ten sub-images of the region of interest of a certain image in an embodiment of the present invention.

[0071] FIG. 11( e ) is a gray value curve corresponding to the fifth of the ten sub-images of the region of interest of a certain image in an embodiment of the present invention.

[0072] FIG. 11( f ) is a gray value curve corresponding to six of the ten sub-images of the region of interest of a certain image according to an embodiment of the present invention.

[0073] FIG. 11( g ) is a gray value curve corresponding to seven of the ten sub-images of the region of interest of a certain image in an embodiment of the present invention.

[0074] FIG. 11( h ) is a gray value curve corresponding to eight of the ten sub-images of the region of interest of a certain image according to an embodiment of the present invention.

[0075] FIG. 11( i ) is a gray value curve corresponding to nine of the ten sub-images of a region of interest of an image according to an embodiment of the present invention.

[0076] FIG. 11( j ) is a gray value curve corresponding to ten sub-images of a region of interest of an image according to an embodiment of the present invention.

[0077] Figure 12(a) shows the result of the segmented extraction of the weld centerline corresponding to the selection function 2 on the original image.

[0078] Figure 12(b) shows the result of the segmented extraction of the weld centerline corresponding to function selection 3 on the original image.

[0079] Figure 12(c) shows the result of the segmented extraction of the weld centerline corresponding to the selection function 4 on the original image.

[0080] Figure 12(d) shows the result of the segmented extraction of the weld centerline corresponding to function selection 5 on the original image.

[0081] Figure 12(e) shows the result of the segmented extraction of the weld centerline corresponding to function selection 6 on the original image.

[0082] Figure 12(f) shows the result of the segmented extraction of the weld centerline corresponding to function selection 7 on the original image.

[0083] Figure 12(g) shows the result of the segmented extraction of the weld centerline corresponding to the selection function 8 on the original image.

[0084] Figure 12(h) shows the result of the segmented extraction of the weld centerline corresponding to function selection 9 on the original image. DETAILED DESCRIPTION

[0085] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0086] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention.

[0087] Embodiment 1

[0088] See also Figure 1 , a method for extracting the center line of a weld based on pixel points, comprising the following steps:

[0089] A weld workpiece image is acquired, and a weld centerline extraction algorithm based on pixel points is used to extract a weld centerline from the weld workpiece image. Specifically, an image enhancement preprocessing method based on a local area is used to obtain an image enhanced weld workpiece image, a weld area is extracted from the image enhanced weld workpiece image, a weld is extracted from the weld area, a segmented weld centerline is extracted from the weld, and the segmented weld centerlines are combined into the entire weld centerline.

[0090] Preferably, the local area based image enhancement algorithm comprises the following steps:

[0091] S1.1, when i=0, the pixel point p is designated as S0(x, y) and I0(x, y) at the same time, p is the center pixel point, and I0(x, y) contains only one pixel point;

[0092] S1.2, when i=1, S1(x, y) includes all neighboring pixels within one pixel distance of S0(x, y), and s1(x, y) does not include the pixels in I0(x, y);

[0093] I1(x,y)=S0(x,y)∪S1(x,y)

[0094] I1(x, y) includes 3×3 pixels, and S1(x, y) includes 8 pixels;

[0095] S1.3, when i=2, S2(x, y) includes all neighboring pixels within one pixel distance of S1(x, y), and S2(x, y) does not include the pixels in I1(x, y);

[0096] I2(x,y)=S0(x,y)∪S1(x,y)∪S2(x,y)

[0097] I2(x, y) contains 5×5 pixels, and S2(x, y) contains 16 pixels;

[0098] S1.4, when i=n, ​​S n(x, y) contains S n-1 All neighboring pixels within one pixel distance of (x, y), but not included in I n-1 The pixel at (x, y);

[0099] I n (x,y)=S0(x,y)∪S1(x,y)∪S2(x,y)∪…∪S n (x, y)

[0100] I n (x, y) contains (2n+1)×(2n+1) pixels, S n (x, y) contains 8n pixels.

[0101] Preferably, the pixel-based weld centerline extraction algorithm includes the following steps:

[0102] S2.1, the weld workpiece image is subjected to image enhancement preprocessing operation based on the image enhancement algorithm of the local area;

[0103] S2.2, selecting a region of interest of the weld workpiece image after image enhancement preprocessing operation;

[0104] S2.3, divide the region of interest into several sub-images along the X-axis direction of the weld workpiece image, name the sub-images respectively, and design a selection function to obtain the expression of the center line;

[0105] S2.4. Determine the starting and ending points of the weld centerline through the centerline and pixel grayscale value.

[0106] Preferably, the selection criteria for selecting the function in S2.3 are:

[0107] S2.3.1. For any sub-image, in the gray value curve, if the number of minimum values ​​of the trough is equal to 1 and the trough value minus the minimum value of the trough is greater than the threshold, then the sub-image is selected, otherwise it is not selected;

[0108] S2.3.2, perform response operations on the selected subgraph;

[0109] S2.3.3. Calculate the average slope and intercept values ​​of the selected subgraph and obtain the expression of the center line.

[0110] Preferably, S2.3.2 is specifically as follows: divide the sub-image into 8 positions along the X-axis direction by column, and perform the following operations on the grayscale values ​​of these 8 positions: if the number of minimum trough values ​​is greater than 1, the index value is equal to the median value of the minimum trough value, and the point coordinates are the values ​​corresponding to the index value of the selection function; if the number of minimum trough values ​​is less than or equal to 1, return to the selection function of step S2.3.

[0111] Preferably, S2.4 is specifically as follows: the pixel grayscale value of the area where the start and end points are located is 255, the grayscale value outside the area where the start and end points are located is 0, and the start and end points of the weld centerline are determined by the intersection of the center line and the center position of the area where the start and end points are located.

[0112] Embodiment 2

[0113] See also Figure 2 , a weld centerline extraction system based on pixel points, including a workpiece image acquisition module for acquiring a weld workpiece image;

[0114] The centerline extraction module is used to extract the weld centerline from the weld workpiece image using a pixel-based weld centerline extraction algorithm. Specifically, the weld workpiece image is preprocessed with an image enhancement algorithm based on a local area to obtain an image enhanced weld workpiece image, the weld area is extracted from the image enhanced weld workpiece image, the weld is extracted from the weld area, the segmented weld centerline is extracted from the weld, and the segmented weld centerlines are combined into the entire weld centerline.

[0115] Preferably, the pixel-based weld centerline extraction algorithm includes the following steps:

[0116] The weld workpiece image is preprocessed with an image enhancement algorithm based on the local area; the region of interest of the weld workpiece image after the image enhancement preprocessing operation is selected; the region of interest is equally divided into several sub-images along the X-axis direction of the weld workpiece image, and the sub-images are named respectively, and a selection function is designed to obtain the expression of the center line; the starting and ending points of the weld center line are determined by the center line and the pixel grayscale value.

[0117] Embodiment 3

[0118] See also Figure 3 An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a pixel-based weld centerline extraction method is implemented.

[0119] Embodiment 4

[0120] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, a method for extracting a weld centerline based on pixel points is provided.

[0121] Embodiment 5

[0122] A pixel-based weld centerline extraction method first performs image enhancement preprocessing on the weld workpiece image, then extracts the weld and the centerline based on the image enhancement to accurately extract the weld.

[0123] Figures 4(a), 4(b), 4(c) and 4(d) are comparison diagrams of image enhancement effects; by comparing the image enhancement method LPIF proposed in this embodiment with the other three image enhancement methods (AHE, HE and CLAHE), it can be seen that the contrast of the image enhanced by the method proposed in this embodiment is higher, and the workpiece and weld area to be extracted are more prominent.

[0124] Based on the image enhancement of Figures 4(a), 4(b), 4(c) and 4(d), the weld area is extracted. In this embodiment, the workpiece portion containing the weld area is first extracted, and the extraction results are shown in Figures 5(a), 5(b), 5(c) and 5(d). Based on this, the results of weld extraction are shown in Figures 6(a), 6(b), 6(c) and 6(d).

[0125] Figure 7 It is a flowchart of weld centerline extraction based on pixel points.

[0126] The method of this embodiment mainly includes an image enhancement algorithm based on a local area and a weld centerline extraction algorithm based on pixel points.

[0127] The steps of the local area based image enhancement algorithm LPIF are described as follows:

[0128] S1.1, when i=0, the pixel point p is designated as S0(x, y), and the pixel point p is also designated as I0(x, y). p is the center pixel point, and I0(x, y) contains only one pixel point;

[0129] S1.2, Image Enhancement Preprocessing Operation When i=1, S1(x, y) contains all neighboring pixels within one pixel distance of S0(x, y), I1(x, y)=S0(x, y)∪S1(x, y), S1(x, y) does not contain pixels in I0(x, y). Here, I1(x, y) includes 3×3 pixels, and S1(x, y) includes 8 pixels;

[0130] S1.3, when i = 2, S2(x, y) includes all neighboring pixels within one pixel distance of S1(x, y), I2(x, y) = S0(x, y) ∪ S1(x, y) ∪ S2(x, y), S2(x, y) does not include the pixels in I1(x, y). Here, I29x, y) contains 5×5 pixels, and S2(x, y) contains 16 pixels;

[0131] S1.4, when i=n, ​​S n (x, y) contains S n-1 All neighboring pixels within one pixel distance of (x, y), but not included in I n-1The pixel in (s, y). n (x,y)=S0(x,y)∪S1(x,y)∪S2(x,y)∪…∪S n (x, y), where I n (x, y) contains a total of (2n+1)×(2n+1) pixels, S n (x, y) contains 8n pixels.

[0132] The S in the above steps i (x, y) and I i The calculation diagrams of (x, y) are shown in FIG8(a) and FIG8(b).

[0133] The steps of the pixel-based weld centerline extraction algorithm are described as follows:

[0134] S2.1, image enhancement preprocessing operation;

[0135] S2.2, image region of interest selection, since the weld area is fixed in the shooting scene of the weld image, the region of interest can be obtained by directly acquiring the sub-image;

[0136] S2.3. Divide the region of interest into 10 sub-images along the X direction of the image, and name them 001.bmp to 010.bmp. Design a selection function with the following selection criteria:

[0137] S2.3.1. For i.bmp, in the gray value curve, if the number of minimum trough values ​​is equal to 1 and the trough value minus the minimum trough value is greater than the threshold thre, then the sub-image is selected; otherwise, it is not selected;

[0138] S2.3.2. Operations in response to the sub-image: Divide the sub-image into eight positions along the X direction by column: 1 / 8, left, 3 / 8, central, 5 / 8, right and 7 / 8, and operate on the grayscale values ​​of these eight positions: If the number of minimum trough values ​​is greater than 1, the index value is equal to the median value of the minimum trough value, and the point coordinates are the corresponding values ​​of the index value of the selection function; If the number of minimum trough values ​​is less than or equal to 1, return to the selection function of step S3;

[0139] S2.3.3. Finally, the average slope and intercept values ​​can be calculated to obtain the expression for the center line;

[0140] S2.4. Determination of the start and end points of the weld centerline: The pixel grayscale value of the area where the start and end points are located is 255, while the grayscale value outside the area is 0. The final start and end points are determined by the intersection of the center line and the center position of the area where the start and end points are located.

[0141] The shooting scene of the weld image is as follows Fig. 9shown.

[0142] Table 1 Running time statistics parameters of image enhancement methods

[0143] image AHE time / s HE time / s CLAHE time / s LPIF time / s a 2.55980 14.481992 14.144671 2.004713 b 11.224345 7.864874 13.544165 2.378461 c 3.265723 7.764823 13.497314 1.587509 d 10.553469 9.212918 14.445665 2.311700 e 1.642783 7.468427 14.193639 1.506409

[0144] From the running time statistical parameters of the five groups of image enhancement methods shown in Table 1, it can be seen that the image enhancement algorithm proposed in this embodiment requires the shortest running time and has higher efficiency.

[0145] For the region of interest of an image, the image is divided into 10 sub-images, such as Fig.10 shown. Fig.10 The gray value curves corresponding to the sub-images are shown in Figures 11(a), 11(b), 11(c), 11(d), 11(e), 11(f), 11(g), 11(h), 11(i), and 11(j).

[0146] The selection function selects 2, 3, 4, 5, 6, 7, 8, and 9, so the corresponding segmented extracted weld centerline results on the original image are shown in Figure 12 (a), Figure 12 (b), Figure 12 (c), Figure 12 (d), Figure 12 (e), Figure 12 (f), Figure 12 (g), and Figure 12 (h). It can be seen that each extracted weld segment is in the center of the weld area. Finally, the center line corresponding to the weld centerline of the above sub-image can be determined as the final center line. The start and end points of the weld centerline are determined by the sudden change of the pixel grayscale value. In all weld images, the start and end points are white, and the neighborhoods except the start and end points are close to black. Therefore, the start and end points can be determined by the intersection of the pixel points in the white area and the center line. The intersection here is the intersection of the center of the white area and the center line as the start and end points.

[0147] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0148] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0149] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for extracting weld centerline based on pixel points, characterized in that: The following steps are involved: A weld workpiece image is acquired, and a weld centerline extraction algorithm based on pixel points is used to extract a weld centerline from the weld workpiece image. Specifically, an image enhancement preprocessing method based on a local area is used to obtain an image enhanced weld workpiece image, a weld area is extracted from the image enhanced weld workpiece image, a weld is extracted from the weld area, a segmented weld centerline is extracted from the weld, and the segmented weld centerlines are combined into the entire weld centerline.

2. The method for extracting weld centerline based on pixel points according to claim 1, characterized in that: The local area based image enhancement algorithm includes the following steps: S1.1, when i=0, the pixel point p is designated as S0(x, y) and I0(x, y) at the same time, p is the center pixel point, and I0(x, y) contains only one pixel point; S1.2, when i=1, S1(x, y) includes all neighboring pixels within one pixel distance of S0(x, y), and S1(x, y) does not include the pixels in I0(x, y); I1(x,y)=S0(x,y)∪S1(x,y) I1(x, y) includes 3×3 pixels, and S1(x, y) includes 8 pixels; S1.3, when i=2, S2(x, y) includes all neighboring pixels within one pixel distance of S1(x, y), and S2(x, y) does not include the pixels in I1(x, y); I2(x,y)=S0(x,y)∪S1(x,y)∪S2(x,y) I2(x, y) contains 5×5 pixels, and S2(x, y) contains 16 pixels; S1.4, when i=n, ​​S n (x, y) contains S n-1 All neighboring pixels within one pixel distance of (x, y), but not included in I n-1 The pixel at (x, y); I n (x,y)=S0(x,y)∪S1(x,y)∪S2(x,y)∪…∪S n (x,y) I n (x, y) contains (2n+1)×(2n+1) pixels, S n (x, y) contains 8n pixels.

3. The method for extracting weld centerline based on pixel points according to claim 1, characterized in that: The pixel-based weld centerline extraction algorithm includes the following steps: S2.1, the weld workpiece image is subjected to image enhancement preprocessing operation based on the image enhancement algorithm of the local area; S2.2, selecting a region of interest of the weld workpiece image after image enhancement preprocessing operation; S2.3, divide the region of interest into several sub-images along the X-axis direction of the weld workpiece image, name the sub-images respectively, and design a selection function to obtain the expression of the center line; S2.

4. Determine the starting and ending points of the weld centerline through the centerline and pixel grayscale value.

4. The method for extracting weld centerline based on pixel points according to claim 3, characterized in that: The selection criteria for selecting the function in S2.3 are: S2.3.

1. For any sub-image, in the gray value curve, if the number of minimum values ​​of the trough is equal to 1 and the trough value minus the minimum value of the trough is greater than the threshold, then the sub-image is selected, otherwise it is not selected; S2.3.2, perform response operations on the selected subgraph; S2.3.

3. Calculate the average slope and intercept values ​​of the selected subgraph and obtain the expression of the center line.

5. The method for extracting weld centerline based on pixel points according to claim 4, characterized in that: S2.3.2 is specifically as follows: divide the sub-image into 8 positions along the X-axis by column, and perform the following operations on the grayscale values ​​of the 8 positions: if the number of minimum trough values ​​is greater than 1, the index value is equal to the median value of the minimum trough value, and the point coordinates are the values ​​corresponding to the index value of the selection function; if the number of minimum trough values ​​is less than or equal to 1, return to the selection function of step S2.

3.

6. The method for extracting weld centerline based on pixel points according to claim 3, characterized in that: S2.4 is specifically: the pixel grayscale value of the area where the start and end points are located is 255, and the grayscale value outside the area where the start and end points are located is 0. The start and end points of the weld centerline are determined by the intersection of the center line and the center position of the area where the start and end points are located.

7. A pixel-based weld centerline extraction system, characterized in that: It includes a workpiece image acquisition module, which is used to acquire a weld workpiece image; The centerline extraction module is used to extract the weld centerline from the weld workpiece image using a pixel-based weld centerline extraction algorithm. Specifically, the weld workpiece image is preprocessed with an image enhancement algorithm based on a local area to obtain an image enhanced weld workpiece image, the weld area is extracted from the image enhanced weld workpiece image, the weld is extracted from the weld area, the segmented weld centerline is extracted from the weld, and the segmented weld centerlines are combined into the entire weld centerline.

8. The pixel-based weld centerline extraction system according to claim 7, characterized in that: The pixel-based weld centerline extraction algorithm includes the following steps: The weld workpiece image is preprocessed with an image enhancement algorithm based on the local area; the region of interest of the weld workpiece image after the image enhancement preprocessing operation is selected; the region of interest is equally divided into several sub-images along the X-axis direction of the weld workpiece image, and the sub-images are named respectively, and a selection function is designed to obtain the expression of the center line, and the sub-image naming suffix is ​​.bmp; the starting and ending points of the weld center line are determined by the center line and the pixel grayscale value.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a pixel-based weld centerline extraction method as described in any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements a pixel-based weld centerline extraction method as claimed in any one of claims 1 to 6.