Metal strip defect detection method and system based on image recognition
By conducting in-depth analysis of the surface image of the metal strip, the possibility of pits in each pixel point is evaluated and the Gaussian fuzzy standard deviation is adaptively obtained, which solves the problem of indistinguishable dirt areas and pit defect areas in traditional detection methods, and realizes the More accurate defect detection effect.
Patent Information
- Application Number
- CN202411678090.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Traditional metal strip defect detection methods are difficult to accurately distinguish between dirt and pit defect areas, resulting in mis-checking and loss of detailed information.
By conducting in-depth analysis of the surface images of metal strips, the pit possibilities of each pixel point are evaluated, and the Gaussian blur standard deviation is adaptively acquired, distinguishing between dirt and pit defect areas, for more precise image enhancement.
It significantly improves the pertinence and effectiveness of image processing, reduces false detection, retains detailed information of pit defect areas, and achieves more accurate defect detection.
Smart Images

Figure CN119180816B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a metal strip defect detection method and system based on image recognition. Background Art
[0002] With the advancement of industry and intelligent manufacturing, enterprises have increasingly higher requirements for production efficiency and product quality. Metal strips are widely used in many industries such as construction, automobiles, and electronics. Product quality directly affects the safety and performance of downstream industries. Detecting defects has become the key to improving product competitiveness. During the cutting, stamping or forming process of metal strips, if the tool is worn or misaligned, pits may be left on the surface; pit defects will directly affect the appearance and structural integrity of the metal strip and reduce the overall quality of the product. For pit defects, traditional manual detection methods can no longer meet the needs of fast and efficient production. Therefore, the automated detection system can greatly increase the detection speed, reduce labor costs on the production line, and improve overall production efficiency.
[0003] Feng Ming, Liu Yi, et al., An adaptive image enhancement algorithm with improved unsharp masking technology, Journal of Test Technology, Vol. 34, No. 1, 2020. In this paper, an adaptive image enhancement algorithm with improved unsharp masking technology is proposed. The algorithm uses a sine function to adaptively control the weights of different pixels in the neighborhood, so that the flat areas and edge parts of the image are enhanced to different degrees.
[0004] Since the dirt area and the pit defect on the metal strip may show similar grayscale value expression in the metal strip surface image, when the unsharp mask algorithm is used to enhance the image, using the same size of Gaussian blur standard deviation for each pixel in the metal strip surface image may cause the dirt area to be enhanced, which in turn causes the dirt area to be mistakenly detected as a pit defect in the subsequent defect detection process. At the same time, the potential pit defect area may also be over-blurred, causing its detail information to be lost, which will also affect the final accurate detection of the potential pit defect area. Summary of the invention
[0005] In order to solve the technical problem that the existence of noise causes the accuracy of abnormality detection of temperature data using the DBSCAN algorithm to decrease, and abnormal data in the temperature data may be identified as normal data, the present invention provides a metal strip defect detection method and system based on image recognition.
[0006] In a first aspect, the present invention provides a metal strip defect detection method based on image recognition, which adopts the following technical solution:
[0007] A metal strip defect detection method based on image recognition comprises the following steps:
[0008] Collecting a metal strip surface image; obtaining the importance of each pixel in the metal strip surface image; obtaining important pixels based on the importance; obtaining the possibility of a pit at each important pixel:
[0009] ; represents the pit probability of the rth important pixel; Represents the primary pit probability of the rth important pixel; Represents the grayscale change factor of the mth neighborhood direction of the central pixel in the adjacent area of the rth important pixel; Represents the mean value of the grayscale change factor of all neighborhood directions of the central pixel in the vicinity of the rth important pixel; exp() represents an exponential function with a natural constant as the base; norm() represents a normalization function;
[0010] Get the Gaussian blur standard deviation of each important pixel ; Represents the Gaussian blur standard deviation of the rth important pixel; Represents the preset Gaussian blur standard deviation;
[0011] The surface image of the metal strip is enhanced based on the Gaussian blur standard deviation to obtain an enhanced image, and edge detection is performed on the enhanced image to identify pit defect areas.
[0012] The innovation of the present invention lies in the in-depth analysis of the grayscale performance of each pixel and the grayscale values of its neighboring pixels to evaluate the possibility of pits at each pixel, which can significantly improve the pertinence and effect of image processing, and then adaptively obtain the Gaussian blur standard deviation of each pixel according to the possibility of pits at each pixel, so that the Gaussian blur standard deviation of the pixels in the dirt area is larger, the dirt area is smoothed as much as possible, and the Gaussian blur standard deviation of the pit defect area is smaller, retaining its details and reducing false detection caused by similar grayscale features, thereby achieving more accurate image enhancement.
[0013] Preferably, the obtaining of the importance of each pixel in the metal strip surface image includes:
[0014] ;
[0015] In the formula, Represents the importance of the nth pixel; Represents the grayscale mean of all pixels in the metal strip surface image; Represents the gray value of the nth pixel; represents a hyperparameter; Represents the gray value of the kth neighboring pixel of the nth pixel; Represents the number of neighborhood pixels of the nth pixel, and norm() represents the normalization function.
[0016] Pixels with greater importance may be pit defect areas and dirt areas, which are convenient for subsequent analysis.
[0017] Preferably, obtaining important pixel points includes:
[0018] An importance threshold T1 is preset. If the importance of any pixel is greater than or equal to the importance threshold T1, the pixel is recorded as an important pixel, and all important pixels in the metal strip surface image are obtained.
[0019] This facilitates the subsequent analysis of important pixels and distinguishes between pit defect pixels and dirt area pixels.
[0020] Preferably, obtaining the possibility of the primary pit of the important pixel point includes:
[0021] Get the neighboring area of each important pixel;
[0022] ;
[0023] In the formula, Represents the primary pit probability of the rth important pixel; Represents the gray value of the central pixel in the neighborhood of the rth important pixel; Represents the minimum gray value in the vicinity of the rth important pixel; Represents the importance of the central pixel in the neighborhood of the rth important pixel; Represents the importance of the rth important pixel; exp() represents an exponential function with a natural constant as the base.
[0024] This facilitates the subsequent acquisition of the pit possibility of each important pixel point based on the primary pit possibility of each important pixel point.
[0025] Preferably, obtaining the neighboring area of each important pixel includes:
[0026] Based on the importance of each important pixel, region growth is performed on each important pixel to obtain the neighboring region of each important pixel.
[0027] Preferably, the grayscale change factor is obtained by:
[0028] Obtain each neighborhood direction sequence of the central pixel point in the adjacent area of each important pixel point;
[0029] ;
[0030] In the formula, Represents the grayscale change factor of the mth neighborhood direction of the central pixel of the adjacent area of the rth important pixel; norm() represents the normalization function; The gray value of the last pixel in the mth neighborhood direction sequence of the central pixel in the neighborhood of the rth important pixel; Represents the gray value of the central pixel in the neighborhood of the rth important pixel; The number of positive grayscale differences between adjacent pixels in the mth neighborhood direction sequence of the central pixel of the adjacent area of the rth important pixel.
[0031] Preferably, the step of enhancing the surface image of the metal strip based on the Gaussian blur standard deviation to obtain an enhanced image comprises:
[0032] According to the Gaussian blur standard deviation of each important pixel, an unsharp mask algorithm is used to blur each important pixel to obtain a blurred image. The blurred image is subtracted from the metal strip surface image to obtain a detail image. The detail image is added to the metal strip surface image to obtain an enhanced image.
[0033] The dirt area is significantly blurred, and the details of the pit defect area are retained, so the enhanced image is more accurate.
[0034] In a second aspect, the present invention provides a metal strip defect detection system based on image recognition, which adopts the following technical solution:
[0035] The metal strip defect detection system based on image recognition comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the metal strip defect detection method based on image recognition is implemented.
[0036] By adopting the above technical solution, the above-mentioned metal strip defect detection method based on image recognition is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0037] The present invention has the following technical effects: the purpose of the present invention is to analyze the grayscale performance of each pixel and the grayscale values of its neighboring pixels to evaluate the possibility of pits at each pixel, which significantly improves the pertinence and effect of image processing, and then adaptively obtains the Gaussian blur standard deviation of each pixel according to the possibility of pits at each pixel, so that the Gaussian blur standard deviation of the pixels in the dirt area is larger, the dirt area is smoothed as much as possible, and the Gaussian blur standard deviation of the pit defect area is smaller, its details are retained, and false detection caused by similar grayscale features is reduced, thereby achieving more accurate image enhancement. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0039] Figure 1 It is a flow chart of a method for detecting metal strip defects based on image recognition in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0041] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0042] The embodiment of the present invention discloses a metal strip defect detection method based on image recognition, referring to Figure 1 , comprising steps S1 to S3:
[0043] S1: Collecting images of the metal strip surface.
[0044] In an embodiment of the present invention, a high-definition camera is used to vertically shoot a metal strip to obtain an RGB image of the metal strip. Then, in order to facilitate subsequent analysis, the RGB image of the metal strip surface is grayscaled to obtain a metal strip image. In order to facilitate the analysis of the grayscale features of the metal strip surface in the core step of this solution, the DeepLabV3 semantic segmentation model is used to extract the metal strip area in the metal strip image to obtain a metal strip surface image.
[0045] S2: Obtain the importance of each pixel in the metal strip surface image, and based on the importance, obtain important pixels; obtain the primary pit possibility of each important pixel.
[0046] It should be noted that during the processing of metal strips, cutting fluid and lubricant may remain on the surface of the metal strip to form dirt. Dirt is generally a surface attachment and can usually be removed by cleaning or processing. It will not affect the structure or performance of the metal itself. Therefore, it is not considered a permanent defect. However, since the dirt area and the pit defect on the metal strip may show similar grayscale values in the metal strip surface image, when the unsharp mask algorithm is used to enhance the image, the same size of Gaussian blur standard deviation is used for each pixel in the metal strip surface image, which may cause the dirt area to be enhanced, and then the dirt area is mistakenly detected as a pit defect in the subsequent defect detection process. At the same time, the potential pit defect area may be over-blurred, causing its detail information to be lost, which will also affect the final accurate detection of the potential pit defect area. Therefore, when the present invention uses the unsharp mask algorithm to enhance the image, it is necessary to adaptively obtain the Gaussian blur standard deviation of each pixel in the metal strip surface image, so that the dirt area is blurred, and the degree of blurring of the pit defect area is small, thereby retaining its detail information.
[0047] Step S2 includes steps S20 and S21, which are specifically as follows:
[0048] S20: Obtain the importance of each pixel in the metal strip surface image, and obtain important pixels based on the importance.
[0049] It should be noted that the grayscale value performance and grayscale value change characteristics of each pixel point in the metal strip surface image and its surrounding pixels are analyzed to distinguish the pit defect area and the dirt area. It is known that the pit defects in the metal strip surface image usually appear in a regional form, and the grayscale value of the pit area is often lower than the surrounding normal area due to light reflection. Therefore, the potential pit defects on the metal strip surface usually appear in a regional form, and the grayscale value of the potential pit area is often lower than the surrounding normal area due to light reflection. Therefore, if the grayscale value of each pixel point itself is smaller and the grayscale difference between each pixel point and the pixels in its eight neighborhoods is more obvious, it can be said that this pixel point is more likely to belong to the pit defect area, and this pixel point should be paid more attention. Therefore, according to this feature, the importance of each pixel point is obtained, so that the pixels with greater importance can be screened out for subsequent analysis.
[0050] In an embodiment of the present invention, the importance of each pixel in the metal strip surface image is obtained:
[0051] ;
[0052] In the formula, Represents the importance of the nth pixel; Represents the grayscale mean of all pixels in the metal strip surface image; Represents the gray value of the nth pixel; represents a hyperparameter; The smaller the value of is, the more likely the nth pixel is to belong to the pit defect area; Represents the gray value of the kth neighboring pixel of the nth pixel; represents the number of neighboring pixels of the n-th pixel, where the neighboring pixels represent the eight neighboring pixels of the n-th pixel; It represents the sum of the grayscale value differences between the nth pixel and its eight neighboring pixels. The larger the value, the more obvious the grayscale difference between the pixel and its eight neighboring pixels. This means that the smaller the grayscale value of the pixel in the image, the greater its credibility. It also means that the pixel is more likely to belong to the pit defect area, the more attention should be paid to the pixel, and the greater its corresponding importance.
[0053] In an embodiment of the present invention, an importance threshold T1 is preset. If the importance of any pixel is greater than or equal to the importance threshold T1, the pixel is recorded as an important pixel, otherwise it is a normal pixel. At this point, all important pixels in the surface image of the metal strip are obtained, and the importance threshold T1 is preset to 0.7. In other embodiments, the implementer can preset the importance threshold according to the specific implementation method.
[0054] S21: Obtain the primary pit possibility of each important pixel.
[0055] It should be noted that through the analysis of the above steps, the important pixels and their importance in the metal strip surface image are obtained. However, since the pixels in the dirt area will show a gray value that is relatively consistent with the pixels in the pit defect area, it is not possible to judge whether it belongs to the pit defect area based on the importance of the pixels alone. Since the randomness of the cause of dirt formation is very large, there will be uncertainty in the emission of light in the dirt area. The gray value distribution of the pixels in the dirt area is relatively messy, while the central area of the pit defect area on the surface of the metal strip generally has a lower gray value. This is because the surface depression causes light dispersion, thus presenting a darker grayscale; therefore, in this step, firstly, regional growth is performed for each important pixel to obtain its adjacent area, and the relative size of the gray value of the central pixel of the adjacent area to which this important pixel belongs in this area is analyzed to obtain the primary pit possibility of this important pixel. If the relative size of the gray value of the central pixel of the adjacent area of this important pixel in this area is smaller, it means that the adjacent area of this important pixel is more likely to be a pit defect area, and the important pixel is more likely to belong to the pit defect area, and its primary pit possibility is greater.
[0056] In the embodiment of the present invention, region growing is performed on each important pixel based on the importance of each important pixel to obtain the adjacent region of each important pixel, and the centroid of the adjacent region of each important pixel is obtained as the central pixel of the adjacent region of each important pixel. It should be noted that region growing is a prior art and will not be described in detail in the embodiment of the present invention.
[0057] Get the primary pit probability for each important pixel:
[0058] ;
[0059] In the formula, Represents the primary pit probability of the rth important pixel; Represents the gray value of the central pixel in the neighborhood of the rth important pixel; Represents the minimum gray value in the vicinity of the rth important pixel; Represents the importance of the central pixel in the neighborhood of the rth important pixel; Represents the importance of the rth important pixel; exp() represents an exponential function with a natural constant as the base; The larger the value of , the more likely the rth important pixel point is to belong to the pit defect area, and the greater the possibility of its primary pit; The ratio of the grayscale value of the central pixel in the vicinity of the r-th important pixel to the minimum grayscale value in the vicinity of the r-th important pixel represents the relative size of the grayscale value of the central pixel in the vicinity of the r-th important pixel. The smaller the value is, the smaller the relative size of the grayscale value of the central pixel in the vicinity of the r-th important pixel is. This means that the more the grayscale performance of the central pixel in the vicinity of the r-th important pixel is consistent with the grayscale performance of the central pixel in the pit defect area, the more likely the area is to be a pit defect area, the more likely the r-th important pixel is to belong to the pit defect area, and the greater the possibility of a primary pit.
[0060] S3: Correct the initial pit possibility of each important pixel according to the grayscale change factor of each neighborhood direction of the central pixel in the adjacent area of each important pixel to obtain the pit possibility of each important pixel; obtain the Gaussian blur standard deviation of each important pixel according to the pit possibility of each important pixel, and then use the unsharp mask algorithm to blur each important pixel to obtain an enhanced image, and detect the pit defect area according to the enhanced image.
[0061] Step S3 includes steps S30 and S31, which are specifically as follows:
[0062] S30: Obtain the grayscale change factor of each neighborhood direction of the central pixel of the adjacent area of each important pixel, correct the initial pit possibility of each important pixel according to the grayscale change factor of each neighborhood direction, and obtain the pit possibility of each important pixel.
[0063] It should be noted that the primary pit possibility of each important pixel is obtained. The analysis of this index is based on the relative size of the grayscale value of the central pixel in the adjacent area of the important pixel. However, if the grayscale value of the central pixel in the dirt area happens to belong to a part of the pixels with lower grayscale values in the dirt area, the primary pit possibility obtained in the above steps cannot distinguish the dirt area from the pit defect area well. In addition, the grayscale value at the edge of the pit defect area on the surface of the metal strip is usually higher. It may be that the surface reflects light more strongly at the edge, making the grayscale value of the edge relatively bright. In addition, the grayscale value from the center to the edge of the pit defect area on the surface of the metal strip will gradually increase to form a gradual transition area. This feature is not available in the randomly generated dirt area. Because the grayscale change characteristics in the adjacent area of each important pixel are analyzed, the primary pit possibility of each important pixel is optimized to obtain the pit possibility of each important pixel.
[0064] When analyzing the possibility of pits for each important pixel, it is necessary to obtain the pixel grayscale values in the eight neighborhood directions of the central pixel of the neighboring area of each important pixel, constitute each neighborhood direction sequence of the central pixel of the neighboring area of each important pixel, and analyze the grayscale change characteristics in each neighborhood direction sequence. If the grayscale change characteristics in each neighborhood direction are more similar, it means that the neighboring area of this important pixel is more likely to be a pit defect area, and this important pixel is more likely to belong to the pit defect area.
[0065] In the embodiment of the present invention, the grayscale values of the pixels in each neighborhood direction of the central pixel of the neighborhood of each important pixel are obtained in sequence to form a sequence of each neighborhood direction of the central pixel of the neighborhood of each important pixel. It should be noted that the central pixel has eight neighborhood directions in total.
[0066] Get the grayscale change factor of each neighborhood direction of the central pixel in the adjacent area of each important pixel:
[0067] ;
[0068] In the formula, Represents the grayscale change factor of the mth neighborhood direction of the central pixel of the adjacent area of the rth important pixel; norm() represents the normalization function; The gray value of the last pixel in the mth neighborhood direction sequence of the central pixel in the neighborhood of the rth important pixel; Represents the gray value of the central pixel in the neighborhood of the rth important pixel; The number of positive grayscale differences between adjacent pixels in the mth neighborhood direction sequence of the central pixel of the adjacent area of the rth important pixel. It should be noted that the grayscale difference between adjacent pixels is obtained by subtracting the grayscale value of the next pixel from the grayscale value of the previous pixel in the sequence; The larger the value is, the greater the increase in the grayscale change of the central pixel in the neighborhood of the rth important pixel in this neighborhood direction is, indicating that the neighborhood is more likely to be a pit defect area, and the grayscale change factor of the central pixel in the neighborhood of the rth important pixel in the mth neighborhood direction is greater; The smaller the value is, the more uniform the grayscale change in the mth neighborhood direction sequence of the central pixel point in the adjacent area of the rth important pixel point is, which means that the grayscale change in this neighborhood direction is more consistent with the change characteristics of the pit defect area, and the larger the grayscale change factor in the mth neighborhood direction of the central pixel point in the adjacent area of the rth important pixel point is.
[0069] Get the pit probability for each important pixel:
[0070] ;
[0071] In the formula, represents the pit probability of the rth important pixel; Represents the primary pit probability of the rth important pixel; Represents the grayscale change factor of the mth neighborhood direction of the central pixel in the adjacent area of the rth important pixel; Represents the mean value of the grayscale change factor of all neighborhood directions of the central pixel of the adjacent area of the rth important pixel; exp() represents an exponential function with a natural constant as the base; The similarity of the grayscale change characteristics of the central pixel in the adjacent area of the r-th important pixel in each neighborhood direction, the smaller the value, the more similar the grayscale change characteristics of the central pixel in the adjacent area of the r-th important pixel in each neighborhood direction, and the greater the possibility of the pit of the r-th important pixel; The larger the value is, the greater the possibility of a pit at the rth important pixel.
[0072] S31: According to the possibility of pits at each important pixel, the Gaussian blur standard deviation of each important pixel is obtained, and according to the Gaussian blur standard deviation of each important pixel, each important pixel is blurred using an unsharp mask algorithm to obtain an enhanced image, and the pit defect area is detected according to the enhanced image.
[0073] It should be noted that the pit possibility of each important pixel is obtained. This step requires the Gaussian blur standard deviation of each important pixel based on this indicator, which is used to subsequently enhance the important pixels according to the unsharp mask algorithm. The greater the pit possibility of any important pixel, the more likely it is that the important pixel belongs to the pit defect area. In order to more completely and smoothly detect the important pixel as a pit defect area in the subsequent edge detection process, the Gaussian blur standard deviation of the important pixel should be smaller, thereby retaining more detail information.
[0074] In this embodiment of the present invention, the Gaussian blur standard deviation of each important pixel is obtained:
[0075] ;
[0076] In the formula, Represents the Gaussian blur standard deviation of the rth important pixel; represents the pit probability of the rth important pixel; represents a preset Gaussian blur standard deviation; in the embodiment of the present invention, the preset Gaussian blur standard deviation In other embodiments, implementers may preset the value of the Gaussian blur standard deviation according to the specific implementation method.
[0077] According to the Gaussian blur standard deviation of each important pixel, the unsharp mask algorithm is used to blur each important pixel to obtain a blurred image. The blurred image is subtracted from the metal strip surface image to obtain a detail image. The detail image is added to the metal strip surface image to obtain an enhanced image. The canny edge detection algorithm is used to detect the enhanced image to identify the pit defect area.
[0078] An embodiment of the present invention also discloses a metal strip defect detection system based on image recognition, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a metal strip defect detection method based on image recognition according to the present invention is implemented.
[0079] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0080] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, an enhanced dynamic random access memory, a high bandwidth memory, a hybrid storage cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device.
[0081] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0082] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A metal strip defect detection method based on image recognition, characterized in that: Includes steps: Collecting a metal strip surface image; obtaining the importance of each pixel in the metal strip surface image; obtaining important pixels based on the importance; obtaining the possibility of a pit at each important pixel: ; represents the pit probability of the rth important pixel; Represents the primary pit probability of the rth important pixel; Represents the grayscale change factor of the mth neighborhood direction of the central pixel in the adjacent area of the rth important pixel; Represents the mean value of the grayscale change factor of all neighborhood directions of the central pixel in the vicinity of the rth important pixel; exp() represents an exponential function with a natural constant as the base; norm() represents a normalization function; Get the Gaussian blur standard deviation of each important pixel ; Represents the Gaussian blur standard deviation of the rth important pixel; Represents the preset Gaussian blur standard deviation; The surface image of the metal strip is enhanced based on the Gaussian blur standard deviation to obtain an enhanced image, and edge detection is performed on the enhanced image to identify pit defect areas.
2. The metal strip defect detection method based on image recognition according to claim 1 is characterized in that: The step of obtaining the importance of each pixel in the metal strip surface image includes: ; In the formula, Represents the importance of the nth pixel; Represents the grayscale mean of all pixels in the metal strip surface image; Represents the gray value of the nth pixel; represents a hyperparameter; Represents the gray value of the kth neighboring pixel of the nth pixel; Represents the number of neighborhood pixels of the nth pixel, and norm() represents the normalization function.
3. The metal strip defect detection method based on image recognition according to claim 1, characterized in that: The obtaining of important pixel points includes: An importance threshold T1 is preset. If the importance of any pixel is greater than or equal to the importance threshold T1, the pixel is recorded as an important pixel, and all important pixels in the metal strip surface image are obtained.
4. The metal strip defect detection method based on image recognition according to claim 1, characterized in that: The acquisition of the primary pit possibility of the important pixel point includes: Get the neighboring area of each important pixel; ; In the formula, Represents the primary pit probability of the rth important pixel; Represents the gray value of the central pixel in the neighborhood of the rth important pixel; Represents the minimum gray value in the vicinity of the rth important pixel; Represents the importance of the central pixel in the neighborhood of the rth important pixel; Represents the importance of the rth important pixel; exp() represents an exponential function with a natural constant as the base.
5. The metal strip defect detection method based on image recognition according to claim 4 is characterized in that: The obtaining of the neighboring area of each important pixel includes: Based on the importance of each important pixel, region growth is performed on each important pixel to obtain the neighboring region of each important pixel.
6. The metal strip defect detection method based on image recognition according to claim 1, characterized in that: The acquisition of the grayscale change factor includes: Obtain each neighborhood direction sequence of the central pixel point in the adjacent area of each important pixel point; ; In the formula, Represents the grayscale change factor of the mth neighborhood direction of the central pixel of the adjacent area of the rth important pixel; norm() represents the normalization function; The gray value of the last pixel in the mth neighborhood direction sequence of the central pixel in the neighborhood of the rth important pixel; Represents the gray value of the central pixel in the neighborhood of the rth important pixel; The number of positive grayscale differences between adjacent pixels in the mth neighborhood direction sequence of the central pixel of the adjacent area of the rth important pixel.
7. The metal strip defect detection method based on image recognition according to claim 1, characterized in that: The step of enhancing the surface image of the metal strip based on the Gaussian blur standard deviation to obtain an enhanced image includes: According to the Gaussian blur standard deviation of each important pixel, an unsharp mask algorithm is used to blur each important pixel to obtain a blurred image. The blurred image is subtracted from the metal strip surface image to obtain a detail image. The detail image is added to the metal strip surface image to obtain an enhanced image.
8. A metal strip defect detection system based on image recognition, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the metal strip defect detection method based on image recognition according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Illuminator accessory defect detection method based on machine vision
CN116363133A
Anti-seismic structure steel frame welding seam quality detection method based on machine vision
CN116433669A