Disclosure of Invention
In order to solve the technical problems, the application aims to provide a metal wire welding quality detection method and system based on computer assistance, and the adopted technical scheme is as follows:
 In a first aspect, an embodiment of the present application provides a method for detecting welding quality of a wire based on computer assistance, the method including the steps of:
 Acquiring a metal wire welding image and an infrared thermal imaging image at each acquisition time in the metal wire welding process;
 acquiring each welding area in the metal wire welding image based on the distance between each corner point in the metal wire welding image;
 acquiring welding shape abnormal values of each welding area in each metal wire welding image based on the number of pixel points in the welding area, the number of pixel points at the edge of the welding area and the value of the crossing angle of the welding area;
 Acquiring a temperature anomaly coefficient of any wire where each welding area is located in each wire welding image based on the average condition of temperature information of pixel points in the infrared thermal imaging image;
 acquiring a welding temperature abnormality factor of each welding area in each metal wire welding image based on the temperature abnormality coefficient;
 Acquiring cooling temperature anomaly factors of each welding area in each metal wire welding image based on the average condition of difference conditions among temperature information of pixel points;
 Acquiring abnormal parameters of welding thermal effect of each welding area in each metal wire welding image based on the abnormal factors of the welding temperature and the abnormal factors of the cooling temperature;
 and acquiring the welding anomaly scores of all the welding areas in each metal wire welding image based on the welding shape anomaly values and the welding thermal effect anomaly parameters, and detecting the welding quality of the metal wires by taking the welding areas with the welding anomaly scores larger than a preset welding score threshold as defective welding areas.
Further, the method for obtaining the welding area comprises the following steps:
 for the wire welding image at each acquisition moment, using an angular point detection algorithm to acquire all angular points in the wire welding image, for each angular point, acquiring three angular points nearest to each angular point, and taking a quadrilateral area formed by connecting each angular point and the three angular points nearest to each angular point as each welding area.
Further, the method for acquiring the crossing angle comprises the following steps:
 For a metal wire welding image at each acquisition moment, acquiring each skeleton in the metal wire welding image by using a skeleton extraction algorithm, processing all the skeletons in the metal wire welding image by using a Hough straight line algorithm, acquiring skeleton straight lines of all the skeletons, and acquiring a welding area where an intersection point of any two intersected skeleton straight lines is located as a welding area of each intersection point;
 And regarding the intersection point of any two intersected skeleton lines, taking the minimum value of angles in all included angles formed by the intersection of the two skeleton lines as the intersection angle of each welding area where the intersection point is located.
Further, the calculation formula of the welding shape abnormal value is as follows: In the formula (I), in the formula (II),A welding shape anomaly value representing an i-th welding region in each wire welding image; the number of pixel points in the ith welding area in each metal wire welding image is represented,The number of pixels representing the edge of the i-th welding region,Representing the crossing angle of the ith welding area, wherein c is a preset parameter adjusting factor; is a normalization function.
Further, the method for obtaining the temperature anomaly coefficient comprises the following steps:
 matching the temperature information of each pixel point in the infrared thermal imaging image to each pixel point in the metal wire welding image by using an image feature matching algorithm;
 For each welding area in the metal wire welding image at each acquisition time, calculating the average value of the temperature information of all pixel points in the welding area as the average temperature information of each welding area;
 The calculation formula of the temperature anomaly coefficient is as follows: Wherein, the method comprises the steps of,Representing the temperature anomaly coefficient of any wire where the ith welding area is located in each wire welding image; Representing the average temperature information of the ith welding area except the ith welding area on any wire where the ith welding area is located in each wire welding image,Representing the average value of the average temperature information of all welding areas on any metal wire where the ith welding area is positioned in each metal wire welding image; representing the number of welding areas on any metal wire where the ith welding machine area is located in each metal wire welding image; representing the absolute value of the difference between the average temperature information of the ith weld zone and the preset desired temperature.
Further, the method for obtaining the welding temperature anomaly factor comprises the following steps:
 And for each welding area in the wire welding image at each acquisition time, calculating the product of the temperature anomaly coefficients of all wires where the welding area is located as a welding temperature anomaly factor of each welding area.
Further, the method for obtaining the cooling temperature anomaly factor comprises the following steps:
 Taking a pixel point where an intersection point of any two intersecting skeleton lines in the metal wire welding images at each acquisition moment is taken as an initial pixel point, sequentially calculating absolute values of differences between temperature information of a preset number of continuous adjacent pixel points from the initial pixel point along the directions of two sides of any skeleton line where the initial pixel point is positioned as a first absolute value of differences, and calculating the average value of all the absolute values of the first differences in the directions of two sides of any skeleton line where the initial pixel point is positioned as the difference of the temperature change rates of the welding area where the initial pixel point is positioned in the directions of two sides of any skeleton line;
 And calculating the absolute value of the difference between the temperature change rate difference of the welding areas in the directions of the two sides of the straight line of any framework and the temperature change rate difference of the two sides of the straight line of the other framework as the cooling temperature anomaly factor of each welding area in each metal wire welding image at each acquisition moment.
Further, the method for acquiring the welding thermal effect abnormal parameters comprises the following steps:
 And calculating the sum of the welding temperature abnormality factor and the cooling temperature abnormality factor as a welding thermal effect abnormality parameter of each welding area in each wire welding image for each welding area in each wire welding image.
Further, the calculation formula of the welding anomaly score is as follows: In the formula (I), in the formula (II),Scoring welding anomalies of an ith welding area in each wire welding image; As a function of the normalization,For the welding shape anomaly value of the i-th welding region in each wire welding image,And (5) the abnormal welding thermal effect parameters of the ith welding area in each wire welding image.
In a second aspect, embodiments of the present application also provide a wire weld quality detection system based on computer assistance, comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor implementing the steps of any one of the methods described above when executing the computer program.
The application has at least the following beneficial effects:
 According to the application, a dual-sensor camera is used, a wire welding image and an infrared thermal imaging image are simultaneously acquired for analysis on the basis of a traditional visual detection system, welding areas are divided in the wire welding image, a welding shape abnormal value is calculated for representing the shape characteristics of each welding area, a temperature abnormal coefficient is constructed for reflecting the degree of non-uniformity of the temperature on each wire where each welding area is located, and further a welding temperature abnormal factor and a cooling temperature abnormal factor reflect the abnormal condition of the welding temperature in the welding process of each welding area at each acquisition moment and the abnormal condition of temperature cooling after welding.
Detailed Description
In order to further describe the technical means and effects adopted by the application to achieve the preset aim, the following detailed description refers to the specific implementation, structure, characteristics and effects of the method and the system for detecting the welding quality of the metal wire based on the computer assistance according to the application by combining the attached drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
The following specifically describes a specific scheme of the method and system for detecting welding quality of metal wires based on computer assistance provided by the application with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of steps of a method for detecting welding quality of a wire based on computer assistance according to an embodiment of the application is shown, the method includes the following steps:
 Step S1, acquiring a metal wire welding image and an infrared thermal imaging image at each acquisition time in the metal wire welding process.
A dual sensor camera is used, including an RGB camera for capturing a visible light image and a thermal infrared imager for capturing a thermal infrared image. After the equipment is calibrated, the dual-sensor camera is arranged right above the welding area, so that the instrument visual field can cover the whole welding area. After the welding is started, the welding frequency of the welding joint is taken as the image acquisition frequency, the dual-sensor camera simultaneously starts to work, and a metal wire welding image and an infrared thermal imaging image of a welding area at each acquisition moment are acquired. Wherein, the wire welding image is an RGB image.
And carrying out noise removal processing on the acquired metal wire welding image and the infrared thermal imaging image by utilizing wavelet transformation, and maintaining the edge and detail information of the image. The wavelet transform is a well-known technique, and this embodiment will not be described in detail.
Step S2, acquiring each welding area in the metal wire welding image based on the distance between each corner point in the metal wire welding image, acquiring the intersection angle of each welding area by using a Hough straight line algorithm, and acquiring the abnormal welding shape value of each welding area of each metal wire welding image based on the number of pixel points in the welding area, the number of edge pixel points of the welding area and the value of the intersection angle of the welding area.
In the welding quality detection process of the welding process, heat input not only can influence the formation of a welding shape, but also can have important influence on the problems of hot cracks, deformation, residual stress and the like of a welding joint. Further, the geometry of the weld joint can also affect the distribution of thermal effects and heat conduction during welding.
The metal wires in the metal mesh are many, the formed welding area is complex, the shape and the positioning of the welding area are critical to evaluating whether welding is qualified or not, and positioning analysis is needed for the welding area.
The welding area is an intersection area of a plurality of welding seams, and particularly, metal transverse wires and longitudinal wires in the metal mesh are vertically distributed, wherein the metal transverse wires and the metal transverse wires are collectively called as metal wires, but certain deviation can exist in the arrangement of the metal wires in the actual operation process, so that the intersection angle is changed, the welding stress intensity is directly influenced, and the geometric shape of a welding result at the welding area is changed due to the fact that the spot welding process is a preset program, so that the welding quality is influenced.
According to the analysis, in order to obtain the welding area at the intersection of two metal wires, for the metal wire welding image at each acquisition time, using an angular point detection algorithm to obtain all the angular points in the metal wire welding image, for each angular point, obtaining three angular points closest to each angular point, and taking a quadrilateral area formed by connecting each angular point and the three angular points closest to each angular point as each welding area. Wherein, the welding area is schematically shown in fig. 2.
And for the metal wire welding images at each acquisition time, acquiring each skeleton in the metal wire welding images by using a skeleton extraction algorithm, processing all the skeletons in the metal wire welding images by using a Hough straight line algorithm, acquiring skeleton straight lines of all the skeletons, and acquiring a welding area where an intersection point of any two intersected skeleton straight lines is located as a welding area of each intersection point.
Further, for the intersection point of any two intersecting skeleton lines, the minimum value of the angles in all included angles formed by the intersection of the two skeleton lines is used as the intersection angle of each welding area where the intersection point is located. The skeleton extraction algorithm and the hough straight line algorithm are known techniques, and the description of this embodiment is omitted.
Further, in order to characterize the shape characteristics of each welding area, based on the number of pixel points in the welding area, the number of pixel points at the edge of the welding area and the value of the crossing angle of the welding area, the abnormal welding shape value of each welding area in the wire welding image at each acquisition time is calculated, and the calculation formula is as follows: In the formula (I), in the formula (II),A welding shape anomaly value representing an i-th welding region in each wire welding image; the number of pixel points in the ith welding area in each metal wire welding image is represented,The number of pixels representing the edge of the i-th welding region,Indicating the crossing angle of the ith welding area, c is a preset parameter adjusting factor, and the function is to prevent the value in the absolute value from being 0, thereby causing invalid calculation, wherein the value of the preset parameter adjusting factor is 1, and an implementer can select other values according to actual conditions; is a normalization function.
It should be noted that the number of the substrates,Representing the ratio of the number of pixels in the welding area to the number of pixels at the edge of the welding area, reflecting the ratio of the area of the welding area to the perimeter of the outline, reflecting the shape characteristics of the welding area, whenThe larger the value of (2), the more irregular the shape of the welding region, and the larger the value of the welding shape anomaly value; The larger the angle difference is, the more the arrangement of the two wires constituting the welding area is not standard, and at this time, the larger the value of the obtained welding shape outlier is, and conversely, the smaller the value of the obtained welding shape outlier is.
And S3, acquiring a temperature anomaly coefficient of any wire where each welding area is located in each wire welding image based on the difference between the average temperature information of the welding area and the average condition of the average temperature information of the welding area on each wire and the difference between the average temperature information of the welding area and a preset expected temperature, and acquiring a welding temperature anomaly factor of each welding area in each wire welding image based on the temperature anomaly coefficient.
The images obtained by the dual sensors belong to information of two different dimension types, the two images acquired at the same moment can be accurately aligned by carrying out spatial registration on the metal wire welding images and the infrared thermal imaging images, and specific positions of a plurality of welding areas in the metal wire welding images are mapped in the infrared thermal imaging images, so that the thermal effect in the welding process can be analyzed. The thermal effect of the welding area is closely related to the temperature distribution, and the temperature change of the welding area, the range of the heat affected area and the heat distribution can be deeply known through the thermal information provided by the infrared thermal imaging image, which is important for detecting the welding quality.
According to the temperature information of each pixel point in the infrared thermal imaging image at each acquisition time, an image characteristic matching algorithm is used for matching the metal wire welding image and the infrared thermal imaging image at each acquisition time, and the temperature information of each pixel point in the infrared thermal imaging image is matched to each pixel point in the metal wire welding image. The image feature matching algorithm selected in the embodiment is a SIFT algorithm, and an implementer can select other image feature matching algorithms according to actual situations, wherein the SIFT algorithm is a known technology, and the embodiment is not described in detail.
So far, temperature information of each pixel point in the metal wire welding image at each acquisition time is obtained.
Furthermore, in the welding process of the welding machine, the temperature distribution of the welding area on each metal wire is mainly caused by production heat effect, the welding area of each metal wire on the net sheet is welded simultaneously by using a spot welding technology, the temperature distribution of the welding area position on each metal wire in the infrared thermal imaging image is uniform, but when the problems of poor welding seam, uneven molten pool, uneven deflection or unstable welding current exist in the welding process, the uneven heat distribution of the welding area is caused, and obvious abnormal hot spots or temperature gradient are displayed.
And calculating the average value of the temperature information of all pixel points in the welding area as the average temperature information of each welding area for each welding area in the metal wire welding image at each acquisition time.
Based on the analysis, in order to reflect the degree of non-uniformity of the temperature on each wire where each welding area is located, based on the difference between the average temperature information of the welding area and the average condition of the average temperature information of the welding area on each wire, and the difference between the average temperature information of the welding area and the preset expected temperature, the temperature anomaly coefficient of any wire where each welding area is located in the wire welding image at each acquisition time is calculated, and the calculation formula is: Wherein, the method comprises the steps of,Representing the temperature anomaly coefficient of any wire where the ith welding area is located in each wire welding image; Representing the average temperature information of the ith welding area except the ith welding area on any wire where the ith welding area is located in each wire welding image,Representing the average value of the average temperature information of all welding areas on any metal wire where the ith welding area is positioned in each metal wire welding image; representing the number of welding areas on any metal wire where the ith welding machine area is located in each metal wire welding image; Representing the absolute value of the difference between the average temperature information of the ith weld zone and the preset desired temperature. The output current of the gang welding machine and the resistance of the metal wire are fixed values, and the preset expected temperature of each welding area is calculated according to the joule law, which is a known technology and is not described in detail in this embodiment.
It should be noted that the number of the substrates,The temperature distribution difference of the welding areas of the metal wires is reflected, and the larger the value is, the greater the possibility that abnormal welding temperature exists in the same metal longitudinal wire is; reflecting the degree of deviation between the average temperature information of the welding region and the preset desired temperature,The larger the value of the deviation degree is, the more abnormal the welding temperature of the welding area is, the larger the obtained temperature abnormality coefficient is, and on the contrary, the smaller the obtained temperature abnormality coefficient is.
Further, according to the analysis, for each welding area in the wire welding image at each acquisition time, calculating the product of the temperature anomaly coefficients of all the wires where the welding area is located as a welding temperature anomaly factor of each welding area, and comprehensively reflecting the anomaly degree of the welding temperature on all the wires where the welding area is located.
And S4, acquiring cooling temperature anomaly factors of all welding areas in all the metal wire welding images based on the average condition of difference conditions among temperature information of the pixel points, and acquiring welding thermal effect anomaly parameters of all the welding areas in all the metal wire welding images based on the welding temperature anomaly factors and the cooling temperature anomaly factors.
The cooling process after welding is a heat conduction process, the temperature of the welding area gradually spreads to the surrounding area in a period of time, and when the welding state of the welding area is good, the degree of temperature conduction to the surrounding should have similarity.
Further, according to the analysis, for the pixel point where the intersection point of any two intersecting skeleton lines in the metal wire welding image at each acquisition time is located as an initial pixel point, sequentially calculating, from the initial pixel point, the absolute value of the difference between the temperature information of the preset number of consecutive adjacent pixel points as a first absolute value of the difference, and calculating the average value of all the first absolute values of the first difference in the directions of the two sides of any skeleton line where the initial pixel point is located as the difference of the temperature change rates of the welding area where the initial pixel point is located in the directions of the two sides of any skeleton line along the directions of the two sides of any skeleton line where the initial pixel point is located.
And calculating the absolute value of the difference between the temperature change rate difference of the welding areas in the directions of two sides of any skeleton straight line and the temperature change rate difference of the other skeleton straight line as the cooling temperature abnormality factor of each welding area in the metal wire welding image at each acquisition time.
It should be noted that, the temperature of the welding area gradually diffuses toward the wire within a period of time, when the temperature change rates of the two sides of the welding area in the same direction of the wire are more uniform, the change rates of the temperature change rate difference values of the two sides in different directions are more uniform, which means that the welding effect of the current welding area is better, at this time, the value of the cooling temperature anomaly factor is smaller, and conversely, the value of the cooling temperature anomaly factor is larger.
Further, in order to reflect abnormal conditions of welding temperature and abnormal conditions of temperature cooling after welding in the welding process of the welding areas at each acquisition time, based on the welding temperature abnormal factors and the cooling temperature abnormal factors, welding heat effect abnormal parameters of the welding areas in the wire welding images at each acquisition time are obtained.
The abnormal parameters of the welding thermal effect comprehensively reflect abnormal conditions of the welding temperature and the abnormal conditions of the post-welding temperature cooling in the welding process, and when the abnormal conditions of the welding temperature and the post-welding temperature cooling are more remarkable, the larger the value of the abnormal parameters of the welding thermal effect is obtained at the moment, and otherwise, the smaller the value of the abnormal parameters of the welding thermal effect is obtained.
And S5, acquiring welding anomaly scores of all welding areas in all the metal wire welding images based on the welding shape anomaly values and the welding thermal effect anomaly parameters, and detecting the welding quality of the metal wires.
The abnormal value of the welding shape reflects the abnormal degree of the geometric dimension of the welding seam so as to directly influence the mechanical property of the welding seam, and the abnormal parameter of the welding thermal effect reflects the abnormal condition of the organization structure of metal and the welding residual stress and indirectly reflects the property and quality of the welding piece.
Further, according to the above analysis, in order to reflect the degree of abnormality of the welding region in the welding process, the welding abnormality score of each welding region in the wire welding image at each acquisition time is calculated according to the following calculation formula: In the formula (I), in the formula (II),Scoring welding anomalies of an ith welding area in each wire welding image; As a function of the normalization,For the welding shape anomaly value of the i-th welding region in each wire welding image,And (5) the abnormal welding thermal effect parameters of the ith welding area in each wire welding image.
The abnormal welding score reflects the abnormal degree of the welding area in the welding process, when the shape of the metal wire of the welding area is abnormal in the welding process and the welding temperature is abnormal, the abnormal welding shape value and the abnormal welding thermal effect parameter are larger, the obtained abnormal welding score is larger, and otherwise, the obtained abnormal welding score is smaller.
So far, the welding abnormality scores of the welding areas in the welding images of the metal wires at all the acquisition moments are obtained.
And detecting the welding quality of the metal wire based on the welding anomaly score, setting a preset welding score threshold, wherein the preset welding score threshold in the embodiment has a value of 0.8, and an implementer can select other values according to actual conditions, and when the welding anomaly score value of the welding region is larger than the preset welding score threshold, taking the welding region as a defect welding region.
Processing the detection result by using a computer, marking and counting welding defect areas when welding defects occur, and only performing identification recording operation on the welding defect areas when the frequency of the welding defects is low; when the frequency of occurrence of welding defects is high, it is necessary to stop production immediately and to inspect and repair production equipment.
Based on the same inventive concept as the above method, the embodiment of the application further provides a wire welding quality detection system based on computer assistance, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to realize the steps of any one of the wire welding quality detection methods based on computer assistance.
It should be noted that the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The embodiments of the present application are described in a progressive manner, and the same and similar parts of the embodiments are all referred to each other, and each embodiment is mainly described in the differences from the other embodiments.
The foregoing description of the preferred embodiments of the present application is not intended to be limiting, but rather, any modifications, equivalents, improvements, etc. that fall within the principles of the present application are intended to be included within the scope of the present application.