CN115100171A - Steel die welding defect detection method and system based on machine vision - Google Patents

Steel die welding defect detection method and system based on machine vision Download PDF

Info

Publication number
CN115100171A
CN115100171A CN202210810847.0A CN202210810847A CN115100171A CN 115100171 A CN115100171 A CN 115100171A CN 202210810847 A CN202210810847 A CN 202210810847A CN 115100171 A CN115100171 A CN 115100171A
Authority
CN
China
Prior art keywords
pixel point
image
defect
undercut
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210810847.0A
Other languages
Chinese (zh)
Inventor
常宝云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN202210810847.0A priority Critical patent/CN115100171A/en
Publication of CN115100171A publication Critical patent/CN115100171A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to the technical field of machine vision, in particular to a method and a system for detecting welding defects of a steel die based on machine vision. Calculating the smoothness degree of corresponding pixel points through the gray level deviation of neighborhood pixels of each pixel point in the gray level image of the weld surface image; obtaining a target area according to the smoothness degree; acquiring the gradient of each pixel point in the target area and the shortest distance between each pixel point and the central line of the target area, and calculating the attention degree of each pixel point in the target area according to the gradient and the shortest distance; obtaining a suspected defect area based on the attention degree; calculating the similarity level between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type; the final undercut defect type is obtained by weighting and summing the similar grades in the suspected defect area more than the quantity of the similar grades, and the method not only can accurately detect the defects, but also can distinguish the types of the defects to be changed.

Description

Steel die welding defect detection method and system based on machine vision
Technical Field
The invention relates to the technical field of machine vision, in particular to a method and a system for detecting welding defects of a steel die based on machine vision.
Background
At present, the steel mould is very widely used in bridge roads, municipal buildings and other construction neighborhoods, but various welding problems can be frequently encountered in the process of manufacturing the products, the welding problems not only can influence the quality of assembly, but also can influence the bearing capacity of the structure, and the safety factor of the products is reduced. At present, the detection of welding seam defects based on computer vision is usually directed at the defects that image airspace features such as gaps, air holes and slag inclusion on the surface of a welding seam are obvious, for example, a silver welding seam has a black round hole or a black crack, the features are obvious and definite, and the detection is easy.
However, for undercut defects, the spatial domain characteristics are not obvious, and because the background colors of the master batches are different, the undercut defect region is difficult to accurately and effectively partition by adopting the traditional threshold partitioning method.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a steel die welding defect detection method and system based on machine vision, and the adopted technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for detecting a welding defect of a steel mold based on machine vision, which is characterized in that the method includes the following steps: extracting RGB images of the surface of the steel die to obtain a weld surface image, and graying the weld surface image to obtain a gray image; calculating the gray level deviation of the neighborhood pixels of each pixel point in the gray level image, and calculating the smoothness degree of the corresponding pixel point according to the gray level deviation; obtaining an extreme point of the smoothness degree corresponding to each pixel point in the gray level image, and connecting the extreme points smaller than a preset gray level threshold value to obtain a target area; acquiring the gradient of each pixel point in the target area and the shortest distance between each pixel point and the center line of the target area, and calculating the attention degree of each pixel point in the target area according to the product of the gradient and the shortest distance, wherein the attention degree is positively correlated with the product; performing area growth on the target area based on the attention degree to obtain a suspected defect area; calculating the similarity level between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type; the final undercut defect type is obtained when the number of similar levels in the suspected defect area is greater than the weighted sum of the similar levels.
Further, the step of calculating the gray level deviation of the neighborhood pixels of each pixel point in the gray level image comprises the following steps: and calculating the gray variance in each sliding window by taking each pixel point as the central pixel point of the sliding window, wherein the gray variance is the gray deviation.
Further, the step of obtaining the extreme point of the smoothness degree corresponding to each pixel point in the gray-scale image includes: obtaining a smooth degree sequence according to the traversal sequence of the sliding window, establishing a rectangular coordinate system by taking the sliding times of the sliding window as a horizontal axis and the smooth degree as a vertical axis, drawing points in the rectangular coordinate system according to the smooth degree sequence to draw a smooth degree curve, analyzing the smooth degree curve to obtain a plurality of minimum value points, and when the minimum value points are smaller than a preset smooth threshold, corresponding pixel points are edge pixel points of the welding seam, and a connected domain obtained by connecting the edge pixel points is a target region.
Further, the step of calculating the similarity level between the gradient direction of each pixel point in the suspected defect region and the expected direction of each undercut defect type further includes: and calculating cosine similarity between the gradient direction of each pixel point and the expected direction of each undercut defect type, and judging the similarity grade of the cosine similarity.
Further, the step of obtaining the expected direction of each undercut defect type includes: and when the undercut defect type is a discontinuous undercut defect, the expected direction is a tangential direction when the corresponding pixel point is taken as a tangential point of the suspected defect area.
Further, the step of obtaining the expected direction of each undercut defect type includes: and when the undercut defect type is a continuous undercut defect, the expected direction is a direction in which the corresponding pixel point is perpendicular to the central line of the target area.
Further, the step of extracting the RGB image of the surface of the steel die to obtain the image of the surface of the welding seam comprises the following steps: classifying background pixel points and welding line pixel points in the RGB image on the surface of the steel die by utilizing a DNN network to obtain a mask image, and multiplying the mask image and the RGB image on the surface of the steel die to obtain the image on the surface of the welding line.
In a second aspect, the present invention provides a steel die welding defect detection system based on machine vision, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements any one of the above steps of the method when executing the computer program.
The invention has the following beneficial effects:
in the embodiment of the invention, the smoothness degree of the corresponding pixel point is calculated through the gray level deviation of the neighborhood pixels of each pixel point in the gray level image of the weld surface image; obtaining a target area according to the smoothness degree; obtaining the gradient of each pixel point in the target area and the shortest distance between each pixel point and the center line of the target area, and calculating the attention degree of each pixel point in the target area according to the gradient and the shortest distance; obtaining a suspected defect area based on the attention degree; calculating the similarity level between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type; the final undercut defect type is obtained when the number of similar levels in the suspected defect area is greater than the weighted sum of the similar levels. The method can accurately detect the defects, can distinguish the defects into intermittent undercut or continuous undercut, can perform targeted processing according to the detection result, and can effectively reduce the labor intensity and improve the production efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for detecting welding defects of a steel mold based on machine vision according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description, structures, features and effects of a method and a system for detecting welding defects of a steel mold based on machine vision according to the present invention are provided with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
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 invention belongs.
The specific scheme of the steel die welding defect detection method and system based on machine vision provided by the invention is specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for detecting a welding defect of a steel mold based on machine vision according to an embodiment of the present invention is shown, where the method includes the following steps:
and S001, extracting the RGB image on the surface of the steel die to obtain a weld surface image, and graying the weld surface image to obtain a gray image.
The method comprises the steps of collecting RGB images on the surface of a steel die by using a camera, converting the RGB images into gray level images, processing the collected gray level images of the steel die, segmenting the positions of welding seams, and detecting the surface undercut defect of the welding seam of the steel die through image processing. Because the acquired RGB image of the surface of the steel die has complex backgrounds such as welding seams and steel dies, and the influence of other noises on the detection of the defects of the welding seam surface is avoided, the embodiment of the invention firstly adopts a DNN network for optimization.
The DNN network training process is as follows: forming a data set by RGB images on the surface of the steel die, wherein the welding seam contained in the data set has various styles; labeling each image in the training set, specifically: marking pixels belonging to the background as 0 and pixels belonging to the welding seam as 1 by using a single-channel semantic label; the task of the network is to classify, all the used loss functions are cross entropy loss functions.
Classifying the RGB image on the surface of the steel mould by using the trained DNN network to obtain a mask image, multiplying the mask image with the RGB image on the surface of the steel mould input into the DNN network to obtain a weld surface image, and graying the weld surface image to obtain a grayscale image.
Step S002, calculating the gray level deviation of the neighborhood pixels of each pixel point in the gray level image, and calculating the smoothness degree of the corresponding pixel point according to the gray level deviation; and obtaining an extreme point of the smoothness degree corresponding to each pixel point in the gray level image, and connecting the extreme points smaller than a preset gray level threshold value to obtain a target area.
The undercut defect is not a very distinct feature in an image like a defect such as a flash or a void, but is judged by a change in gray scale more. The undercut defect is expressed in the form of a pit or a groove on the edge of the weld bead in the space, and since the undercut defect is a pit on the flat surface, there is a change in the light and shade at the pit position, and it is expressed as a change in the gradation on the image, and therefore the pit is expressed as an area having a change in the gradation on the two-dimensional image. And because the surface of the welding seam is uneven and has gray level change, the detection of the undercut defect by simply adopting the gray level change cannot distinguish the change caused by the welding seam or the undercut defect, and the judgment of whether the pit is a pit or not by simply adopting the gray level change is inaccurate. However, the concave-convex degree of the undercut defect and the weld surface on the spatial domain is different, so the change of the light and shadow brought by the undercut defect and the weld surface is different, and the change range of the gray gradient is different, so the probability that the change amplitude of the gray gradient in the image is larger than that of the undercut defect is higher.
Undercut defects exist at the edge of a welding seam, and detection of the undercut defects depends on edge pixel points of the welding seam, so that the range of a connected domain of the welding seam needs to be enlarged. Due to the change of materials and light and shadow, the gray value of the pixel points in the image on the surface of the welding line has larger gray level fluctuation, and the gray level fluctuation of the pixel points at the edge of the welding line is larger. Specifically, with each pixel point in the weld surface image as a central pixel point, establishing a sliding window with the size of n × n, where the step length is 1, in the embodiment of the present invention, traversing the weld surface image by using a 3 × 3 sliding window, calculating a gray variance in each sliding window, where the gray variance is the gray deviation, calculating the smoothness of the corresponding pixel point by using the gray deviation, and recording the smoothness of the central pixel point as G, then:
Figure BDA0003738859230000041
in the formula, G represents the smoothness degree of the gray value of the pixel points in the sliding window, K represents the number of the pixel points in the sliding window, G represents the gray value of the central pixel point in the sliding window, and G k Expressing the gray value of the kth pixel point, wherein e is a natural constant; x represents a normalized coefficient, and the empirical value is 20, when
Figure BDA0003738859230000042
When the degree of smoothing G is equal to about 0.7, i.e. when
Figure BDA0003738859230000043
It is considered to be smooth.
Obtaining a smooth degree sequence according to the traversal sequence of the sliding window, establishing a rectangular coordinate system by taking the sliding times of the sliding window as a horizontal axis and the smooth degree as a vertical axis, drawing points in the rectangular coordinate system according to the smooth degree sequence to draw a smooth degree curve, analyzing the smooth degree curve to obtain a plurality of minimum value points, and when the minimum value points are smaller than a preset smooth threshold, corresponding pixel points are edge pixel points of the welding line, and a connected domain obtained by connecting the edge pixel points is a target area. Wherein the preset smoothing threshold is 0.3.
S003, acquiring the gradient of each pixel point in the target area and the shortest distance between each pixel point and the center line of the target area, and calculating the attention degree of each pixel point in the target area according to the product of the gradient and the shortest distance, wherein the attention degree is positively correlated with the product; and performing area growth on the target area based on the attention degree to obtain a suspected defect area.
Calculating each pixel point in the target area by using sobel operatorGradient f in horizontal direction x And gradient f in the vertical direction y . Wherein the gradient magnitude
Figure BDA0003738859230000051
Corresponding gradient direction is
Figure BDA0003738859230000052
Because the undercut defect exists in the edge of welding seam, and because be the pit on the plane, can have the change of light and shadow in the pit, represent the change of grey level in the image, also the gradient amplitude of the marginal pixel of welding seam undercut defect is great promptly, consequently calculates the degree of concern of every pixel in the target area, and the degree of concern of arbitrary pixel is marked as E, then has:
Figure BDA0003738859230000053
in the formula, E represents the attention degree of any pixel point in the target area, f represents the gradient of the corresponding pixel point, l represents the shortest distance between the corresponding pixel point and the center line of the target area, E is a natural constant, m represents a normalization coefficient, an empirical value is taken as m equal to 80, when f is equal to m, the attention degree E is equal to 0.8, namely when f is equal to or greater than m, the pixel point is considered to need important attention, and the pixel point is marked.
Because the closer the pixel point belonging to the undercut defect is to the edge of the connected domain, the larger the gradient amplitude is, the higher the possibility that the pixel point is an edge pixel point is, so that the pixel point is concerned more, and when the attention degree of a certain pixel point is greater than 0.8, the pixel point is marked.
The method for the central line of the target area comprises the following steps: regarding edge pixel points of the target area, taking any one pixel point as a target point, making a perpendicular line of the target point and respectively intersecting the edge of the target area at two points, and taking the midpoint of the two points; the curve obtained by connecting all the midpoints is the centerline.
And then judging the connectivity of the pixel points in the target region based on the attention degree, and judging and acquiring suspected defects by adopting a region growing method based on the attention degree. Specifically, the point with the largest attention degree of the pixel points in the target area is used as a seed point, the seed point is used as a starting point of growth, searching is carried out in eight neighborhoods of the seed point, the pixels with the attention degree larger than 0.8 of the pixel points in the neighborhoods are reserved, the reserved pixels are used as seed points of next growth, iteration is carried out for multiple times, growth is stopped until the pixel points with the attention degree value larger than or equal to 0.8 are not contained in the neighborhoods of the pixel points with the largest attention degree in the target area range, and the area obtained by growth is a suspected defect area.
Step S004, calculating the similarity level between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type; the final undercut defect type is obtained when the number of similar levels in the suspected defect area is greater than the weighted sum of the similar levels.
The undercut defect is divided into discontinuous undercut and continuous undercut, the discontinuous undercut is a transient melting master batch, and the external form of the undercut is represented by a pit with an arc edge, so that the probability that the pit with the arc edge is discontinuous undercut is higher in the direction away from the central line of a target area, in other words, the gradient direction of edge pixel points of the discontinuous undercut defect approaches to point to a circle; the continuous undercut is the burning of the master batch caused by the reasons of overlarge temperature, too close distance and the like, the pit edge of the undercut is approximately parallel to the edge of the welding seam, in other words, the gradient direction of the edge of the continuous undercut defect and the gradient direction of the edge of the welding seam are approximately parallel, so that the embodiment of the invention firstly calculates the gradient similarity in the suspected defect area, judges whether the continuous undercut is met, calculates the gradient direction centricity and judges whether the discontinuous undercut is adopted.
And calculating cosine similarity between the gradient direction of each pixel point and the expected direction of each undercut defect type, and judging the similarity grade of the cosine similarity. And when the undercut defect type is a continuous undercut defect, the expected direction is a direction in which the corresponding pixel point is perpendicular to the center line of the target area, and the corresponding similarity when the undercut defect is continuous is called gradient direction similarity. And when the undercut defect type is an intermittent undercut defect, the expected direction is a tangential direction when the corresponding pixel point is taken as a tangential point of the suspected defect area, and the similarity corresponding to the intermittent undercut defect is called gradient centrality.
Specifically, the gradient direction similarity D of the ith pixel point in the suspected defect area is calculated i Then, there are:
Figure BDA0003738859230000061
in the formula, v i Represents the gradient direction, u, of the ith pixel i And the direction of the ith pixel point perpendicular to the central line of the target area is represented, and when the gradient direction of the pixel point is more parallel to the direction of the pixel point perpendicular to the central line of the target area, the value of the similarity in the gradient direction is larger, namely the value is closer to 1.
Wherein, the ith pixel point is vertical to the direction u of the central line of the target area i Fitting a suspected defect area by a least square method to obtain a welding seam center line, making a perpendicular line of the center line by using the direction of a pixel on the welding seam center line, wherein the included angle between the perpendicular line and the y axis in a pixel coordinate system is the direction u i
Calculating the gradient centrality F of the ith pixel point in the suspected defect area i Then, there are:
Figure BDA0003738859230000062
in the formula, v i Represents the gradient direction, w, of the ith pixel point i The tangent direction of the suspected defect area is represented by taking the ith pixel point as the tangent point, and when the gradient direction of the pixel point is more vertical to the tangent direction of the connected area of the suspected defect area of the pixel point, the gradient centrality is larger, namely the gradient centrality is closer to-1.
Wherein, the ith pixel point is taken as the tangent point to be the tangent direction w of the suspected defect area i Is a tangent line taking the ith pixel point as a tangent point as the central line of the welding lineThe included angle between the tangent and the y-axis in the pixel coordinate system is the tangent direction w i
In conclusion, the gradient direction similarity D of the ith pixel point in the suspected defect area can be obtained i And gradient centrality F i . And respectively grading the value ranges of the gradient direction similarity and the gradient centrality, wherein the value range of the gradient direction similarity is (0, 1), and the value range of the gradient centrality is (-1, 0). The gradient direction similarity is divided into 10 grades, and the grades are 0, 1, 2. I.e., 0 is a level of [0, 0.1 ]]Class 2 is (0.1, 0.2)]By analogy, the 9 levels are (0.9, 1)]. For gradient centrality, the absolute value of the value range of the gradient centrality is taken to obtain a mapping range (0, 1), and the gradient centrality is divided into 10 grades according to the same method.
And constructing a feature matrix of the suspected defect area, wherein the size of the feature matrix is 10 rows and 10 columns, wherein the element N (P, q) of the P row and the q column is represented by the element N, wherein the element represents the number ratio of the similarity grade in the P gradient direction and the centripetal grade in the q gradient direction, and the number ratio is marked as P (P, q). Specifically, the number of gradient direction similarity levels belonging to the P-th gradient direction and the q-th gradient centrality levels on the gradient image is denoted as N (P, q), the total number of pixels is denoted as M, and the ratio of N (P, q) to M is the number ratio P (P, q).
The similarity of the gradient direction and the centricity of the gradient are respectively used for representing the discontinuous undercut defect and the continuous undercut defect, if the centricity of one pixel point is larger than the similarity of the direction, the point is prone to the discontinuous undercut defect, otherwise, the point is prone to the continuous undercut defect, the difference of the two properties is larger, the confidence coefficient of the judgment result is higher, and therefore the defect type index is constructed
Figure BDA0003738859230000071
Defect type index
Figure BDA0003738859230000072
The calculation formula of (a) is as follows:
Figure BDA0003738859230000073
q-p represents the tendency of defects, and tends to continuous undercut defects when the value is more than zero and tends to discontinuous undercut defects when the value is less than zero, and the value range is [ -1, 1 ].
Determining the defect type of the suspected defect area according to the size of the defect type index, wherein the process is as follows: when in use
Figure BDA0003738859230000074
Figure BDA0003738859230000075
When the suspected defect area is a discontinuous undercut defect, grinding the suspected defect area into a smooth edge by using a grinding wheel for transition; when in use
Figure BDA0003738859230000076
And then, the suspected defect area is a continuous undercut defect, and at the moment, the grinding wheel is adopted for grinding and trimming, and then the repair welding operation is carried out on the continuous undercut area. When in use
Figure BDA0003738859230000077
The tendency was not considered obvious and was not treated.
In summary, in the embodiment of the present invention, the smoothness of the corresponding pixel point is calculated through the gray level deviation of the neighborhood pixels of each pixel point in the gray level image of the weld surface image; obtaining a target area according to the smoothness degree; acquiring the gradient of each pixel point in the target area and the shortest distance between each pixel point and the center line of the target area, and calculating the attention degree of each pixel point in the target area according to the gradient and the shortest distance; obtaining a suspected defect area based on the attention degree; calculating the similarity level between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type; the final undercut defect type is obtained by summing the number of similar levels in the suspected defect area with the same weight. The method can accurately detect the defects, can distinguish the defects into intermittent undercut or continuous undercut, can perform targeted processing according to the detection result, and can effectively reduce the labor intensity and improve the production efficiency.
Based on the same inventive concept as the method embodiment, the embodiment of the invention further provides a steel die welding defect detection system based on machine vision, 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 the steel die welding defect detection method based on machine vision. One of the steel die welding defect detection methods based on machine vision is described in detail in the above embodiments, and is not described again.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. 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 may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit and scope of the present invention.

Claims (8)

1. A steel die welding defect detection method based on machine vision is characterized by comprising the following steps:
extracting RGB images of the surface of the steel die to obtain a weld surface image, and graying the weld surface image to obtain a gray image;
calculating the gray level deviation of the neighborhood pixels of each pixel point in the gray level image, and calculating the smoothness degree of the corresponding pixel point according to the gray level deviation; obtaining an extreme point of the smoothness degree corresponding to each pixel point in the gray level image, and connecting the extreme points smaller than a preset gray level threshold value to obtain a target area;
obtaining the gradient of each pixel point in the target area and the shortest distance between each pixel point and the center line of the target area, and calculating the attention degree of each pixel point in the target area according to the product of the gradient and the shortest distance, wherein the attention degree is positively correlated with the product; performing area growth on the target area based on the attention degree to obtain a suspected defect area;
calculating the similarity level between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type; the final undercut defect type is obtained by summing the number of similar levels in the suspected defect area with the same weight.
2. The steel die welding defect detection method based on machine vision as claimed in claim 1, wherein the step of calculating the gray scale deviation of the neighborhood pixels of each pixel point in the gray scale image comprises the following steps:
and calculating the gray variance in each sliding window by taking each pixel point as a central pixel point of the sliding window, wherein the gray variance is the gray deviation.
3. The method of claim 3, wherein the step of obtaining the extreme points of the smoothness degree corresponding to each pixel point in the gray image comprises:
obtaining a smooth degree sequence according to the traversal sequence of the sliding window, establishing a rectangular coordinate system by taking the sliding times of the sliding window as a horizontal axis and the smooth degree as a vertical axis, drawing points in the rectangular coordinate system according to the smooth degree sequence to draw a smooth degree curve, analyzing the smooth degree curve to obtain a plurality of minimum value points, and when the minimum value points are smaller than a preset smooth threshold, corresponding pixel points are edge pixel points of the welding seam, and a connected domain obtained by connecting the edge pixel points is a target region.
4. The method of claim 1, wherein the step of calculating the similarity between the gradient direction of each pixel point in the suspected defect area and the expected direction of each undercut defect type further comprises:
and calculating cosine similarity between the gradient direction of each pixel point and the expected direction of each undercut defect type, and judging the similarity grade of the cosine similarity.
5. The steel die welding defect detection method based on machine vision as claimed in claim 1, wherein the step of obtaining the desired direction of each undercut defect type comprises:
and when the undercut defect type is a discontinuous undercut defect, the expected direction is a tangential direction when the corresponding pixel point is taken as a tangential point of the suspected defect area.
6. The steel die welding defect detection method based on machine vision as claimed in claim 1, characterized in that the step of obtaining the desired direction of each undercut defect type comprises:
and when the undercut defect type is a continuous undercut defect, the expected direction is a direction in which the corresponding pixel point is perpendicular to the central line of the target area.
7. The method for detecting the welding defects of the steel die based on the machine vision as recited in claim 1, wherein the step of extracting the RGB images of the surface of the steel die to obtain the image of the surface of the welding seam comprises the following steps:
classifying background pixel points and welding line pixel points in the RGB image on the surface of the steel die by utilizing a DNN network to obtain a mask image, and multiplying the mask image and the RGB image on the surface of the steel die to obtain the image on the surface of the welding line.
8. A machine vision based steel die weld defect detection system comprising a memory, a processor and a computer program stored in the memory and run on the processor, wherein the processor when executing the computer program implements the steps of the method of any one of claims 1-7.
CN202210810847.0A 2022-07-11 2022-07-11 Steel die welding defect detection method and system based on machine vision Pending CN115100171A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210810847.0A CN115100171A (en) 2022-07-11 2022-07-11 Steel die welding defect detection method and system based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210810847.0A CN115100171A (en) 2022-07-11 2022-07-11 Steel die welding defect detection method and system based on machine vision

Publications (1)

Publication Number Publication Date
CN115100171A true CN115100171A (en) 2022-09-23

Family

ID=83297246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210810847.0A Pending CN115100171A (en) 2022-07-11 2022-07-11 Steel die welding defect detection method and system based on machine vision

Country Status (1)

Country Link
CN (1) CN115100171A (en)

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272316A (en) * 2022-09-27 2022-11-01 山东华太新能源电池有限公司 Intelligent detection method for welding quality of battery cover based on computer vision
CN115294101A (en) * 2022-09-26 2022-11-04 南通博亿峰都新材料科技有限公司 Plastic product appearance quality detection method
CN115311290A (en) * 2022-10-12 2022-11-08 南通市通州区精华电器有限公司 Method for detecting defects of metal parts of precision instrument
CN115330989A (en) * 2022-10-13 2022-11-11 南通红运金属科技有限公司 Control method for laser beam cutting
CN115330760A (en) * 2022-10-12 2022-11-11 南通市通州区精华电器有限公司 Diode pin defect identification method
CN115439476A (en) * 2022-11-07 2022-12-06 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis
CN115631173A (en) * 2022-10-28 2023-01-20 兰州理工大学 Composite film defect identification method
CN115797356A (en) * 2023-02-09 2023-03-14 山东第一医科大学附属省立医院(山东省立医院) Nuclear magnetic resonance tumor region extraction method
CN115797872A (en) * 2023-01-31 2023-03-14 捷易(天津)包装制品有限公司 Machine vision-based packaging defect identification method, system, equipment and medium
CN115797361A (en) * 2023-02-13 2023-03-14 山东淼泰建筑科技有限公司 Aluminum template surface defect detection method
CN115830013A (en) * 2023-02-08 2023-03-21 磐石重工(青岛)股份有限公司 Machine vision-based method for detecting weld defects of pressure vessel
CN115861291A (en) * 2023-01-06 2023-03-28 曲阜天博汽车电器有限公司 Patch circuit board production defect detection method based on machine vision
CN115984283A (en) * 2023-03-21 2023-04-18 山东中济鲁源机械有限公司 Intelligent detection method for welding quality of reinforcement cage
CN116385476A (en) * 2023-06-05 2023-07-04 青岛星跃铁塔有限公司 Iron tower quality analysis method based on visual detection
CN116618954A (en) * 2023-07-03 2023-08-22 杭州玖逸行汽车技术有限公司 Welding repair equipment and repair method for automobile circuit board
CN116664569A (en) * 2023-07-31 2023-08-29 山东正华建筑科技有限公司 Weld flash defect detection method
CN116703907A (en) * 2023-08-04 2023-09-05 合肥亚明汽车部件有限公司 Machine vision-based method for detecting surface defects of automobile castings
CN116758061A (en) * 2023-08-11 2023-09-15 山东优奭趸泵业科技有限公司 Casting surface defect detection method based on computer vision
CN116805317A (en) * 2023-08-28 2023-09-26 苏州科尔珀恩机械科技有限公司 Rotary furnace inner wall defect detection method based on artificial intelligence
CN116843678A (en) * 2023-08-28 2023-10-03 青岛冠宝林活性炭有限公司 Hard carbon electrode production quality detection method
CN116843757A (en) * 2023-08-29 2023-10-03 山东千颐科技有限公司 Intelligent labeling machine positioning method based on computer vision
CN116977333A (en) * 2023-09-22 2023-10-31 山东恒海钢结构有限公司 Image data-based quality detection method for assembled steel structural member
CN117011297A (en) * 2023-10-07 2023-11-07 惠州市凯默金属制品有限公司 Aluminum alloy automobile accessory die defect detection method based on image processing
CN117173189A (en) * 2023-11-03 2023-12-05 南通江华机械有限公司 Visual inspection system for polishing effect of aluminum alloy surface
CN117314912A (en) * 2023-11-29 2023-12-29 山东贞元汽车车轮有限公司 Visual detection method and system for welding defects on surface of welded pipe
CN117351019A (en) * 2023-12-06 2024-01-05 巴苏尼制造(江苏)有限公司 Welding defect detection method

Cited By (41)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115294101A (en) * 2022-09-26 2022-11-04 南通博亿峰都新材料科技有限公司 Plastic product appearance quality detection method
CN115272316A (en) * 2022-09-27 2022-11-01 山东华太新能源电池有限公司 Intelligent detection method for welding quality of battery cover based on computer vision
CN115311290A (en) * 2022-10-12 2022-11-08 南通市通州区精华电器有限公司 Method for detecting defects of metal parts of precision instrument
CN115330760A (en) * 2022-10-12 2022-11-11 南通市通州区精华电器有限公司 Diode pin defect identification method
CN115330989A (en) * 2022-10-13 2022-11-11 南通红运金属科技有限公司 Control method for laser beam cutting
CN115631173A (en) * 2022-10-28 2023-01-20 兰州理工大学 Composite film defect identification method
CN115439476A (en) * 2022-11-07 2022-12-06 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis
CN115439476B (en) * 2022-11-07 2023-03-14 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis
CN115861291A (en) * 2023-01-06 2023-03-28 曲阜天博汽车电器有限公司 Patch circuit board production defect detection method based on machine vision
CN115797872A (en) * 2023-01-31 2023-03-14 捷易(天津)包装制品有限公司 Machine vision-based packaging defect identification method, system, equipment and medium
CN115830013A (en) * 2023-02-08 2023-03-21 磐石重工(青岛)股份有限公司 Machine vision-based method for detecting weld defects of pressure vessel
CN115797356A (en) * 2023-02-09 2023-03-14 山东第一医科大学附属省立医院(山东省立医院) Nuclear magnetic resonance tumor region extraction method
CN115797361A (en) * 2023-02-13 2023-03-14 山东淼泰建筑科技有限公司 Aluminum template surface defect detection method
CN115797361B (en) * 2023-02-13 2023-06-27 山东淼泰建筑科技有限公司 Aluminum template surface defect detection method
CN115984283A (en) * 2023-03-21 2023-04-18 山东中济鲁源机械有限公司 Intelligent detection method for welding quality of reinforcement cage
CN116385476A (en) * 2023-06-05 2023-07-04 青岛星跃铁塔有限公司 Iron tower quality analysis method based on visual detection
CN116385476B (en) * 2023-06-05 2023-08-18 青岛星跃铁塔有限公司 Iron tower quality analysis method based on visual detection
CN116618954A (en) * 2023-07-03 2023-08-22 杭州玖逸行汽车技术有限公司 Welding repair equipment and repair method for automobile circuit board
CN116618954B (en) * 2023-07-03 2023-10-20 杭州玖逸行汽车技术有限公司 Welding repair equipment and repair method for automobile circuit board
CN116664569A (en) * 2023-07-31 2023-08-29 山东正华建筑科技有限公司 Weld flash defect detection method
CN116664569B (en) * 2023-07-31 2023-10-10 山东正华建筑科技有限公司 Weld flash defect detection method
CN116703907A (en) * 2023-08-04 2023-09-05 合肥亚明汽车部件有限公司 Machine vision-based method for detecting surface defects of automobile castings
CN116703907B (en) * 2023-08-04 2023-10-27 合肥亚明汽车部件有限公司 Machine vision-based method for detecting surface defects of automobile castings
CN116758061A (en) * 2023-08-11 2023-09-15 山东优奭趸泵业科技有限公司 Casting surface defect detection method based on computer vision
CN116758061B (en) * 2023-08-11 2023-10-31 山东优奭趸泵业科技有限公司 Casting surface defect detection method based on computer vision
CN116843678B (en) * 2023-08-28 2023-11-21 青岛冠宝林活性炭有限公司 Hard carbon electrode production quality detection method
CN116843678A (en) * 2023-08-28 2023-10-03 青岛冠宝林活性炭有限公司 Hard carbon electrode production quality detection method
CN116805317A (en) * 2023-08-28 2023-09-26 苏州科尔珀恩机械科技有限公司 Rotary furnace inner wall defect detection method based on artificial intelligence
CN116805317B (en) * 2023-08-28 2023-11-14 苏州科尔珀恩机械科技有限公司 Rotary furnace inner wall defect detection method based on artificial intelligence
CN116843757A (en) * 2023-08-29 2023-10-03 山东千颐科技有限公司 Intelligent labeling machine positioning method based on computer vision
CN116843757B (en) * 2023-08-29 2023-12-01 山东千颐科技有限公司 Intelligent labeling machine positioning method based on computer vision
CN116977333A (en) * 2023-09-22 2023-10-31 山东恒海钢结构有限公司 Image data-based quality detection method for assembled steel structural member
CN116977333B (en) * 2023-09-22 2023-12-22 山东恒海钢结构有限公司 Image data-based quality detection method for assembled steel structural member
CN117011297A (en) * 2023-10-07 2023-11-07 惠州市凯默金属制品有限公司 Aluminum alloy automobile accessory die defect detection method based on image processing
CN117011297B (en) * 2023-10-07 2024-02-02 惠州市凯默金属制品有限公司 Aluminum alloy automobile accessory die defect detection method based on image processing
CN117173189A (en) * 2023-11-03 2023-12-05 南通江华机械有限公司 Visual inspection system for polishing effect of aluminum alloy surface
CN117173189B (en) * 2023-11-03 2024-03-05 南通江华机械有限公司 Visual inspection system for polishing effect of aluminum alloy surface
CN117314912A (en) * 2023-11-29 2023-12-29 山东贞元汽车车轮有限公司 Visual detection method and system for welding defects on surface of welded pipe
CN117314912B (en) * 2023-11-29 2024-01-30 山东贞元汽车车轮有限公司 Visual detection method and system for welding defects on surface of welded pipe
CN117351019A (en) * 2023-12-06 2024-01-05 巴苏尼制造(江苏)有限公司 Welding defect detection method
CN117351019B (en) * 2023-12-06 2024-01-30 巴苏尼制造(江苏)有限公司 Welding defect detection method

Similar Documents

Publication Publication Date Title
CN115100171A (en) Steel die welding defect detection method and system based on machine vision
CN110889398B (en) Multi-modal image visibility detection method based on similarity network
CN114219805B (en) Intelligent detection method for glass defects
CN115249246B (en) Optical glass surface defect detection method
CN107392919B (en) Adaptive genetic algorithm-based gray threshold acquisition method and image segmentation method
CN108073918B (en) Method for extracting blood vessel arteriovenous cross compression characteristics of fundus retina
CN114092389A (en) Glass panel surface defect detection method based on small sample learning
CN113658132A (en) Computer vision-based structural part weld joint detection method
CN109753949B (en) Multi-window traffic sign detection method based on deep learning
CN113870235A (en) Method for detecting defects of circular stamping part based on quantum firework arc edge extraction
CN115311277B (en) Pit defect identification method for stainless steel product
CN114897896B (en) Building wood defect detection method based on gray level transformation
CN106340016A (en) DNA quantitative analysis method based on cell microscope image
CN106408555A (en) Bearing surface flaw detection method based on image vision
CN114359190B (en) Plastic product molding control method based on image processing
CN112489081A (en) Visual target tracking method and device
CN117689655B (en) Metal button surface defect detection method based on computer vision
CN116309577B (en) Intelligent detection method and system for high-strength conveyor belt materials
CN114881965A (en) Wood board joint detection method based on artificial intelligence and image processing
CN107516315B (en) Tunneling machine slag tapping monitoring method based on machine vision
CN109544513A (en) A kind of steel pipe end surface defect extraction knowledge method for distinguishing
CN116977333B (en) Image data-based quality detection method for assembled steel structural member
CN113610052A (en) Tunnel water leakage automatic identification method based on deep learning
CN107832732B (en) Lane line detection method based on treble traversal
CN115841600B (en) Deep learning-based sweet potato appearance quality classification method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20220923