A method for laser visual fringe classification and weld feature extraction under uncertain interference sources
By identifying uncertain interference sources and running feature extraction algorithms through the support vector machine classifier, the error problem of traditional welding seam tracking systems in extracting welding seam features under uncertain interference is solved, and the welding quality and automation are improved.
Patent Information
- Application Number
- CN202110981813.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-25
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-08-25
AI Technical Summary
Under uncertain interference sources, the traditional laser vision welding seam tracking system is difficult to accurately extract welding seam features, resulting in welding seam trajectory errors and affecting welding quality.
A welding seam interference source classifier based on support vector machine is used to identify different interference source types and run corresponding feature extraction algorithms through dynamic ROI positioning and image preprocessing to reduce the error of welding seam trajectory points.
It improves the accuracy of real-time tracking of welding seams, avoids welding gun collision and incomplete penetration, and improves welding quality and automation.
Smart Images

Figure CN113723494B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot welding, and in particular to a method for laser vision stripe classification and weld feature extraction under uncertain interference sources. Background Art
[0002] Welding technology is known as the "tailor of industry" and is one of the important components of modern manufacturing processes. It is widely used in the fields of automobiles, ships, aerospace, etc. It has become inevitable to realize welding automation and intelligence. Efficient welding robots will be widely used in advanced manufacturing.
[0003] The research on welding robots mainly includes weld tracking, welding path planning and online adjustment of welding process. The accuracy of weld tracking is an important indicator for evaluating welding quality. Laser vision sensing technology is widely used in the field of automatic welding detection due to its high detection accuracy and large detection range. However, the tracking effect of the weld tracking system based on vision sensing depends on the workpiece corner weld and image processing algorithm.
[0004] The traditional laser vision weld tracking system uses laser to illuminate the fillet weld, causing the laser to be deflected at the weld point. The laser deflection point is calculated by image processing method to obtain the weld point. However, under uncertain interference sources, the weld feature points are offset, resulting in changes in the weld trajectory. For example, (1) when weld nodules and weld points appear on the weld path, the weld trajectory should be straight line-curve-straight line, otherwise the gun will hit (2) when the weld assembly gap changes, the welding gun needs to stay for a period of time, otherwise the phenomenon of incomplete penetration will occur. Under such uncertain interference sources, the weld trajectory obtained by the traditional image processing algorithm will have errors, reducing the welding quality. Therefore, how to effectively extract weld features under uncertain interference sources is an urgent problem to be solved in weld tracking. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method for laser visual fringe classification and weld feature extraction under uncertain interference sources. The method can identify the type of interference source that causes the sudden change of laser visual fringe, run the corresponding weld feature point extraction algorithm according to the identified interference source type, and then obtain the weld trajectory points, which can effectively reduce the error of the weld trajectory points and correspondingly improve the accuracy of real-time tracking of the weld.
[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0007] A method for laser visual fringe classification and weld feature extraction under uncertain interference sources, characterized by comprising:
[0008] Step 1: Use a laser vision sensor to shoot images of welds irradiated with lasers under different interference sources, locate the area of the weld points through dynamic ROI, and establish a weld interference source classifier based on support vector machine after image preprocessing;
[0009] Step 2: Acquire the weld image in real time, locate the weld point area through dynamic ROI, pre-process the image in the area and input it into the weld interference source classifier established in step 1 to identify whether there is an interference source and the type of interference source, so as to run the corresponding feature extraction algorithm for feature extraction and perform repair welding based on the extracted features.
[0010] In the above-mentioned method of laser visual stripe classification and weld feature extraction under an uncertain interference source, the interference source includes interference sources such as weld nodules and weld spots that cause local protrusions of the weld, interference sources such as changes in the gap between two welds caused by assembly of welds, and other interference sources that affect the extraction of welding points.
[0011] In the above-mentioned laser visual fringe classification and weld feature extraction method under an uncertain interference source, the collected image is dynamically selected for ROI area, and the area for locating the weld point specifically includes: by converting the original image into a grayscale image, extracting the center of the laser area in the image and counting the number of pixels with grayscale values greater than a certain threshold in the column, and then taking the center of the laser area as the ROI area center, and taking the maximum number of pixels with grayscale values greater than a certain threshold as the ROI area width, the ROI area selection can be achieved.
[0012] In the above-mentioned laser vision stripe classification and weld feature extraction method under an uncertain interference source, a laser vision sensor is used to capture the weld image under the laser irradiation interference source, and the area of the weld point is located through a dynamic ROI. After preprocessing the image, a weld interference source classifier based on a support vector machine obtained through a large amount of training is used to classify the image, and then the relative weld feature extraction method is run.
[0013] In the above-mentioned laser visual stripe classification and weld feature extraction method under an uncertain interference source, the weld interference source classifier is established by a support vector machine, and the weld interference source classifier can automatically identify various interference sources. The method for establishing the classifier is:
[0014] Step 5.1, collect image samples to form a weld laser stripe image set.
[0015] Step 5.2: Preprocess the data.
[0016] First, missing values and redundant values of attributes are handled.
[0017] Secondly, the data is standardized to eliminate the influence of its size difference. A weld laser stripe image of size mxn is expanded into a one-dimensional row vector x i =[z i1 ,z i2 ,…,z in ], l weld laser stripe images can form a matrix X = [x1, x2, ..., x l ] T ,X∈R l×(m×n) , for each row vector x i Perform normalization to obtain the normalized value a ij , which is calculated as
[0018]
[0019]
[0020]
[0021] Normalized row vector x i =[a i1 ,a i2 ,…,a in ], (i=1,2,…,l), number of l image samples
[0022] Step 5.3, Laplacian eigenmap dimensionality reduction, uses the Laplacian eigenmaps algorithm (Laplacian Eigenmaps, LE), including:
[0023] Step 5.31, build a graph, construct a neighbor graph, the graph nodes contain all sample points, assuming that sample points i and j are adjacent, an edge can be determined.
[0024] Step 5.32, determine the weights, determine the weights between points, and use the heat kernel function to determine. If point i and point j are connected, then the weight of their relationship is set to:
[0025]
[0026] x i 、x j is the one-dimensional row vector obtained after data normalization of the i-th and j-th images in the image sample set. Another optional simplified setting is that if points i and j are connected, W ij =1, otherwise W ij =0.
[0027] Step 5.33, feature mapping, calculate the eigenvector y and eigenvalue λ of the Laplacian matrix L: Ly = λDy, where D is a diagonal matrix, the element at position (i, i) on the diagonal of the diagonal matrix D is equal to the sum of the i-th row of the matrix W, and L = DW. Use the eigenvectors corresponding to the smallest m non-zero eigenvalues as the output of the dimensionality reduction result.
[0028] Step 5.34, establish the classifier of the support vector machine. The essence of establishing the support vector machine is to establish the optimal classification hyperplane. The weld interference source classifier uses the labeled training samples to train the model, and then realizes the classification of the test samples by outputting the optimal hyperplane. The establishment of the support vector machine is as follows:
[0029] The classification problem of weld interference sources is a nonlinear problem, so its objective function is
[0030]
[0031] Where: x is the input vector of the test sample set, that is, the feature vector obtained after the test sample image set is processed by data preprocessing and dimensionality reduction by Laplace feature mapping; is a nonlinear mapping, W is the weight vector, and b is the bias vector. It maps the input data to a high-dimensional data space.
[0032] Using the solution idea of maximizing the interval, the classification decision function is finally obtained as
[0033]
[0034] Where: x i The input vector of the training sample set, that is, the feature vector obtained after the training sample image set is processed by data preprocessing and dimensionality reduction by Laplace feature mapping. i is the label corresponding to the i-th laser image sample, K(x i ,x) is the kernel function, which represents the inner product of two points in the high-dimensional feature space mapped to Here we choose the Gauss radial basis function (RBF) kernel function with strong learning ability and small error as
[0035]
[0036] Among them, σ is the kernel function coefficient, which has high flexibility.
[0037] After preprocessing and Laplace feature mapping dimensionality reduction, the corresponding feature parameter set x is extracted from the training data i , i=1,2,…,N, where N represents the number of training data; further adding type labels, the final feature parameter set is [x i ;y i ],i=1,2,…,N, where yi Represents the type label of the i-th training data; the type labels corresponding to the cases of no interference source, local bulge interference source and weld gap interference source are 1, 2 and 3 respectively.
[0038] Step 5.35: When the support vector machine is trained, the process includes:
[0039] ① Distinguish between the cases of no interference source, weld gap interference source and local convex interference source, set the type label corresponding to the local convex interference source to 1, and set the interference type label corresponding to the cases of no interference source and weld gap interference source to -1. After the training is completed, remove the feature parameters of the local convex interference source from the feature parameter set;
[0040] ② Distinguish the situations of no interference source and weld gap interference source, set the type label corresponding to the weld gap interference source to 1, and set the type label corresponding to the no interference source to -1.
[0041] After ①②, we get the support vector machine model, which includes two classification decision functions of the type (6), which are denoted as f1(x) and f2(x) respectively.
[0042] Step 5.36: Test the classifier effect. Use the test set to test the weld interference source classifier to enable it to correctly classify different images.
[0043] After preprocessing and Laplace feature mapping, the corresponding feature parameter set x is extracted from the training data i , i = 1, 2, ..., N, sent to the support vector machine model established in step 5.34, where:
[0044] If f1(x)=1, it is a local convex interference source, and the recognition result is recorded as 1;
[0045] If f2(x)=1, it is the case of weld gap interference source, and the identification result is recorded as 2;
[0046] If f1(x)=1 or f2(x)=1 is not satisfied, there is no interference source, and the recognition result is recorded as 3.
[0047] In the above-mentioned method of laser visual fringe classification and weld feature extraction under an uncertain interference source, for the first type of interference source such as weld nodules and weld spots causing local protrusions in the weld, the feature extraction algorithm includes:
[0048] Step 6.1: Preprocess the image. The preprocessing steps are to perform LOG filtering and median filtering on the image to remove most of the noise, then use the adaptive threshold method to perform image binarization, and then remove isolated blocks with an area smaller than the threshold according to the eight-neighborhood marking method. After preprocessing, the splash, arc light, smoke and other interference in the image are effectively removed.
[0049] Step 6.2: After preprocessing, feature points of the image need to be extracted. The steps of feature point extraction are area division, extraction of center line and intersection, and extraction of arc width and height.
[0050] Region division: Divide the laser stripe into two regions to facilitate the extraction of the center line. Specifically: Start from the upper left corner of the image, from top to bottom, and from left to right by row to search for pixels with grayscale values greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If there are, use the point as the starting point, open small windows to the lower right and lower left, and count the pixels of the two windows obtained. Select the window with more pixels as the effective window 1, which contains a laser line.
[0051] Similarly, start from the upper right corner of the image, from bottom to top, and search from right to left by row for pixels whose grayscale values are greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If so, use the point as the starting point, open small windows to the upper right and upper left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 2, which contains another laser line.
[0052] Extract the center line and intersection point: The two effective windows obtained deflect the laser line to obtain two straight lines which are stored in different areas respectively. The pixels in different areas are fitted to obtain fitting curves and the angle of the fitting line. According to different angles, all pixels with grayscale values greater than a certain threshold are extracted in the row (or column) direction. The pixels in each row are randomly selected to fit the line using the minimum median method. The minimum median obtained is judged to be less than a certain threshold. If it is less than, the line is selected as the extracted center line. After the above processing of the two areas, the center lines of the two straight lines are obtained (y1=a1*x1+b1, y2=a2*x2+b2), and then the intersection point (X, Y) of the two lines is calculated.
[0053] Extract the width and height of the arc: For the laser image under the interference source of the first type of weld nodules, weld spots, etc. that cause local protrusions in the weld, it is necessary to obtain the width and height of the laser line arc. For the obtained intersection point (X, Y), search for pixel points along the directions of the two detected straight lines (y1=a1*x1+b1, y2=a2*x2+b2). After searching for continuous pixel points, take the first pixel point (X1, Y1) (X2, Y2) with a grayscale value greater than the threshold as the endpoint. The distance between the two endpoints is the width W1 of the arc. Use a perpendicular line to make the two end points, and translate the perpendicular line from one end point to the other. During this period, detect the pixel points on the perpendicular line and determine the distance L from the pixel point to the perpendicular line. i , compare the detected distances, and find the maximum distance L1, which is the height of the arc. So far, the width W1 and height L1 of the arc have been found. After spatial coordinate conversion, it is converted into the height and width of the interference source at that point, so as to determine the height and range of the gun lift during welding.
[0054] The laser visual fringe classification and weld feature extraction method under the above-mentioned uncertain interference source, for the interference source of the second type of weldment assembly inconsistency causing the gap change between the two weldments, the extraction algorithm includes:
[0055] Step 7.1: Preprocess the image. The preprocessing steps are to perform LOG filtering and median filtering on the image to remove most of the noise, then use the adaptive threshold method to perform image binarization, and then remove isolated blocks with an area smaller than the threshold according to the eight-neighborhood marking method. After preprocessing, the splash, arc light, smoke and other interference in the image are effectively removed.
[0056] Step 7.2: After preprocessing, feature points of the image need to be extracted. The steps of feature point extraction are area division, extraction of center lines and intersections, and extraction of separation stripe endpoints.
[0057] Region division: Divide the laser stripe into two regions to facilitate the extraction of the center line. Specifically: Start from the upper left corner of the image, from top to bottom, and from left to right by row to search for pixels with grayscale values greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If there are, use the point as the starting point, open small windows to the lower right and lower left, and count the pixels of the two windows obtained. Select the window with more pixels as the effective window 1, which contains a laser line.
[0058] Similarly, start from the upper right corner of the image, from bottom to top, and search from right to left by row for pixels whose grayscale values are greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If so, use the point as the starting point, open small windows to the upper right and upper left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 2, which contains another laser line.
[0059] Extract the center line and intersection point: The two effective windows obtained deflect the laser line to obtain two straight lines which are stored in different areas respectively. The pixels in different areas are fitted to obtain fitting curves and the angle of the fitting line. According to different angles, all pixels with grayscale values greater than a certain threshold are extracted in the row (or column) direction. The pixels in each row are randomly selected to fit the line using the minimum median method. The minimum median obtained is judged to be less than a certain threshold. If it is less than, the line is selected as the extracted center line. After the above processing of the two areas, the center lines of the two straight lines are obtained (y1=a1*x1+b1, y2=a2*x2+b2), and then the intersection point (X, Y) of the two lines is calculated.
[0060] Extract the endpoints of the separation stripes: For the laser image under the interference source of the second type of weldment assembly inconsistency, which causes the gap between the two weldments to change, it is necessary to obtain the two endpoints of the separation stripes close to the intersection. For the obtained intersection (X, Y), search for pixels along the directions of the two detected straight lines (y1 = a1*x1+b1, y2 = a2*x2+b2), and select the pixel point (X3, Y3) (X4, Y4) closest to the intersection on the laser line segment with a gray value greater than the threshold. The two endpoints of the two line segments at the desired intersection can be obtained. The distance W2 between the two endpoints is converted into the gap b of the weldment at that location through spatial coordinate conversion. During welding, the moving speed V of the welding gun is determined according to the gap width b here. C , formula (8) is
[0061]
[0062] Where h is the thickness of the weld, Q is the flow rate of the welding wire, and b is the width of the gap.
[0063] In general, the above technical scheme conceived by the present invention has the following technical advantages compared with the prior art: 1. The present invention performs compensation calculation for the case where the extracted weld feature points have errors under the influence of the interference source of the local protrusion of the weld, thereby obtaining more accurate weld trajectory points, avoiding the phenomenon of welding gun collision, and correspondingly improving the accuracy of real-time tracking of the weld. 2. The present invention performs compensation calculation for the case where the extracted weld feature points have errors under the influence of the interference source of the variable assembly gap, thereby obtaining more accurate weld trajectory points, avoiding the phenomenon of unfused and incomplete penetration, and improving the welding quality. 3. The present invention establishes a weld interference source classifier based on a support vector machine for the different weld tracking compensation algorithms implemented under different interference sources encountered during the automatic welding process, so as to identify the laser visual stripes under different interference sources, so as to use the corresponding welding compensation algorithm, thereby realizing real-time compensation control of the welding tracking algorithm under uncertain interference sources, improving the degree of automation, and further improving the welding quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 Schematic diagram of different interference sources.
[0065] Figure 2a This is the image of the laser irradiated under the interference source (the laser irradiated the local convex image of the weld).
[0066] Figure 2b This is the image of the laser irradiated under the interference source (the image of the laser irradiated on the small assembly gap).
[0067] Figure 2c This is the image of the laser irradiated under the interference source (the image of the laser irradiated on the large assembly gap).
[0068] Figure 3a This is the dynamic positioning ROI area image in the present invention (the local raised image of the weld irradiated by the laser).
[0069] Figure 3b This is the image of the dynamically positioned ROI area in the present invention (the image where the laser irradiates a small gap in the assembly).
[0070] Figure 3c This is the image of the dynamically positioned ROI area in the present invention (the image where the laser is irradiated on a large assembly gap).
[0071] Figure 4a : The laser stripe images under different interference sources in the present invention (laser stripe images under local protrusion of the weld).
[0072] Figure 4b These are laser stripe images under different interference sources in the present invention (laser stripe images with small assembly gaps).
[0073] Figure 4c These are laser stripe images under different interference sources in the present invention (laser stripe images with large assembly gaps).
[0074] Figure 5 The present invention provides a flow chart for establishing a weld interference source classifier of a support vector machine.
[0075] Figure 6 The present invention is a flow chart of a weld tracking algorithm under the influence of interference sources such as local protrusions in the weld and variable assembly gaps.
[0076] Figure 7 Schematic diagram of laser arc stripe width and height for a local raised interference source.
[0077] Figure 8 Schematic diagram of laser separation stripe width for variation in gap. DETAILED DESCRIPTION
[0078] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0080] As introduced in the background technology, under uncertain interference sources, laser stripes will show different mutations, causing errors in the extraction of weld feature points, and thus making the existing visual sensor tracking effect poor. However, the existing technology has great limitations in the extraction of weld features under uncertain interference sources. In order to solve the above technical problems, the present invention proposes a method for laser visual stripe classification and weld feature extraction under uncertain interference sources. The method can identify the type of interference source that causes the laser visual stripe mutation, run the corresponding weld feature point extraction algorithm according to the identified interference source type, and then obtain the weld trajectory points, thereby effectively reducing the error of the weld trajectory points and correspondingly improving the accuracy of real-time tracking of the weld.
[0081] In order to achieve the above requirements, the present invention is implemented through the following technical solutions:
[0082] Step 1: Use a laser vision sensor to capture images of the weld under laser irradiation with different interference sources.
[0083] Specifically, it is first necessary to use a laser vision sensor to capture a large number of weld images under laser irradiation with different interference sources. The interference sources are mainly divided into two categories: one is the local bulge of the weld caused by weld nodules and weld spots, and the other is the change in the gap between the two welds caused by inconsistent assembly of welds. The number of photos taken should be large and include various types in order to prepare for the establishment of a support vector machine later.
[0084] Figure 1 Schematic diagram of different interference sources shown.
[0085] Step 2: Use dynamic ROI to locate the area of the weld point;
[0086] Specifically, by counting the number of pixels with grayscale values greater than a certain threshold in the laser area of the image, and then taking the center of the laser area as the center of the ROI area and selecting a certain ROI area width, ROI area selection can be achieved. Figure 2a to Figure 2c For example:
[0087] The centroid method is used to extract the regional center of the image, that is, by calculating the pixel points whose grayscale values are greater than a certain threshold in the image column by column, the centroid coordinates calculated for each column are used as the center coordinates of each column of the laser area. The calculation formula (1) is:
[0088]
[0089] Among them, i is the row coordinate, j is the column coordinate, m is the number of rows in the image, n is the number of columns in the image, and x j is the row coordinate of the jth column of the white area in the preprocessed image, y i is the column coordinate of the i-th row of the white area in the preprocessed image.
[0090] The center of the ROI area is determined by extracting the center of the laser area in the image; the maximum number of white pixels in the column and row is obtained by counting the number of pixels in each column and row whose grayscale value is greater than a certain threshold, and the maximum value is set as L m Then extract the collected image rows distributed in [x j -L m / 2,x j +L m / 2], and then obtain the ROI area containing the laser weld feature points, such as Figures 3a to 3c shown.
[0091] Step 3: Establish a weld interference source classifier based on support vector machine. The method of establishing the classifier is as follows:
[0092] 1) Collect a large number of image samples to form a weld laser stripe image set.
[0093] 2) Preprocess the data.
[0094] First, missing values and redundant values of attributes are handled.
[0095] Secondly, the data is standardized to eliminate the influence of size differences. An m×n weld laser stripe image is expanded into a one-dimensional row vector x i =[z i1 ,z i2 ,…,z in ], l weld laser stripe images can form a matrix X = [x1, x2, ..., x l ] T ,X∈R l×(m×n) , for each row vector x i Perform normalization to obtain the normalized value a ij , which is calculated as
[0096]
[0097]
[0098]
[0099] Normalized row vector x i =[a i1 ,a i2 ,…,a in ], (i=1,2,…,l), l is the number of image samples
[0100] 3) Laplace eigenmap dimensionality reduction
[0101] The image features at the interference source include the position of the stripes, the aspect ratio of the stripes, the length-to-area ratio of the stripes, the circularity of the stripes, the rectangularity of the stripes and other features. Too many variables in the image attributes will increase a lot of computing load, and related variables need to be deleted. Therefore, various geometric feature vectors are reduced in dimension to improve the linear independence between the input variables and reduce noise. At the same time, it also further reduces the redundant description of the feature data, and finally the feature vector extracted after dimensionality reduction is used as the input sample.
[0102] The dimensionality reduction process uses the Laplacian Eigenmaps (LE) algorithm. The Laplacian Eigenmaps method uses the graph Laplacian operator to represent the local feature structure of the manifold. It believes that points that are very close in high-dimensional space should also be very close when projected into low-dimensional space. It is suitable for clustering and classification problems, and has good convergence and robustness. Specifically, the steps of the Laplacian Eigenmaps algorithm are:
[0103] Step 1: Build the graph
[0104] Construct a neighbor graph, where the graph nodes contain all sample points. If sample points i and j are adjacent, an edge can be determined. There are generally two types of neighbor criteria: ξ-nearest neighbor and K-NN nearest neighbor.
[0105] Step 2: Determine the weights
[0106] To determine the weight between points, the heat kernel function is generally used to determine it. If point i and point j are connected, the weight of their relationship is set as:
[0107]
[0108] x i 、x j is the one-dimensional row vector obtained after data normalization of the i-th and j-th images in the image sample set. Another optional simplified setting is that if points i and j are connected, W ij =1, otherwise W ij =0.
[0109] Step 3: Feature mapping, calculate the eigenvector y and eigenvalue λ of the Laplacian matrix L: Ly = λDy, where D is a diagonal matrix, and the element at position (i, i) on the diagonal of the diagonal matrix D is equal to the sum of the i-th row of the matrix W, L = DW. Use the eigenvector corresponding to the smallest m non-zero eigenvalues as the output of the dimensionality reduction result.
[0110] Step 5.34, establish the classifier of the support vector machine. The essence of establishing the support vector machine is to establish the optimal classification hyperplane. The weld interference source classifier uses the labeled training samples to train the model, and then realizes the classification of the test samples by outputting the optimal hyperplane. The establishment of the support vector machine is as follows:
[0111] The classification problem of weld interference sources is a nonlinear problem, so its objective function is
[0112]
[0113] Where: x is the input vector of the test sample set, that is, the feature vector obtained after the test sample image set is processed by data preprocessing and dimensionality reduction by Laplace feature mapping; is a nonlinear mapping, W is the weight vector, and b is the bias vector. It maps the input data to a high-dimensional data space.
[0114] Using the solution idea of maximizing the interval, the classification decision function is finally obtained as
[0115]
[0116] Where: x i The input vector of the training sample set, that is, the feature vector obtained after the training sample image set is processed by data preprocessing and dimensionality reduction by Laplace feature mapping. i is the label corresponding to the i-th laser image sample, K(x i ,x) is the kernel function, which represents the inner product of two points in the high-dimensional feature space mapped to Here we choose the Gauss radial basis function (RBF) kernel function with strong learning ability and small error as
[0117]
[0118] Among them, σ is the kernel function coefficient, which has high flexibility.
[0119] After preprocessing and Laplace feature mapping dimensionality reduction, the corresponding feature parameter set x is extracted from the training data i , i=1,2,…,N, where N represents the number of training data; further adding type labels, the final feature parameter set is [x i ;y i ],i=1,2,…,N, where y i Represents the type label of the i-th training data; the type labels corresponding to the cases of no interference source, local bulge interference source and weld gap interference source are 1, 2 and 3 respectively.
[0120] When the support vector machine is trained, the process includes: ① distinguishing the situations of no interference source, weld gap interference source and local protrusion interference source, setting the type label corresponding to the local protrusion interference source to 1, and setting the interference type label corresponding to the situations of no interference source and weld gap interference source to -1. After the training is completed, the characteristic parameters of the local protrusion interference source are removed from the characteristic parameter set; ② distinguishing the situations of no interference source and weld gap interference source, setting the type label corresponding to the weld gap interference source to 1, and setting the type label corresponding to the no interference source to -1.
[0121] After the above ①②, we get the support vector machine model, which includes two classification decision functions of the type (7), which are denoted as f1(x) and f2(x) respectively.
[0122] 5) Classifier effect test: Use the test set to test the weld interference source classifier so that it can correctly classify different images.
[0123] Specifically, the corresponding feature parameter set x is extracted from the training data after preprocessing and Laplace feature map dimensionality reduction i , i = 1, 2, ..., N, and sent to the support vector machine model established in (4), where:
[0124] If f1(x)=1, it is a local convex interference source, and the recognition result is recorded as 1;
[0125] If f2(x)=1, it is the case of weld gap interference source, and the identification result is recorded as 2;
[0126] If f1(x)=1 or f2(x)=1 is not satisfied, there is no interference source, and the recognition result is recorded as 3.
[0127] Figure 5 The present invention provides a flow chart for establishing a weld interference source classifier of a support vector machine.
[0128] Step 4: Establish the corresponding weld feature extraction method under different interference sources.
[0129] Specifically, to establish the corresponding weld feature extraction method under different interference sources, it is necessary to first analyze the principle of error caused by each interference source, and then propose a corresponding compensation algorithm.
[0130] For the first type of interference sources such as weld nodules and weld spots that cause local protrusions in the weld, the laser will bend when irradiated on the interference source. According to the traditional weld feature extraction algorithm, the intersection of two straight lines is regarded as the weld feature point, which will cause the welding gun to hit the interference source of the local protrusion of the weld during welding. Therefore, a new feature extraction algorithm should be adopted to compensate for this situation. The new feature extraction algorithm requires the intersection of the two straight lines where the two line segments are located and the width and height of the curved arc of the laser stripe at this point. The position of the welding plane is determined by the intersection of the two straight lines, and the height and width of the protruding interference source at this point are determined by the width and height of the curved arc at this point, thereby determining the height and range of the gun lift during welding.
[0131] For the interference source of the second type of weldment assembly inconsistency, which causes the gap change between the two weldments. When the laser is irradiated on a weld with a small gap, the laser stripes are deflected in the weld, and the deflection point is tightly combined, and the laser lines intersect directly at one point; when the laser is irradiated on a weld with a large gap, the laser stripes are deflected in the weld, and the stripes are separated at the deflection point, and the laser lines do not intersect at one point. According to the traditional weld feature extraction algorithm, the intersection of two straight lines is regarded as the weld feature point. During welding, due to the large weld gap, the welding will not be fused and not penetrated at the position with a large gap. Therefore, a new feature extraction algorithm should be adopted to compensate for this situation. First, the intersection of the two straight lines where the two line segments are located is calculated, and then the two endpoints of the two line segments at the intersection are calculated. The intersection of the two straight lines determines the position of the welding plane, and the distance between the two endpoints is the gap of the weld at that point. During welding, the moving speed of the welding gun is determined according to the gap width here.
[0132] Specifically, if Figure 6 As shown in the figure, it is a flow chart of the weld tracking algorithm under the influence of interference sources of local protrusions and variable assembly gaps of the weld. For the weld tracking algorithm under the two interference sources, it is necessary to preprocess the image first. The preprocessing steps are to first perform LOG filtering and median filtering on the image to remove most of the noise, then use the adaptive threshold method to perform image binarization, and then remove isolated blocks with an area smaller than the threshold according to the eight-neighborhood labeling method. After preprocessing, the interference such as splash, arc light, smoke, etc. in the image is effectively removed.
[0133] After preprocessing, feature point extraction is performed on the image. The steps of feature point extraction are to calculate the sum of the grayscale values of the pixels in the row direction of the image, find the first row whose grayscale value sum is not 0 from bottom to top, and search from left to right for the first non-0 pixel in the row and record the coordinates of the point. Find the coordinates of the leftmost and rightmost pixels of the laser stripe. Based on the above information, open small windows for the left and right oblique lines of the laser stripe, and segment the results.
[0134] First, start the image from the upper left corner, from top to bottom, and search from left to right by row for pixels whose grayscale values are greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If so, use the point as the starting point, open small windows to the lower right and lower left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 1, which contains a laser line.
[0135] Similarly, start from the upper right corner of the image, from bottom to top, and search from right to left by row for pixels whose grayscale values are greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If so, use the point as the starting point, open small windows to the upper right and upper left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 2, which contains another laser line.
[0136] The two effective windows obtained deflect the laser line to obtain two straight lines which are stored in different areas respectively. The pixels in different areas are fitted to obtain fitting curves and the angles of the fitting lines. According to different angles, all pixels with grayscale values greater than a certain threshold are extracted in the row (or column) direction. The pixels in each row are randomly selected to fit the line using the minimum median method. The minimum median obtained is judged to be less than a certain threshold. If it is less than a certain threshold, the line is selected as the extracted center line. After the two areas are processed as above, the center lines of the two straight lines are obtained (y1=a1*x1+b1, y2=a2*x2+b2), and then the intersection point (X, Y) of the two lines is calculated.
[0137] For the laser image under the first interference source, it is necessary to obtain the width and height of the laser line arc, such as Figure 7 The figure shows the image after image refinement. The obtained intersection point (X, Y) is searched for pixels along the directions of the two detected straight lines (y1 = a1*x1+b1, y2 = a2*x2+b2). After continuous pixel points are searched, the first pixel point (X1, Y1) (X2, Y2) with a gray value greater than the threshold is taken as the endpoint. The distance between the two endpoints is the width W1 of the arc, and a perpendicular line is made between the two endpoints. The perpendicular line is translated from one endpoint to the other. During this period, the pixel points on the perpendicular line are detected, and the distance L from the pixel point to the perpendicular line is determined. i , compare the detected distances, and find the maximum distance L1, which is the height of the arc. So far, the width W1 and height L1 of the arc have been found. After the spatial coordinate transformation, it is converted into the height and width of the interference source, so as to determine the height and range of the gun lift during welding. This interference source is a raised weld nodule, and the trajectory of the welding gun at this location is a circular arc-shaped raised trajectory. A picture can only determine the height of the weld nodule at the weld point irradiated by the laser. If it moves forward or backward, the detected height will change. Therefore, the height and width detected at this location can only determine the height and range of the welding gun at this point. At this time, the height and width at this location are also the height and range of the welding gun at this point.
[0138] For the laser image under the second interference source, it is necessary to obtain the two endpoints of the separated stripes close to the intersection. For the intersection (X, Y), search for pixels along the directions of the two detected straight lines (y1=a1*x1+b1, y2=a2*x2+b2) respectively, and select the pixel (X3, Y3) (X4, Y4) closest to the intersection on the laser line segment with a gray value greater than the threshold. The two endpoints of the two line segments at the desired intersection can be obtained. The distance W2 between the two endpoints is converted into the gap b of the weldment at this location through spatial coordinate conversion. During welding, the moving speed V of the welding gun is determined according to the gap width b here. C , the formula is
[0139]
[0140] Where h is the thickness of the weld, Q is the flow rate of the welding wire, and b is the width of the gap.
[0141] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
Claims
1. A method for laser visual fringe classification and weld feature extraction under uncertain interference sources, It is characterized in that include: Step 1: Use a laser vision sensor to shoot images of welds irradiated with lasers under different interference sources, locate the area of the weld points through dynamic ROI, and establish a weld interference source classifier based on support vector machine after image preprocessing; Step 2: Acquire the weld image in real time, locate the weld point area through dynamic ROI, pre-process the image in the area and input it into the weld interference source classifier established in step 1 to identify whether there is an interference source and the type of interference source, so as to run the corresponding feature extraction algorithm to extract features, and perform repair welding according to the extracted features; The interference sources include the interference sources of local protrusion of weld caused by weld nodules and weld spots, and the interference sources of gap changes between two welds caused by weld assembly, which are two interference sources that affect the extraction of weld points. For the first type of interference source caused by weld nodules and weld spots causing local protrusions in the weld, the feature extraction algorithm includes: Step 6.1, preprocess the image. The preprocessing steps are to first perform LOG filtering and median filtering on the image to remove most of the noise, then use the adaptive threshold method to perform image binarization, and then remove isolated blocks with an area smaller than the threshold according to the eight-neighborhood marking method; after preprocessing, the splash, arc light, and smoke interference in the image are effectively removed; Step 6.2: After preprocessing, feature point extraction is performed on the image. The steps of feature point extraction are area division, extraction of center line and intersection, and extraction of arc width and height. Region division: Divide the laser stripe into two regions to facilitate the extraction of the center line; first start from the upper left corner of the image, from top to bottom, and from left to right by row to search for pixels with grayscale values greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If there are, use the point as the starting point, open small windows to the lower right and lower left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 1, which contains a laser line; Similarly, start from the lower right corner of the image, from bottom to top, and search from right to left by row for pixels whose grayscale values are greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If there are, use the point as the starting point, open small windows to the upper right and upper left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 2, which contains another laser line. Extract the center line and intersection point: The two effective windows obtained deflect the laser line to obtain two straight lines, which are stored in different areas respectively. The pixel points in different areas are fitted to obtain the fitted straight line, and the angle of the fitted straight line is obtained. According to the different angles, all the pixel points with grayscale values greater than a certain threshold are extracted in the row or column direction. The pixel points in each row are randomly selected to use the minimum median method for straight line fitting. The minimum median value is judged to be less than a certain threshold. If it is less than a certain threshold, the straight line is selected as the extracted center line. After the two areas are processed as above, the center line y of the two straight lines is obtained. 1 =a 1 *x 1 +b 1 ,y 2 =a 2 *x 2 +b 2 , and then calculate the intersection point (X, Y) of the two lines; Extract the width and height of the arc: For the laser image under the interference source of the first type of weld nodules and weld spots causing local bulges in the weld, it is necessary to obtain the width and height of the laser line arc, and the intersection point (X, Y) is respectively detected along the two straight lines y 1 =a 1 *x 1 +b 1 ,y 2 =a 2 *x 2 +b 2 Search for pixels in the direction of the pixel point, and after searching for consecutive pixels, take the pixel point (X 1 ,Y 1 )(X 2 ,Y 2 ) are the endpoints, and the distance between the two endpoints is the width W of the arc 1 , as a perpendicular line between the two end points, translate the perpendicular line from one end point to the other end point, detect the pixel points on the perpendicular line during the process, and determine the distance L from the pixel point to the line connecting the two end points i , compare the detected distances and find the maximum distance L 1 , this distance is the height of the arc; so far, the width W of the arc has been calculated 1 and height L 1 ; After spatial coordinate transformation, it is converted into the height and width of the interference source at that point, thereby determining the height and range of lifting the gun during welding.
2. According to the method of laser visual fringe classification and weld feature extraction under uncertain interference source described in claim 1, It is characterized in that Dynamic ROI area selection is performed on the acquired image, and the area of the weld point is located specifically including: by converting the original image into a grayscale image, extracting the center of the laser area in the image and counting the number of pixels with grayscale values greater than a certain threshold in the column, and then taking the center of the laser area as the ROI area center, and taking the maximum number of pixels with grayscale values greater than a certain threshold as the ROI area width, that is, realizing ROI area selection.
3. According to the method for laser visual fringe classification and weld feature extraction under uncertain interference source described in claim 1, It is characterized in that A laser vision sensor is used to capture the weld image under laser irradiation of interference source. The area of the weld point is located through dynamic ROI. After preprocessing the image, the weld interference source classifier based on support vector machine obtained through a large amount of training is used to classify the image, and then the relative weld feature extraction method is run.
4. According to the method for laser visual fringe classification and weld feature extraction under uncertain interference source described in claim 1, It is characterized in that The weld interference source classifier is established by a support vector machine, and the weld interference source classifier can automatically identify various interference sources; the method for establishing the classifier is: Step 5.1, collecting image samples to form a weld laser stripe image set; Step 5.2: Preprocess the data; First, missing values and redundant values of attributes are handled; Secondly, the data is standardized to eliminate the influence of size differences; an mxn size weld laser stripe image is expanded into a one-dimensional row vector x i =[z i1 ,z i2 ,…,z in ], l weld laser stripe images form a matrix X = [x 1 ,x 2 ,...,x l ] T ,X∈R l×(m×n) , for each row vector x i Perform normalization to obtain the normalized value a ij , which is calculated as Normalized row vector x i =[a i1 ,a i2 ,…,a in ], i = 1, 2, ..., l, the number of l image samples; Step 5.3, Laplace eigenmap dimensionality reduction, uses the Laplace eigenmap algorithm, including: Step 5.31, build a graph, construct a neighbor graph, the graph nodes contain all sample points, assuming that sample points i and j are adjacent, then determine an edge; Step 5.32, determine the weights, determine the weights between points, and use the heat kernel function to determine. If point i and point j are connected, then the weight of their relationship is set to: x i 、x j is the one-dimensional row vector obtained after data normalization of the i-th image and the j-th image in the image sample set; If points i and j are connected, W ij =1, otherwise W ij =0; Step 5.33, feature mapping, calculate the eigenvector y and eigenvalue λ of the Laplace matrix L: Ly = λDy, where D is a diagonal matrix, the element at position (i,i) on the diagonal line of the diagonal matrix D is equal to the sum of the i-th row of the matrix W, L = DW; the eigenvectors corresponding to the smallest m non-zero eigenvalues are used as the output of the result after dimensionality reduction; Step 5.34, establish the classifier of the support vector machine; the essence of establishing the support vector machine is to establish the optimal classification hyperplane. The weld interference source classifier uses the labeled training samples to train the model, and then realizes the test sample classification by outputting the optimal hyperplane; the establishment of the support vector machine is as follows: The classification problem of weld interference sources is a nonlinear problem, so its objective function is Where: x is the input vector of the test sample set, that is, the feature vector obtained after the test sample image set is processed by data preprocessing and dimensionality reduction by Laplace feature mapping; is a nonlinear mapping, W is the weight vector; b is the bias vector; it maps the input data to a high-dimensional data space; Using the solution idea of maximizing the interval, the classification decision function is finally obtained as Where: x i The input vector of the training sample set, that is, the feature vector obtained after the training sample image set is processed by data preprocessing and dimensionality reduction by Laplace feature mapping; y i is the label corresponding to the i-th laser image sample, K(x i ,x) is the kernel function, which represents the inner product of two points in the high-dimensional feature space mapped to Here we choose the Gauss radial basis kernel function with strong learning ability and small error as Among them, σ is the kernel function coefficient, which has high flexibility; After preprocessing and Laplace feature mapping dimensionality reduction, the corresponding feature parameter set x is extracted from the training data i , i=1,2,…,N, where N represents the number of training data; further adding type labels, the final feature parameter set is [x i ;y i ],i=1,2,…,N, where y i represents the type label of the i-th training data; the type labels corresponding to the cases of no interference source, local bulge interference source and weld gap interference source are 1, 2 and 3 respectively; Step 5.35: When the support vector machine is trained, the process includes: ① Distinguish between the cases of no interference source, weld gap interference source and local convex interference source, set the type label corresponding to the local convex interference source to 1, and set the interference type label corresponding to the cases of no interference source and weld gap interference source to -1. After the training is completed, remove the feature parameters of the local convex interference source from the feature parameter set; ② Distinguish between the situation of no interference source and weld gap interference source, set the type label corresponding to the weld gap interference source to 1, and set the type label corresponding to the no interference source to -1; After ①②, we get the support vector machine model, which includes two classification decision functions of the type (6), which are denoted as f 1 (x),f 2 (x); Step 5.36, classifier effect test: Use the test set to test the weld interference source classifier so that it can correctly classify different images; After preprocessing and Laplace feature mapping, the corresponding feature parameter set x is extracted from the training data i , i = 1, 2, ..., N, sent to the support vector machine model established in step 5.34, where: If f 1 (x) = 1, it is a local protruding interference source, and the recognition result is recorded as 1; If f 2 (x) = 1, it is the case of weld gap interference source, and the identification result is recorded as 2; If f is not satisfied 1 (x) = 1 and f 2 (x) = 1, there is no interference source, and the recognition result is recorded as 3.
5. According to the method of laser visual fringe classification and weld feature extraction under uncertain interference source described in claim 2, It is characterized in that For the interference source of the second type of weldment assembly inconsistency causing the gap change between the two weldments, the extraction algorithm includes: Step 7.1, preprocess the image. The preprocessing steps are to first perform LOG filtering and median filtering on the image to remove most of the noise, then use the adaptive threshold method to perform image binarization, and then use the eight-neighborhood marking method to remove isolated blocks with an area smaller than the threshold. After preprocessing, the splash, arc light, and smoke interference in the image are effectively removed; Step 7.2: After preprocessing, feature point extraction is performed on the image. The steps of feature point extraction are area division, extraction of center lines and intersection points, and extraction of separation stripe endpoints. Region division: Divide the laser stripe into two regions to facilitate the extraction of the center line; first start from the upper left corner of the image, from top to bottom, and from left to right by row to search for pixels with grayscale values greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If there are, use the point as the starting point, open small windows to the lower right and lower left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 1, which contains a laser line; Similarly, start from the lower right corner of the image, from bottom to top, and search from right to left by row for pixels whose grayscale values are greater than the threshold. After obtaining the first point, search whether there are dense pixels in the area near the point. If there are, use the point as the starting point, open small windows to the upper right and upper left, and count the pixels of the two windows obtained respectively. Select the window with more pixels as the effective window 2, which contains another laser line. Extract the center line and intersection point: The two effective windows obtained deflect the laser line to obtain two straight lines, which are stored in different areas respectively. The pixel points in different areas are fitted to obtain the fitted straight line, and the angle of the fitted straight line is obtained. According to the different angles, all the pixel points with grayscale values greater than a certain threshold are extracted in the row or column direction. The pixel points in each row are randomly selected to use the minimum median method for straight line fitting. The minimum median value is judged to be less than a certain threshold. If it is less than a certain threshold, the straight line is selected as the extracted center line. After the two areas are processed as above, the center line y of the two straight lines is obtained. 1 =a 1 *x 1 +b 1 ,y 2 =a 2 *x 2 +b 2 , and then calculate the intersection point (X, Y) of the two lines; Extract the endpoints of the separation stripes: For the laser image under the interference source of the second type of weldment assembly inconsistency causing the gap between the two weldments to change, it is necessary to obtain the two endpoints of the separation stripes close to the intersection point, and respectively extract the intersection point (X, Y) along the two detected straight lines y 1 =a 1 *x 1 +b 1 ,y 2 =a 2 *x 2 +b 2 Search for pixels in the direction of the laser line segment and select the pixel whose gray value is greater than the threshold value and is closest to the intersection point on the laser line segment (X 3 ,Y 3 )(X 4 , Y 4 ), that is, the two endpoints of the two line segments at the desired intersection can be obtained, and the distance between the two endpoints is W 2 , after spatial coordinate transformation, it is converted into the gap b of the weldment at this location. During welding, the moving speed V of the welding gun is determined according to the gap width b here. C , formula (8) is Where h is the thickness of the weld, Q is the flow rate of the welding wire, and b is the width of the gap.
