Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a weld defect detection system and method based on target identification, which solve the problems that the data formats and types obtained by different detection methods are different, effective integration and comprehensive analysis are difficult to perform, and misjudgment and missed judgment are easy to occur.
In order to achieve the above purpose, the invention is realized by the following technical scheme that the weld defect detection system based on target identification comprises:
The image preprocessing module is used for processing the weld joint image transmitted by the acquired weld joint image acquisition module, obtaining a preprocessed image through graying, image enhancement processing and denoising processing on the weld joint image, equally dividing the preprocessed image to obtain a segmented image, and transmitting the segmented image to the weld joint defect analysis module;
The weld defect analysis module is used for processing the acquired segmented image, acquiring gray features of the segmented image, determining a defect type according to the gray features, simultaneously generating a defect image based on combination matching of the obtained defect types, and transmitting the defect image to the weld quality analysis module;
The weld quality analysis module is used for analyzing the acquired defect image, identifying the defect type corresponding to the defect image to obtain an identification result, generating a specific defect reason based on the defect image, detecting the whole quality of the weld according to the generated specific defect reason, calculating a weld quality value, then matching with a quality judgment section to generate quality detection information, and transmitting the quality detection information to the detection information output module.
The invention further provides a welding seam image acquisition module which is used for acquiring the image of the welding seam and transmitting the acquired welding seam image to the image preprocessing module.
As a further scheme of the invention, the specific mode of the image preprocessing module for processing the weld image is as follows:
Acquiring a welding seam image transmitted by a welding seam image acquisition module, converting the welding seam image into a gray image, performing image enhancement processing on the obtained gray image to obtain an enhanced gray image, and performing denoising processing on the obtained enhanced gray image to obtain a preprocessed image;
The method comprises the steps of obtaining a preprocessed image, equally dividing the preprocessed image into nine equal parts to obtain a segmented image, marking the segmented image as i, and transmitting the obtained segmented image to a weld defect analysis module, wherein i=1, 2.
As a further scheme of the invention, the specific mode of the weld defect analysis module for processing the split image is as follows:
Acquiring all the divided images i, taking one group as a target object, acquiring gray features of the target object, simultaneously acquiring historical data, sorting gray features of different weld defects according to the historical data to obtain a matching interval, and matching the gray features of the target object with the matching interval to obtain the defect type of the target object;
and similarly, obtaining the defect types corresponding to all the segmented images, screening the segmented images corresponding to the same defect type, simultaneously carrying out combination matching on the screened segmented images to obtain gray features of the segmented images, combining the segmented images with similar gray features according to the original segmentation sequence to obtain defect images, and respectively transmitting the defect images to a welding seam quality analysis module and a detection information output module.
As a further scheme of the invention, the specific mode of analyzing the defect image by the welding seam quality analysis module is as follows:
acquiring all defect images, identifying defect types corresponding to the defect images, generating a single defect signal if only one defect type corresponding to the defect images exists, otherwise, generating a plurality of types of defect signals if a plurality of defect types corresponding to the defect images exist, and analyzing the defect types and the single defect signals respectively;
Analyzing a single defect signal, acquiring a defect image, acquiring defect characteristics corresponding to the defect image, wherein the defect characteristics comprise defect gray values, defect shapes and defect texture characteristics, acquiring defect reasons corresponding to all the defect characteristics, acquiring the same defect reasons existing in the defect characteristics, calculating corresponding occupation ratios, and selecting the defect reason corresponding to the largest occupation ratio as a standard to generate a defect specific reason;
Analyzing the multi-type signals, wherein the specific analysis mode is the same as the analysis mode of the single defect signal, and aiming at the multi-type signals, sequentially analyzing different types of defects and generating corresponding specific reasons of the defects.
As a further scheme of the invention, the specific mode of the weld quality analysis module for detecting the whole quality of the weld according to the specific cause of the generated defect is as follows:
analyzing the quality of the welding seam based on the obtained specific defect reason, obtaining the defect length and the defect area corresponding to the defect of the welding seam, taking the numerical value of the defect length and the defect area to calculate, summing the obtained defect length and the defect area to obtain a defect parameter value, matching the obtained specific defect value with a quality reference table, and obtaining an assigned value obtained by matching;
For the corresponding assignment of the single type signal, determining the quality of the welding seam according to the corresponding assignment table, generating quality detection information, for the corresponding assignment of the multi-type signal, calculating the corresponding assignment of all types, calculating the sum of the values of all types of assignments, simultaneously matching the calculated sum of the values with the assignment table, determining the quality of the welding seam, generating the quality detection information, and simultaneously transmitting the generated quality detection information to the detection information output module.
As a further scheme of the invention, the system further comprises a detection information output module which is used for displaying the acquired defect image and quality detection information to corresponding operators.
A weld defect detection method based on target identification specifically comprises the following steps:
Step S1, carrying out graying, image enhancement and denoising treatment on an obtained weld joint image to obtain a preprocessed image, and equally dividing the preprocessed image to obtain a segmented image;
S2, processing the obtained segmented image, acquiring gray features of the segmented image, determining a defect type according to the gray features, and simultaneously carrying out combination matching based on the obtained defect type to generate a defect image;
Step S3, identifying the defect type corresponding to the defect image to obtain an identification result, generating a defect specific reason based on the defect image, detecting the whole quality of the welding seam according to the generated defect specific reason, calculating a welding seam quality value, and then matching with a quality judging section to generate quality detection information;
And S4, displaying the obtained quality detection information to a corresponding operator.
Advantageous effects
The invention provides a weld defect detection system and method based on target identification. Compared with the prior art, the method has the following beneficial effects:
The invention carries out graying, image enhancement and denoising treatment on the weld joint image through the image preprocessing module, can highlight the characteristics of weld joint defects, improves the definition and contrast of the image, and provides more accurate image data for subsequent defect analysis;
The weld defect analysis module utilizes historical data to establish gray feature matching intervals of different weld defects, and the type of the defects can be accurately determined by accurately matching the gray features of the segmented images with the matching intervals;
The image data and the historical data are combined, and through arrangement and analysis of a large amount of historical data, the relation among defect types, gray scale characteristics, defect reasons and the like is established, a more comprehensive basis is provided for weld quality analysis, different assignment tables are adopted for quality assessment, parameters such as defect length, area and the like can be comprehensively calculated, and the data are matched with a quality reference table, so that weld quality is assessed more scientifically.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, the application provides a weld defect detection system based on target recognition, which comprises a weld image acquisition module, an image preprocessing module, a weld defect analysis module, a weld quality analysis module and a detection information output module, wherein the function modules are in unidirectional electrical connection according to fig. 1.
And the welding seam image acquisition module is used for acquiring an image of the welding seam, transmitting the acquired welding seam image to the image preprocessing module, and acquiring the welding seam image through the optical camera.
The image preprocessing module is used for processing the acquired weld joint image, obtaining a preprocessed image through graying, image enhancement and denoising of the weld joint image, equally dividing the preprocessed image to obtain a segmented image, and transmitting the segmented image to the weld joint defect analysis module.
The weld image transmitted by the weld image acquisition module is acquired, the weld image is converted into a Gray image, and the Gray image can be processed by using a weighted average method, for example, a common formula is gray=0.299r+0.587g+0.114B, wherein R, G and B are pixel values of red, green and blue channels of a color image respectively, gray is a Gray value, the obtained Gray image is subjected to image enhancement processing to obtain an enhanced Gray image, the specific image enhancement processing is to stretch the contrast of the image, for example, stretch the Gray value range of the original image from [ a, B ] to [ c, d ], and a linear conversion formula can be usedWherein x is an original gray value, y is a converted gray value, the obtained enhanced gray image is subjected to denoising treatment to obtain a preprocessed image, and the denoising mode can be removed by using a filtering method, for example, median filtering is very effective for removing salt and pepper noise, and the principle of median filtering is to replace the gray value of each pixel point with the median of the gray values of the pixels in the neighborhood of the pixel point;
The method comprises the steps of obtaining a preprocessed image, equally dividing the preprocessed image into nine equal parts to obtain a segmented image, marking the segmented image as i, and transmitting the obtained segmented image to a weld defect analysis module, wherein i=1, 2.
And the weld defect analysis module is used for processing the acquired segmented image, acquiring gray features of the segmented image, determining the defect type according to the gray features, simultaneously generating a defect image based on the obtained defect type through combination matching, and transmitting the defect image to the detection information output module.
Acquiring all the divided images i, taking one group as a target object, then acquiring gray features of the target object, wherein the specific gray features represent gray values of the target object, simultaneously acquiring historical data, and sorting gray features of different weld defects according to the historical data to obtain a matching interval, wherein the matching interval is specifically composed of gray features corresponding to the weld defects, and then matching the gray features of the target object with the matching interval to obtain defect types of the target object;
for example, an image is selected as a target object, a professional image analysis software is used to extract gray features of the target object, for example, gray average value of a certain suspected defect area in the target object image is 80, gray variance is 15 (the extracted gray features), the gray average value range corresponding to hole defects is approximately 60-90, the gray variance range is approximately 10-20, the gray average value range corresponding to slag inclusion defects is approximately 70-100, the gray variance range is approximately 12-25, the gray average value range corresponding to crack defects is approximately 40-70, the gray variance range is approximately 8-15 (the gray feature matching intervals of different defects) and the like, the gray features of the target object are further matched with the matching intervals, and the gray features are found to fall in the gray feature matching intervals of air hole defects, so that the suspected defect area in the target object image can be judged to belong to the air hole defect type, and the specific recognition mode is as follows:
The specific identification mode is as follows:
In this example, the gray average value of the suspected defect region in the target object image is 80, and the gray variance is 15. The gray feature matching intervals for different defects are as follows:
the air hole defect is that the gray level average value range is approximately 60-90, and the gray level variance range is approximately 10-20.
Slag inclusion defect, that is, the gray level average value is approximately 70-100, and the gray level variance is approximately 12-25.
The gray average value 80 of the target object is in a gray average value matching interval (60-90) of the air hole defect and a gray average value matching interval (70-100) of the slag inclusion defect, but the gray variance 15 is in a gray variance matching interval (10-20) of the air hole defect and a gray variance matching interval (12-25) of the slag inclusion defect, and when the gray variances are matched, although the gray variances are matched with the corresponding matching intervals, when the matching difference is calculated, the difference between the gray variance matching interval (10-20) of the air hole defect and the gray variance 15 is 5, and the difference between the gray variance matching interval of the slag inclusion defect and the gray variance 15 is (7-10), the difference between the gray variance matching interval and the gray variance 15 is known, and when the matching interval with the minimum difference is selected, the matching interval is selected, and the corresponding defect reason is generated.
In summary, the criterion for the judgment is firstly matching the gray average value, specifically, calculating the difference value, selecting the gray average value with the smallest difference value as the criterion, then calculating the gray variance, and similarly selecting the matching interval with the smallest difference value.
And similarly, acquiring the defect types corresponding to all the divided images, screening the divided images corresponding to the same defect type, and meanwhile, carrying out combination matching on the screened divided images, wherein the specific mode of combination matching is that the gray features of the divided images are acquired, then the divided images with similar gray features are combined, the specific gray feature similarity is expressed as that the gray feature difference value of the divided images is in a preset value range, wherein the specific numerical value of the preset value range is set by an operator, and the combination sequence is combined according to the original division sequence, so that the defect image is obtained.
For example, when detecting a batch of pipe welding seams, a series of divided images are obtained through image analysis, the images are detected and judged to contain different defect types such as air holes, slag inclusion, unfused and the like, all the divided images judged to be the air hole defect types are screened out, and the gray level average value of a certain air hole defect divided image is assumed to be 75, and the gray level variance is assumed to be 18. The operator sets the preset difference range of the gray mean value to be +/-5 according to experience, and the preset difference range of the gray variance to be +/-3. Then in the segmented images of the selected pinhole defects, the images with a gray scale mean between 70-80 and a gray scale variance between 15-21 are combined together and arranged and combined in the order in which the images were originally in the detection sequence.
And the detection information output module is used for displaying the acquired defect image to a corresponding operator.
Embodiment two, this embodiment is implemented on the basis of embodiment one, and differs from embodiment one in that:
The weld defect analysis module transmits the generated defect image information to the weld quality analysis module, and the weld is detected by the weld quality analysis module.
The weld quality analysis module is used for analyzing the acquired defect image, identifying the defect type corresponding to the defect image to obtain an identification result, generating a specific defect reason based on the defect image, detecting the overall quality of the weld according to the generated specific defect reason, calculating a weld quality value, then matching with a quality judgment section to generate quality detection information, and transmitting the quality detection information to the detection information output module.
Acquiring all defect images, identifying defect types corresponding to the defect images, generating a single defect signal if only one defect type corresponding to the defect images exists, otherwise, generating a plurality of types of defect signals if a plurality of defect types corresponding to the defect images exist, and analyzing the defect types and the single defect signals respectively;
For example, after detecting a welded portion of a steel structure, all defect images obtained are determined to be air hole defects, a single defect signal is generated, for example, a part of the defect images are displayed as slag inclusion defects, and another part of the defect images are displayed as unfused defects, and in this case, multiple types of defect signals are generated, which means that the welded portion has multiple quality problems.
Analyzing a single defect signal, acquiring a defect image, and simultaneously acquiring defect characteristics corresponding to the defect image, wherein the defect characteristics comprise defect gray values, defect shapes and defect texture characteristics, then acquiring defect causes corresponding to all the defect characteristics, wherein the acquired defect causes are specifically expressed as defect causes corresponding to the defect gray values, the defect shapes and the defect texture characteristics respectively, simultaneously acquiring the same defect causes existing in the defect characteristics, and calculating corresponding occupation ratios, such as welding temperature, welding material quality, abnormal welding pool and impurity mixing of the defect causes obtained through analysis, wherein the number of times of existence of the welding temperature in the corresponding defect characteristics is three times, the corresponding occupation ratio is three times of existence of the welding material quality is one time, the corresponding occupation ratio is one time of the corresponding occupation ratio, and then determining the occupation ratio of the rest specific causes by the same way, then selecting the defect cause corresponding to the largest occupation ratio as the standard to generate the defect specific cause, and in the example, assuming that the welding temperature corresponds to the largest occupation ratio standard is the defect specific cause.
Analyzing the multi-type signals, wherein the specific analysis mode is the same as the analysis mode of the single defect signal, and aiming at the multi-type signals, sequentially analyzing different types of defects and generating corresponding defect specific reasons;
Analyzing the quality of a welding line based on the obtained specific reasons of the defects, obtaining the defect length and the defect area corresponding to the defects of the welding line, taking the values of the defect length and the defect area to calculate, summing the obtained defect length and the defect area to obtain defect parameter values, matching the obtained specific values of the defects with a quality reference table, setting the quality reference table by an operator according to historical data, specifically comprising the specific values of the defects, and obtaining assigned values obtained by matching;
For the corresponding assignment of the single type signal, determining the quality of the welding seam according to the corresponding assignment table, generating quality detection information, setting the assignment table by an operator, calculating the corresponding assignment of all types for the assignment of the multi-type signal, calculating the sum of the values of all types of assignment, and simultaneously matching the calculated sum with the assignment table, wherein the assignment table is different from the assignment table corresponding to the single type signal, aiming at comprehensively considering the influence of the welding seam quality when various defects coexist, determining the quality of the welding seam, generating quality detection information, and transmitting the generated quality detection information to the detection information output module.
For example, when detecting a welding line of a certain bridge steel structure, a welding line is found to have defects, the defect length is measured to be 5mm, the defect area is 3 square mm, and the defect parameter value is 8. In the quality reference table, if the defect parameter value is less than 10 and the corresponding value is 80 (indicating that the quality grade is high), the weld is assigned 80 here, for example, if the value is 80 or more, the corresponding quality grade is "poor" in the assignment table;
When the multi-type signals are detected, for example, slag inclusion and unfused defect signals exist at the same time, the corresponding assignment of each type of defect is calculated firstly, the assignment of the slag inclusion defect is assumed to be 60, the assignment of the unfused defect is assumed to be 50, then the sum of all types of assignments is calculated to be 110, and then the sum of the values is matched with an assignment table specially set for the multi-type signals, wherein the assignment table is different from the assignment table structure and the standard of the single-type signals, and the aim of comprehensively considering the influence of the coexistence of the various defects on the weld seam quality is achieved. For example, in a multi-type assignment table, the sum of values between 100 and 120 corresponds to a quality grade of "medium", and the weld quality can be determined to be "medium".
And the detection information output module is used for displaying the acquired quality detection information to corresponding operators.
In the third embodiment, as the third embodiment of the present invention, the combination of the implementation procedures of the first embodiment and the second embodiment is emphasized.
In a fourth embodiment, referring to fig. 2, the present application provides a weld defect detection method based on target recognition, which specifically includes the following steps:
Step S1, carrying out graying, image enhancement and denoising treatment on an obtained weld joint image to obtain a preprocessed image, equally dividing the preprocessed image to obtain a segmented image, and carrying out the same treatment mode as the treatment process of the image preprocessing module in the first embodiment;
S2, processing the obtained segmented image, acquiring gray features of the segmented image, determining a defect type according to the gray features, and simultaneously performing combination matching based on the obtained defect type to generate a defect image, wherein the processing mode is the same as that of the welding seam defect analysis module in the first embodiment;
Step S3, identifying the defect type corresponding to the defect image to obtain an identification result, generating a defect specific reason based on the defect image, detecting the whole quality of the welding seam according to the generated defect specific reason, calculating a welding seam quality value, and then matching with a quality judgment section to generate quality detection information, wherein the processing mode is the same as that of the welding seam defect analysis module in the second embodiment;
And S4, displaying the obtained quality detection information to a corresponding operator.
And all that is not described in detail in this specification is well known to those skilled in the art.
The above embodiments are only for illustrating the technical method of the present invention and not for limiting the same, and it should be understood by those skilled in the art that the technical method of the present invention may be modified or substituted without departing from the spirit and scope of the technical method of the present invention.