CN115311292A - Strip steel surface defect detection method and system based on image processing - Google Patents
Strip steel surface defect detection method and system based on image processing Download PDFInfo
- Publication number
- CN115311292A CN115311292A CN202211245031.4A CN202211245031A CN115311292A CN 115311292 A CN115311292 A CN 115311292A CN 202211245031 A CN202211245031 A CN 202211245031A CN 115311292 A CN115311292 A CN 115311292A
- Authority
- CN
- China
- Prior art keywords
- value
- gray
- pixel
- strip steel
- segmentation
- 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.)
- Granted
Links
- 230000007547 defect Effects 0.000 title claims abstract description 114
- 229910000831 Steel Inorganic materials 0.000 title claims abstract description 65
- 239000010959 steel Substances 0.000 title claims abstract description 65
- 238000001514 detection method Methods 0.000 title claims abstract description 14
- 230000011218 segmentation Effects 0.000 claims abstract description 54
- 238000005192 partition Methods 0.000 claims abstract description 13
- 238000000034 method Methods 0.000 claims description 41
- 238000004590 computer program Methods 0.000 claims description 6
- 230000002950 deficient Effects 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000005315 distribution function Methods 0.000 description 2
- 239000002184 metal Substances 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 238000012935 Averaging Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000005096 rolling process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/762—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Quality & Reliability (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The invention relates to the technical field of image processing, in particular to a strip steel surface defect detection method and system based on image processing. Firstly, acquiring a surface image of the strip steel and a corresponding gray histogram, and growing a pixel point region corresponding to a second peak in the gray histogram to obtain a plurality of segmentation regions; and replacing the pixel values of the pixel points in the partition area. Clustering the divided areas based on the average gray value of each replaced divided area to obtain a plurality of clusters, and calculating the mean value of Euclidean distances of the divided areas in the clusters as a distance mean value; calculating the difference of the clusters based on the average gray value and the distance mean value; and acquiring a reference window width according to the difference of differences among different clusters, clustering the divided regions based on the reference window width to obtain a plurality of cluster categories, wherein each cluster category corresponds to one defect region. According to the invention, the segmentation areas are clustered according to the self-adaptive reference window width, so that the accuracy of acquiring the defect area is further improved.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a strip steel surface defect detection method and system based on image processing.
Background
The strip steel is a narrow and long steel plate produced by various steel rolling enterprises in order to meet the requirements of different industrial departments on industrialized production of various types of metal or mechanical products. At present, a common method for detecting defects of a steel plate includes the steps of obtaining edges of strip steel, performing sliding window traversal on the edges of the strip steel, obtaining a deviation angle of a middle pixel of each sliding window, judging whether the edges of the strip steel have defects or not according to fluctuation degree of the deviation angle, and dividing defect types based on continuity of the deviation angle to obtain defect positions. In the method, the judgment is influenced by the scratch defect and the texture of the surface in the judgment process, so that the obtained defect corresponding to the offset angle is inaccurate.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a strip steel surface defect detection method and a strip steel surface defect detection system based on image processing, and the adopted technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for detecting defects on a surface of a strip steel based on image processing, the method including the following steps:
acquiring a surface image of the strip steel, and graying the surface image of the strip steel to obtain a surface gray image;
acquiring a gray histogram corresponding to the surface gray map, and taking a pixel point corresponding to a gray value at a second peak in the gray histogram as a seed pixel point; performing region growth based on the seed pixel points to obtain a plurality of segmentation regions;
taking the pixel points in each partition area as a window center, taking the average value of the maximum gray value and the minimum gray value of the pixel points in each window as a judgment threshold, and replacing the pixel values of the pixel points in the window based on the judgment threshold to obtain a replaced surface gray image; calculating the average gray value of each segmentation area in the replaced surface gray map;
clustering the segmentation areas based on the average gray value to obtain a plurality of clusters, and calculating the mean value of Euclidean distances between every two segmentation areas in the clusters as a distance mean value; calculating cluster correspondence dissimilarities based on the average grayscale values and the distance means; and acquiring a reference window width according to the difference of differences among different clusters, clustering the partitioned areas based on the reference window width to obtain a plurality of cluster categories, wherein each cluster category corresponds to one defect area.
Preferably, the second peak in the gray histogram is: the second largest peak on the grayscale histogram except the largest peak.
Preferably, the taking the pixel point in each partition region as a window center includes: the size of the window is determined by the fraction of the small peaks within a certain range.
Preferably, the replacing the pixel values of the pixels in the window based on the judgment threshold includes:
for the pixel points in the window, when the pixel values of the pixel points are smaller than the judgment threshold value, replacing the pixel values of the pixel points with 0; and when the pixel value of the pixel point is greater than or equal to the judgment threshold value, replacing the pixel value of the pixel point with 1.
Preferably, the calculating the variance corresponding to the clusters based on the average gray value and the distance mean value includes:
calculating the product of the average gray value of each segmentation area in the cluster and the distance average value corresponding to the cluster as the distance of the segmentation areas; the mean value of the distances of the segmented regions corresponding to all the segmented regions in the cluster is the difference corresponding to the cluster.
Preferably, the obtaining the reference window width according to the difference between the different clusters includes:
calculating difference values of the difference of the first segmented region and the difference of the last segmented region; acquiring the number of segmentation areas containing pixel points with pixel values of 0 in the area; and the ratio of the difference value to the number of the segmented regions is the reference window width.
In a second aspect, an embodiment of the present invention provides a system for detecting defects on a surface of a strip steel based on image processing, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for detecting defects on a surface of a strip steel based on image processing when executing the computer program.
The embodiment of the invention at least has the following beneficial effects:
firstly, acquiring a surface image, a surface gray image and a corresponding gray histogram of the strip steel, and taking a pixel point corresponding to a gray value at a second peak in the gray histogram as a seed pixel point; performing region growth based on the seed pixel points to obtain a plurality of segmentation regions; taking the pixel points in each partition area as a window center, taking the average value of the maximum gray value and the minimum gray value of the pixel points in each window as a judgment threshold, and replacing the pixel values of the pixel points in the window based on the judgment threshold to obtain a replaced surface gray image; the surface gray-scale map after replacement can more clearly reflect the gray-scale characteristics of each divided area.
Calculating the average gray value of each segmentation area in the replaced surface gray map; clustering the segmentation areas based on the average gray value to obtain a plurality of clusters, and calculating the mean value of Euclidean distances between every two segmentation areas in the clusters as a distance mean value; calculating differences corresponding to the clusters based on the average gray value and the distance mean; and acquiring a reference window width according to the difference between different clusters, and clustering the segmented regions according to the self-adaptive reference window width, thereby further improving the accuracy of acquiring the defect regions. And clustering the divided regions based on the reference window width to obtain a plurality of clustering categories, wherein each clustering category corresponds to one defect region. According to the method, self-adaptive threshold segmentation is carried out on the gray value of the defect and the gray value of the background region through the difference between the gray value of the defect and the gray value of the background region to obtain segmented regions, then the reference window width is obtained according to the gray value change of the defect, and then clustering analysis is carried out on the segmented regions according to the difference of the gray characteristics of the segmented regions to obtain the defect region. The surface gray-scale image is replaced according to the judgment threshold value, the corresponding reference window width is obtained, and the defects on the surface of the strip steel are accurately detected, so that the aim of detecting a plurality of defects is fulfilled.
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 defects on a surface of a strip steel based on image processing 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 will be given to the method and system for detecting surface defects of strip steel based on image processing according to the present invention, and the specific implementation, structure, features and effects thereof with reference to the accompanying drawings and preferred embodiments. In the following description, the different references to "one embodiment" or "another embodiment" do not necessarily refer to 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 embodiment of the invention provides a method and a system for detecting the surface defects of strip steel based on image processing, and the method is suitable for a detection scene of the surface defects of the strip steel. A plurality of light sources are uniformly arranged around the strip steel in the scene, and the surface image of the strip steel is acquired by a camera. The method aims to solve the problem that in the judging process, the obtained deviation angle corresponding to the defect is inaccurate due to scratch defects and texture influences on the judgment. According to the method, self-adaptive threshold segmentation is carried out on the gray value of the defect and the gray value of the background region through the difference between the gray value of the defect and the gray value of the background region to obtain segmented regions, then the reference window width is obtained according to the gray value change of the defect, and then clustering analysis is carried out on the segmented regions according to the difference of the gray characteristics of the segmented regions to obtain the defect region. The surface gray-scale image is replaced according to the judgment threshold value, and the corresponding reference window width is obtained, so that the defects on the surface of the strip steel are accurately detected, and the purpose of detecting a plurality of defects is achieved.
The following describes a specific scheme of the method and system for detecting the surface defects of the strip steel based on image processing in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating steps of a method for detecting surface defects of a strip steel based on image processing according to an embodiment of the present invention is shown, where the method includes the following steps:
and S100, acquiring a surface image of the strip steel, and graying the surface image of the strip steel to obtain a surface grayscale image.
The invention carries out intelligent detection on the surface defects of the strip steel by an image processing method, so that the surface images of the strip steel are firstly acquired by a camera. Because the strip steel is a metal product, light reflection can occur on the surface of the strip steel when the surface image of the strip steel is collected, and therefore, the illumination is required to be uniform when the surface image of the strip steel is collected. The light irradiation direction is overlook irradiation, a plurality of light sources are required, and the light sources are uniformly arranged near the strip steel, so that uniform light is formed and irradiated on the surface of the strip steel. Wherein, the surface image of the strip steel is an RGB image.
After the surface image of the strip steel is obtained, the surface image of the strip steel is subjected to gray level processing to obtain a surface gray level image.
Step S200, acquiring a gray histogram corresponding to the surface gray map, and taking a pixel point corresponding to a gray value at a second peak in the gray histogram as a seed pixel point; and performing region growth based on the seed pixel points to obtain a plurality of segmentation regions.
The invention carries out defect detection on the surface of the strip steel, the shape, the size and the color characteristics of the defects on the surface of the strip steel are usually different, so that the defects can be quickly detected only by adopting different methods according to different defect types during the defect detection, and the detection result is more accurate. Firstly, according to the difference between the gray value of the defect and the gray value of the background area, the surface gray level image is subjected to adaptive threshold segmentation to obtain the defect area. And then, according to different gray features of each defect, performing clustering analysis on the defects to obtain a clustering center of the defects. And finally classifying the defects according to the characteristics of the defects to obtain various defects.
Firstly, according to the difference between the gray value of the defect and the gray value of the background region, the surface gray map is subjected to adaptive threshold segmentation to obtain the defect region.
For larger defects, the defects can be segmented by a traditional threshold segmentation algorithm, and then the defects can be detected by distinguishing according to the characteristics of the defects. However, for many tiny defects on the surface of the strip steel, it is difficult to accurately divide the tiny defects only by the conventional threshold division algorithm, or the characteristics of the divided defects are mixed and difficult to distinguish, so that the defect detection result is not accurate enough. Therefore, the invention provides a method for classifying different types of defects according to the characteristics of the defects, and the classification method is to cluster the defects of the same type according to the characteristics, so that the defects of different types are in the same layer, the defects of different types are in different layers, and the defects are partitioned.
According to the characteristics in the defects, a self-adaptive threshold segmentation method is adopted to segment the defects on the surface of the strip steel, then a clustering method is adopted to segment the defects according to the types of the defects, and the method comprises the following specific steps:
when the self-adaptive threshold value is used for segmenting the defects in the strip steel surface image, firstly, a gray level histogram of a surface gray level image corresponding to the strip steel surface image is established according to the difference between the gray level values of the defects and the strip steel surface, seed pixel points of a defect region are obtained by adopting different segmentation threshold values, self-adaptation of the edge threshold value is carried out according to the characteristics of the defects, and an accurate defect segmentation region is obtained.
Since the histogram of an image can be regarded as an approximation of the probability density distribution function of the gray values of the pixels, if an image includes a background region and a target region, the probability density distribution function of the gray values of the pixels represented by the corresponding gray histogram is actually the sum of two unimodal distribution density functions corresponding to the target and the background. The surface gray scale map generates a corresponding gray scale histogram having a range of corresponding gray scalesWhen the number of pixels having gray level i isThen the probability of occurrence of gray level i is:
wherein,is the probability of occurrence of a gray level i;representing the total number of pixel points on the surface gray-scale map;the number of pixels with the gray level i.
Since the surface of the strip without defects is uniform, no abrupt change in the gray value occurs. In the strip steel surface image of the defective strip steel, the number of the defective pixel points is smaller than that of the pixel points in the background area, and the gray values of the defective pixel points and the background area are different to a certain extent, so that at least two peaks are formed in the gray histogram corresponding to the surface gray map, wherein the peak with the highest frequency is used as a large peak, the peak with the second highest frequency is used as a small peak, namely the second largest peak except the largest peak is used as a small peak, the small peak is also used as a second peak, the background area in the strip steel surface image represented by the large peak is represented by the small peak, and the suspected defect area is represented by the small peak. In the wave crests of the gray histogram, the gray value corresponding to the maximum frequency is a pixel point in the central area of the area corresponding to the wave crest, and the pixel point corresponding to the gray value of the maximum frequency at the position of the small wave crest in the gray histogram is used as a seed pixel point, namely the pixel point corresponding to the gray value at the position of the second wave crest in the gray histogram is used as the seed pixel point. And performing region growth based on the obtained seed pixel points, forming a plurality of segmentation regions in the image, wherein the pixel points in the segmentation regions are suspected defect pixel points of suspected defects.
Step S300, taking the pixel points in each partition area as a window center, taking the average value of the maximum gray value and the minimum gray value of the pixel points in each window as a judgment threshold, and replacing the pixel values of the pixel points in the window based on the judgment threshold to obtain a replaced surface gray image; and calculating the average gray value of each divided area in the replaced surface gray map.
Further, according to a plurality of segmentation areas obtained by seed pixel point growth, edge threshold self-adaption is carried out on the obtained segmentation areas. Firstly, regarding each pixel point in a segmentation window, namely regarding each suspected defect pixel point, the window center is taken as the window, and the size of the window is determined according to the ratio of small peaks of a gray histogram, because the larger the small peak is, the larger the reflected suspected defect area is, the larger the window required by the suspected defect area is. The window size is calculated as:
wherein,is the size of the window(s) to be,meaning that the rounding is done down,indicating wavelet peak atRatio within the range. The 50 is because the ratio of defective pixels is small, so 50 needs to be multiplied to obtain the size of the window according to the ratio. It should be noted that I is the gray value of the pixel point corresponding to the valley between the large peak and the wavelet peak on the gray histogram. The larger the proportion of the small wave peak in the range is, the larger the corresponding window is, and conversely, the smaller the proportion of the wavelet peak in the range is, the smaller the corresponding window is.
Searching the maximum gray value and the minimum gray value of the pixel points in the window according to the obtained window, taking the average value of the maximum gray value and the minimum gray value of the pixel points in the window as a judgment threshold, and replacing the pixel values of the pixel points in the window based on the judgment threshold to obtain a replaced window. Specifically, the method comprises the following steps: starting to scan pixel points in a window point by point from the upper left corner of the surface gray-scale image, judging a threshold value of each pixel point, and replacing the pixel value of the pixel point with 0 when the pixel value of the pixel point is smaller than the judgment threshold value; and when the pixel value of the pixel point is more than or equal to the judgment threshold, replacing the pixel value of the pixel point with 1, carrying out window-by-window replacement on the pixel values of all the pixel points in the surface gray level image, obtaining a replaced window after the replacement is finished, and obtaining the replaced surface gray level image.
And calculating the average gray value of each segmentation area in the replaced surface gray map, and using the average gray value to represent the gray characteristic of each segmentation area after replacement.
Step S400, clustering the divided areas based on the average gray value to obtain a plurality of clusters, and calculating the mean value of Euclidean distances between every two divided areas in the clusters as a distance mean value; calculating differences corresponding to the clusters based on the average gray value and the distance mean; and acquiring a reference window width according to the difference between different clusters, and clustering the divided regions based on the reference window width to obtain a plurality of cluster categories, wherein each cluster category corresponds to one defect region.
The defect regions on the surface of the strip steel are obtained according to the steps, but the specific defect types corresponding to the defects cannot be determined, so that different defect types can be obtained by extracting the defects of the same type by a clustering method and then identifying the defects.
The traditional clustering method needs to select the clustering center manually, the method can slow down the operation speed, and the clustering effect can be influenced by selecting too many clustering centers, so that the same defect area after clustering is inaccurate. Therefore, the method improves the method, and adopts the reference window width to automatically select the potential clustering center as the initial clustering center.
Clustering the segmentation area based on the average gray value to obtain a plurality of clusters, specifically: and dividing the divided regions with the same average gray value into the same cluster. Calculating the mean value of Euclidean distances between every two divided regions in the cluster as a distance mean value; the euclidean distance represents a local density, and the smaller the euclidean distance between the divided regions, the greater the divided region density.
And calculating Euclidean distances between every two regions, and expressing the density between the divided regions by the distance mean value obtained by averaging all the Euclidean distances. And then calculating the corresponding difference of the clusters based on the average gray value and the distance mean value, namely measuring the difference between the clusters by the normalized product of the average gray value and the distance mean value of each segmented region, and calculating the difference of the segmented regions in the clusters. Specifically, the method comprises the following steps: calculating the product of the average gray value of each segmentation area in the cluster and the distance average value corresponding to the cluster, and taking the product as the segmentation area distance of the segmentation area; and taking the mean value of the distances of the divided regions corresponding to all the divided regions in the cluster as the difference corresponding to the cluster.
The difference is calculated by the formula:
wherein,the variance for the ith cluster;the distance mean value corresponding to the ith cluster;the average gray value corresponding to the v-th segmentation area in the ith cluster;the number of segmented regions in the ith cluster. The average gray scale values of the divided regions in the same cluster are the same.
Wherein,representing a region density set with the same average gray value, namely the sum of the distance means of the divided regions in the cluster with the same average gray value of the cluster;the cluster difference of the regions with the same average gray value in the whole surface gray scale map is shown, that is, the difference of different clusters is obtained according to the difference of gray scales.
And obtaining the reference window width according to the difference of the partitioned areas between the first partitioned area and the last partitioned area. And scanning is performed one by one from bottom to top, namely, pixels in the partition region are traversed from back to front. Acquiring pixel values of pixel points in each segmentation region in the surface gray-scale image after replacement, and taking the pixel points with the pixel values of 255 as the pixel points without data; when a pixel point without data appears in a certain partition region for the first time, the first pixel point without data in the partition region is used as a turning point, and all points in the partition region before the turning point are used as potential clustering center points.
Further, calculating difference differences of the first segmented region and the differences of the last segmented region; acquiring the number of the segmentation areas containing the pixel points with the pixel values of 0 in the area, namely acquiring the number of the segmentation areas containing the pixel points with data; and the ratio of the difference value to the number of the segmentation areas is used as a reference window width. Because the number of defective pixels is too many, part of valid data can be selected for processing, that is, a partition region of pixels with data is selected for processing, for example, pixels before a turning point in the partition region are equally divided, and each equal division is divided into reference window widths. Wherein the reference window width is the reference window width of the cluster.
Wherein, the calculation formula of the reference window width is as follows:
wherein,is a reference window width;the difference corresponding to the 1 st segmented region;the difference corresponding to the mth segmented region, i.e., the difference of the last segmented region; m is the number of divided regions containing pixels with pixel values of 0 in the region.
The larger the difference of the differences among the divided regions is, the larger the value corresponding to the reference window width is; conversely, the larger the difference between the differences between the partitioned areas, the smaller the value corresponding to the reference window width. And after potential clustering centers of the defect data points are determined, turning point positions can be obtained, and scanning is performed from bottom to top, so that the center points of the segmented regions before the segmented regions corresponding to the turning points are all potential clustering center points. After the position of the potential clustering center point and the reference window width are determined, clustering is carried out on the obtained segmentation areas to obtain a plurality of clustering categories, each clustering category corresponds to one defect area, and the clustering areas with the same defects are obtained.
Classifying the defect regions according to the obtained defect regions and the characteristics of the defects, wherein the characteristics of the defects include average gray value, variance, gradient, kurtosis, energy, entropy and the like of the defect regions.
In summary, the present invention relates to the field of image processing technology. Firstly, acquiring a surface image of strip steel, and graying the surface image of the strip steel to obtain a surface grayscale image; acquiring a gray histogram corresponding to the surface gray map, and taking a pixel point corresponding to the gray value at a second peak in the gray histogram as a seed pixel point; performing region growth based on the seed pixel points to obtain a plurality of segmentation regions; taking the pixel points in each partition area as a window center, taking the average value of the maximum gray value and the minimum gray value of the pixel points in each window as a judgment threshold, and replacing the pixel values of the pixel points in the window based on the judgment threshold to obtain a replaced surface gray image; calculating the average gray value of each segmentation area in the replaced surface gray map; clustering the segmentation areas based on the average gray value to obtain a plurality of clusters, and calculating the mean value of Euclidean distances between every two segmentation areas in the clusters as a distance mean value; calculating differences corresponding to the clusters based on the average gray value and the distance mean; and acquiring a reference window width according to the difference between different clusters, and clustering the divided regions based on the reference window width to obtain a plurality of cluster categories, wherein each cluster category corresponds to one defect region. According to the method, self-adaptive threshold segmentation is carried out on the gray value of the defect and the gray value of the background region through the difference between the gray value of the defect and the gray value of the background region to obtain segmented regions, and then clustering analysis is carried out on the segmented regions according to different gray characteristics of the segmented regions to obtain the defect region.
The embodiment of the invention also provides a strip steel surface defect detection system based on image processing, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the steps of the method when executing the computer program. The method for detecting the surface defects of the strip steel based on the image processing is described in detail above and is not described in detail.
It should be noted that: the sequence of the above embodiments of the present invention is only for description, and does not represent the advantages or disadvantages of the embodiments. 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 is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (7)
1. The method for detecting the surface defects of the strip steel based on image processing is characterized by comprising the following steps of:
acquiring a surface image of the strip steel, and graying the surface image of the strip steel to obtain a surface gray image;
acquiring a gray histogram corresponding to the surface gray map, and taking a pixel point corresponding to a gray value at a second peak in the gray histogram as a seed pixel point; performing region growth based on the seed pixel points to obtain a plurality of segmentation regions;
taking the pixel points in each partition area as a window center, taking the average value of the maximum gray value and the minimum gray value of the pixel points in each window as a judgment threshold, and replacing the pixel values of the pixel points in the window based on the judgment threshold to obtain a replaced surface gray image; calculating the average gray value of each segmentation area in the surface gray map after replacement;
clustering the segmentation areas based on the average gray value to obtain a plurality of clusters, and calculating the mean value of Euclidean distances between every two segmentation areas in the clusters as a distance mean value; calculating differences corresponding to the clusters based on the average gray value and the distance mean; and acquiring a reference window width according to the difference between different clusters, and clustering the divided regions based on the reference window width to obtain a plurality of cluster categories, wherein each cluster category corresponds to one defect region.
2. The method for detecting the surface defects of the strip steel based on the image processing as claimed in claim 1, wherein the second peak in the gray histogram is: the second largest peak on the grayscale histogram except the largest peak.
3. The method for detecting the surface defects of the strip steel based on the image processing as claimed in claim 1, wherein the step of taking the pixel points in each segmented area as the center of the window comprises the steps of: the size of the window is determined by the fraction of small peaks within a certain range.
4. The method for detecting the surface defects of the strip steel based on the image processing as claimed in claim 1, wherein the replacing the pixel values of the pixel points in the window based on the judgment threshold comprises:
for the pixel points in the window, when the pixel values of the pixel points are smaller than the judgment threshold value, replacing the pixel values of the pixel points with 0; and when the pixel value of the pixel point is greater than or equal to the judgment threshold value, replacing the pixel value of the pixel point with 1.
5. The method of claim 1, wherein the calculating cluster correspondence differences based on the mean gray value and the distance mean comprises:
calculating the product of the average gray value of each segmentation area in the cluster and the distance average value corresponding to the cluster as the distance of the segmentation areas; the mean value of the distances of the segmented regions corresponding to all the segmented regions in the cluster is the difference corresponding to the cluster.
6. The method of claim 1, wherein the obtaining the reference window width according to the difference between the differences of the clusters comprises:
calculating difference values of the difference of the first segmentation region and the difference of the last segmentation region; acquiring the number of segmentation areas containing pixel points with the pixel value of 0 in the area; and the ratio of the difference value to the number of the segmentation regions is a reference window width.
7. A strip steel surface defect detection system based on image processing comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, and is characterized in that the steps of the method as claimed in any one of claims 1 to 6 are realized when the processor executes the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211245031.4A CN115311292B (en) | 2022-10-12 | 2022-10-12 | Strip steel surface defect detection method and system based on image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211245031.4A CN115311292B (en) | 2022-10-12 | 2022-10-12 | Strip steel surface defect detection method and system based on image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115311292A true CN115311292A (en) | 2022-11-08 |
CN115311292B CN115311292B (en) | 2023-01-17 |
Family
ID=83868422
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211245031.4A Active CN115311292B (en) | 2022-10-12 | 2022-10-12 | Strip steel surface defect detection method and system based on image processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115311292B (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115601362A (en) * | 2022-12-14 | 2023-01-13 | 临沂农业科技职业学院(筹)(Cn) | Welding quality evaluation method based on image processing |
CN115661136A (en) * | 2022-12-12 | 2023-01-31 | 深圳宝铭微电子有限公司 | Semiconductor defect detection method for silicon carbide material |
CN115690108A (en) * | 2023-01-04 | 2023-02-03 | 山东元旺电工科技有限公司 | Aluminum alloy rod production quality evaluation method based on image processing |
CN115797353A (en) * | 2023-02-08 | 2023-03-14 | 山东乾钢金属科技有限公司 | Intelligent detection system and method for quality of cold-rolled strip steel |
CN115861325A (en) * | 2023-03-01 | 2023-03-28 | 山东中科冶金矿山机械有限公司 | Suspension spring defect detection method and system based on image data |
CN115861290A (en) * | 2022-12-30 | 2023-03-28 | 南京林业大学 | Method for detecting surface defects of skin-touch wooden door |
CN115880699A (en) * | 2023-03-03 | 2023-03-31 | 济南市莱芜区综合检验检测中心 | Food packaging bag detection method and system |
CN115937199A (en) * | 2023-01-06 | 2023-04-07 | 山东济宁圣地电业集团有限公司 | Spraying quality detection method for insulating layer of power distribution cabinet |
CN116309671A (en) * | 2023-05-23 | 2023-06-23 | 浩珂科技有限公司 | Geosynthetic fabric quality detection system |
CN116580021A (en) * | 2023-07-03 | 2023-08-11 | 湖南益友新材料有限公司 | Environment-friendly concrete carbon reduction product production and quality detection method |
CN116645367A (en) * | 2023-07-27 | 2023-08-25 | 山东昌啸商贸有限公司 | Steel plate cutting quality detection method for high-end manufacturing |
CN116703930A (en) * | 2023-08-09 | 2023-09-05 | 湖北三环三立汽车后视镜有限公司 | Automobile rearview mirror mold forming detection method |
CN117152444A (en) * | 2023-10-30 | 2023-12-01 | 山东泰普锂业科技有限公司 | Equipment data acquisition method and system for lithium battery industry |
CN117237298A (en) * | 2023-09-15 | 2023-12-15 | 广州乾丰印花有限公司 | Printed fabric defect inspection method, device and computing equipment |
CN117237396A (en) * | 2023-11-16 | 2023-12-15 | 山东华盛中天工程机械有限责任公司 | Rail bolt rust area segmentation method based on image characteristics |
CN117333489A (en) * | 2023-12-01 | 2024-01-02 | 苏州普洛泰科精密工业有限公司 | Film damage detection device and detection system |
CN117690030A (en) * | 2024-02-02 | 2024-03-12 | 陕西仙喜辣木茯茶有限公司 | Multi-face flower identification method and system based on image processing |
CN117934483A (en) * | 2024-03-25 | 2024-04-26 | 青岛佳美洋食品有限公司 | Cod sausage production and processing quality detection method based on computer vision |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011174896A (en) * | 2010-02-25 | 2011-09-08 | Mitsubishi Heavy Ind Ltd | Imaging apparatus and method |
CN113409313A (en) * | 2021-08-18 | 2021-09-17 | 济宁联威车轮制造有限公司 | Wheel weld surface defect detection method based on computer vision |
CN114723700A (en) * | 2022-03-31 | 2022-07-08 | 江苏宝诺铸造有限公司 | Iron furnace surface crack growth prediction method and system based on computer vision |
CN115035106A (en) * | 2022-08-10 | 2022-09-09 | 邹城市天晖软件科技有限公司 | Strip steel defect intelligent detection method |
-
2022
- 2022-10-12 CN CN202211245031.4A patent/CN115311292B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011174896A (en) * | 2010-02-25 | 2011-09-08 | Mitsubishi Heavy Ind Ltd | Imaging apparatus and method |
CN113409313A (en) * | 2021-08-18 | 2021-09-17 | 济宁联威车轮制造有限公司 | Wheel weld surface defect detection method based on computer vision |
CN114723700A (en) * | 2022-03-31 | 2022-07-08 | 江苏宝诺铸造有限公司 | Iron furnace surface crack growth prediction method and system based on computer vision |
CN115035106A (en) * | 2022-08-10 | 2022-09-09 | 邹城市天晖软件科技有限公司 | Strip steel defect intelligent detection method |
Cited By (34)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115661136A (en) * | 2022-12-12 | 2023-01-31 | 深圳宝铭微电子有限公司 | Semiconductor defect detection method for silicon carbide material |
CN115661136B (en) * | 2022-12-12 | 2023-03-07 | 深圳宝铭微电子有限公司 | Semiconductor defect detection method for silicon carbide material |
CN115601362B (en) * | 2022-12-14 | 2023-03-21 | 临沂农业科技职业学院(筹) | Welding quality evaluation method based on image processing |
CN115601362A (en) * | 2022-12-14 | 2023-01-13 | 临沂农业科技职业学院(筹)(Cn) | Welding quality evaluation method based on image processing |
CN115861290B (en) * | 2022-12-30 | 2024-01-19 | 南京林业大学 | Skin-feel wood door surface defect detection method |
CN115861290A (en) * | 2022-12-30 | 2023-03-28 | 南京林业大学 | Method for detecting surface defects of skin-touch wooden door |
CN115690108A (en) * | 2023-01-04 | 2023-02-03 | 山东元旺电工科技有限公司 | Aluminum alloy rod production quality evaluation method based on image processing |
CN115937199B (en) * | 2023-01-06 | 2023-05-23 | 山东济宁圣地电业集团有限公司 | Spraying quality detection method for insulating layer of power distribution cabinet |
CN115937199A (en) * | 2023-01-06 | 2023-04-07 | 山东济宁圣地电业集团有限公司 | Spraying quality detection method for insulating layer of power distribution cabinet |
CN115797353A (en) * | 2023-02-08 | 2023-03-14 | 山东乾钢金属科技有限公司 | Intelligent detection system and method for quality of cold-rolled strip steel |
CN115861325B (en) * | 2023-03-01 | 2023-06-20 | 山东中科冶金矿山机械有限公司 | Suspension spring defect detection method and system based on image data |
CN115861325A (en) * | 2023-03-01 | 2023-03-28 | 山东中科冶金矿山机械有限公司 | Suspension spring defect detection method and system based on image data |
CN115880699B (en) * | 2023-03-03 | 2023-05-09 | 济南市莱芜区综合检验检测中心 | Food packaging bag detection method and system |
CN115880699A (en) * | 2023-03-03 | 2023-03-31 | 济南市莱芜区综合检验检测中心 | Food packaging bag detection method and system |
CN116309671A (en) * | 2023-05-23 | 2023-06-23 | 浩珂科技有限公司 | Geosynthetic fabric quality detection system |
CN116309671B (en) * | 2023-05-23 | 2023-08-11 | 浩珂科技有限公司 | Geosynthetic fabric quality detection system |
CN116580021B (en) * | 2023-07-03 | 2023-09-22 | 湖南益友新材料有限公司 | Environment-friendly concrete carbon reduction product production and quality detection method |
CN116580021A (en) * | 2023-07-03 | 2023-08-11 | 湖南益友新材料有限公司 | Environment-friendly concrete carbon reduction product production and quality detection method |
CN116645367A (en) * | 2023-07-27 | 2023-08-25 | 山东昌啸商贸有限公司 | Steel plate cutting quality detection method for high-end manufacturing |
CN116645367B (en) * | 2023-07-27 | 2023-12-01 | 山东昌啸商贸有限公司 | Steel plate cutting quality detection method for high-end manufacturing |
CN116703930B (en) * | 2023-08-09 | 2023-10-31 | 湖北三环三立汽车后视镜有限公司 | Automobile rearview mirror mold forming detection method |
CN116703930A (en) * | 2023-08-09 | 2023-09-05 | 湖北三环三立汽车后视镜有限公司 | Automobile rearview mirror mold forming detection method |
CN117237298A (en) * | 2023-09-15 | 2023-12-15 | 广州乾丰印花有限公司 | Printed fabric defect inspection method, device and computing equipment |
CN117237298B (en) * | 2023-09-15 | 2024-05-14 | 广州乾丰印花有限公司 | Printed fabric defect inspection method, device and computing equipment |
CN117152444A (en) * | 2023-10-30 | 2023-12-01 | 山东泰普锂业科技有限公司 | Equipment data acquisition method and system for lithium battery industry |
CN117152444B (en) * | 2023-10-30 | 2024-01-26 | 山东泰普锂业科技有限公司 | Equipment data acquisition method and system for lithium battery industry |
CN117237396A (en) * | 2023-11-16 | 2023-12-15 | 山东华盛中天工程机械有限责任公司 | Rail bolt rust area segmentation method based on image characteristics |
CN117237396B (en) * | 2023-11-16 | 2024-02-06 | 山东华盛中天工程机械有限责任公司 | Rail bolt rust area segmentation method based on image characteristics |
CN117333489A (en) * | 2023-12-01 | 2024-01-02 | 苏州普洛泰科精密工业有限公司 | Film damage detection device and detection system |
CN117333489B (en) * | 2023-12-01 | 2024-02-02 | 苏州普洛泰科精密工业有限公司 | Film damage detection device and detection system |
CN117690030A (en) * | 2024-02-02 | 2024-03-12 | 陕西仙喜辣木茯茶有限公司 | Multi-face flower identification method and system based on image processing |
CN117690030B (en) * | 2024-02-02 | 2024-04-26 | 陕西仙喜辣木茯茶有限公司 | Multi-face flower identification method and system based on image processing |
CN117934483A (en) * | 2024-03-25 | 2024-04-26 | 青岛佳美洋食品有限公司 | Cod sausage production and processing quality detection method based on computer vision |
CN117934483B (en) * | 2024-03-25 | 2024-05-31 | 青岛佳美洋食品有限公司 | Cod sausage production and processing quality detection method based on computer vision |
Also Published As
Publication number | Publication date |
---|---|
CN115311292B (en) | 2023-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115311292B (en) | Strip steel surface defect detection method and system based on image processing | |
CN115829883B (en) | Surface image denoising method for special-shaped metal structural member | |
CN116758061B (en) | Casting surface defect detection method based on computer vision | |
CN115018828A (en) | Defect detection method for electronic component | |
CN114219805B (en) | Intelligent detection method for glass defects | |
CN117611583B (en) | Artificial intelligence-based aluminum composite panel defect detection method and system | |
CN116152242B (en) | Visual detection system of natural leather defect for basketball | |
CN114820625B (en) | Automobile top block defect detection method | |
CN114723705A (en) | Cloth flaw detection method based on image processing | |
CN114862855B (en) | Textile defect detection method and system based on template matching | |
CN115775250A (en) | Golden finger circuit board defect rapid detection system based on digital image analysis | |
CN116523923B (en) | Battery case defect identification method | |
CN117557820B (en) | Quantum dot optical film damage detection method and system based on machine vision | |
CN114897773A (en) | Distorted wood detection method and system based on image processing | |
CN116883408B (en) | Integrating instrument shell defect detection method based on artificial intelligence | |
CN118279304B (en) | Abnormal recognition method, device and medium for special-shaped metal piece based on image processing | |
CN114581376A (en) | Automatic sorting method and system for textile silkworm cocoons based on image recognition | |
CN116246174A (en) | Sweet potato variety identification method based on image processing | |
CN110930425B (en) | Damaged target detection method based on neighborhood vector inner product local contrast image enhancement | |
CN117173176B (en) | Multi-layer photoetching process hot spot detection method based on image processing | |
CN117522864B (en) | European pine plate surface flaw detection method based on machine vision | |
CN117635615A (en) | Defect detection method and system for realizing punching die based on deep learning | |
CN114742849B (en) | Leveling instrument distance measuring method based on image enhancement | |
CN116012289A (en) | Embryo prokaryotic area detection method | |
CN118134921B (en) | Real-time reamer fracture defect detection method and system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |