Steel belt defect detection method, equipment and medium
By using double-sided image acquisition and multi-resolution fusion technology to process surface defects of steel strips, image quality issues and metal reflection interference in low-light environments are resolved, achieving high-precision and efficient defect detection and meeting the real-time requirements of industrial production lines.
Patent Information
- Application Number
- CN202510913263.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-10
AI Technical Summary
Existing methods for detecting surface defects in steel strips suffer from poor image quality and severe metal reflection interference in low-light environments, resulting in low detection accuracy, high false detection and missed detection rates, and difficulty meeting the real-time requirements of industrial production lines.
A double-sided image acquisition system is used to obtain the front and back images of the steel strip. The images are processed through inversion operation and image enhancement technology, combined with multi-resolution fusion and multi-dimensional feature judgment, including image enhancement, multi-resolution fusion, connected domain analysis, dynamic adjustment of illumination correction coefficient, and weighted fusion of Gaussian pyramid and Laplace pyramid, combined with multiple parameters to determine the defect type.
It improves image quality in low-light environments, suppresses metal reflection interference, improves defect detection accuracy and efficiency, meets the real-time requirements of industrial production lines, and reduces false detection and missed detection rates.
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial visual inspection, in particular to a steel strip defect detection method, device and medium. BACKGROUND
[0002] In the field of industrial manufacturing, steel strip surface defect detection is a key link to ensure product quality. Traditional detection methods mainly rely on stylus roughness meters or manual visual inspection, which have inherent defects such as low detection efficiency, strong subjectivity, and inability to achieve online detection. With the development of machine vision technology, image-based surface defect detection methods have gradually become the mainstream technology route, but in actual industrial applications, there are still significant technical bottlenecks: first, the image quality problem in low-illumination environment is particularly prominent. Due to the limited arrangement of light sources in industrial workshops or equipment obstruction, the collected steel strip surface images generally have uneven brightness distribution, low local contrast, and blurred microscopic details. Second, the unique optical properties of metal materials cause serious interference of highlight stripes and light spots. The overexposed areas on the surface of steel due to the reflection effect completely cover the real defect features. Third, existing detection algorithms mostly use single feature threshold judgment mechanism, relying only on simple features such as area or gray mean value for defect recognition, resulting in high false detection rate and high miss detection rate. In addition, the detection real-time requirement of industrial production lines is extremely strict, and conventional detection systems are difficult to complete complex calculations under the time constraint of 0.2 seconds / frame. Specifically, traditional bilateral filtering and other high-quality noise reduction algorithms have exponential growth in computational complexity; multi-scale pyramid fusion methods have system bottlenecks such as excessive memory occupation and difficulty in data parallelization; and deep learning models face deployment difficulties such as large number of parameters and the need for special hardware acceleration. These technical defects seriously restrict the improvement of the precision and efficiency of steel strip surface defect detection. Therefore, the existing technology needs to be improved. SUMMARY
[0003] The present application aims to provide a steel strip defect detection method, electronic device and computer readable storage medium, which has the advantages of improving image quality in low-illumination environment, suppressing metal reflection interference, and improving defect detection precision and efficiency.
[0004] To achieve the above-mentioned purpose, the present application provides the following technical solutions: A steel strip defect detection method, comprising the following steps: S100, acquiring original images of the front and back of the steel strip, performing a reverse operation on the original images to obtain reverse images, performing image enhancement on the original images and the reverse images to obtain original enhanced images and reverse enhanced images, and performing a reverse operation on the reverse enhanced images to obtain reverse enhanced restored images; S200, calculating the weight maps of the original images, the original enhanced images and the reverse enhanced restored images respectively, and performing fusion according to a multi-resolution fusion method to obtain a fused image; S300, extracting connected domains from the fused image, and determining whether there are scratches or holes on the surface of the steel strip based on the area, aspect ratio, density, and edge strength of the connected domains.
[0005] The present invention further provides that the image enhancement processing in step S100 includes: S100-1, decomposing the original image and the inverted image into an illumination map and a reflectance map, and estimating the illumination map using a guided filtering algorithm; S100-2. Perform illumination correction on the illuminance map. The correction coefficient γ is adaptively calculated based on the brightness of the current illuminance map, so that the average brightness of the corrected reflection map approaches the target value.
[0006] The present invention further provides that, in the guided filtering algorithm: a linear relationship is established within a local filtering window, and filtering parameters are solved by minimizing the difference between the input image and the linear output and constraining the coefficient amplitude; The filter window size is dynamically adjusted according to the surface texture granularity of the steel strip.
[0007] The present invention further provides that the weight map is calculated through the following features: contrast: reflects local grayscale differences and is used to enhance defect edges; saturation: identifies oxidized or contaminated areas based on the HSV color space; good exposure: suppresses the weight of overexposed / underexposed areas; the influencing factors of the three are set to equal weights by default.
[0008] The present invention further provides that the multi-resolution fusion method includes: constructing a Gaussian pyramid and a Laplacian pyramid for each image; At each resolution layer, the Gaussian layer and Laplacian layer are weightedly fused according to the weight map; reconstruction is performed layer by layer from top to bottom: the fused Gaussian layer is upsampled, and the fused Laplacian layer of the same layer is superimposed to iteratively generate the final fused image.
[0009] The present invention further provides that the defect determination is specifically as follows: Gaussian denoising and Otsu binarization segmentation are performed on the fused image; candidate regions are extracted using 8-neighborhood connected domain labeling; and a defect is determined if any of the following conditions is met: (a) area > 20 pixels and aspect ratio > 4, marked as a steel strip scratch defect; (b) tightness > 0.7, marked as a steel strip hole defect; (c) edge strength > 30, marked as a significant defect.
[0010] The present invention also provides an electronic device, comprising: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to run the steel strip defect detection method.
[0011] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method are implemented.
[0012] Beneficial effects of the present invention: The present application provides a steel strip defect detection method, electronic device and computer-readable storage medium, which optimize image quality through inversion enhancement and multi-resolution fusion technology, and combine multi-dimensional defect judgment standards to effectively solve the problems of low-light imaging defects and metal reflection interference, and have the advantages of improving detection accuracy, reducing false detection and missed detection rates, and meeting industrial real-time requirements. DETAILED DESCRIPTION
[0013] The following will explain in detail the implementation methods of the present application with the help of examples, so that the implementation process of how the present application applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. In the prior art, surface defect detection of steel strips mainly relies on stylus roughness meters or manual visual inspections, which have the problems of low efficiency and strong subjectivity. With the application of machine vision technology, image-based detection methods have gradually become popular, but they still face many challenges in actual industrial environments. For example, on a continuous production line for steel strips, due to limited light source arrangement or equipment obstruction, the collected images often have uneven brightness and low contrast, and the bright stripes and light spots caused by reflections on the metal surface will cover up the real defects. When processing images under such complex lighting conditions, existing methods often suffer from a decrease in detection accuracy due to blurred details or interference from overexposed areas. At the same time, traditional algorithms are difficult to meet the production line's requirements for detection speed in terms of real-time performance.
[0014] To address these issues, we need to develop a method that can effectively handle complex lighting conditions and improve inspection efficiency. Given that a single image processing approach struggles to fully capture defect characteristics, we sought to integrate the strengths of different processing stages through a multi-image fusion strategy. To address detail loss in low-light areas, we explored a technical approach combining inversion with image enhancement. To address overexposure in bright areas, we investigated the potential of inversion restoration and multi-resolution fusion. By analyzing the complementary features of different image processing stages, we ultimately developed a defect detection framework based on multi-image fusion.
[0015] Therefore, the present application proposes to obtain original images of the front and back sides of the steel strip, invert the original image to obtain an inverted image, perform image enhancement on the original image and the inverted image to obtain an original enhanced image and an inverted enhanced image, and invert the inverted enhanced image to obtain an inverted enhanced restored image; calculate the weight maps of the original image, the original enhanced image, and the inverted enhanced restored image respectively, and fuse them according to a multi-resolution fusion method to obtain a fused image; extract the connected domain from the fused image, and analyze whether there are defects based on the area and shape of the connected domain.
[0016] Among them, the inversion operation refers to the inversion of the image pixel values, which can be specifically implemented through the mathematical formula I'=1-I, where I is the original image and I' is the inverted image. This operation can enhance the visibility of dark areas. Image enhancement refers to improving the visual effect by adjusting the image contrast and brightness. Specifically, it can be implemented by using the illumination map decomposition and illumination correction algorithm. This process can effectively compensate for the impact of uneven illumination. The multi-resolution fusion method refers to integrating image features in different scale spaces. Specifically, it can be implemented by combining the Gaussian pyramid and the Laplacian pyramid. This method can retain detailed information at different resolutions. Connected domain analysis refers to feature extraction of interconnected pixel areas in a binary image. Specifically, it can be implemented using the 8-neighborhood connected component labeling algorithm. This technology can accurately identify the morphological characteristics of potential defect areas.
[0017] Specifically, the dual-sided image acquisition system first synchronously acquires raw image data from both the front and back sides of the steel strip. The original image is then inverted to generate an inverted image. Both sets of images are then enhanced using illumination decomposition to generate the original enhanced image and the inverted enhanced image. The inverted enhanced image is then inverted again and fed into the fusion system along with the original and enhanced images. A weighted fusion map is constructed for each image, performed at multiple resolution levels, and ultimately a fused image containing complete detail information is synthesized. Based on this fusion result, morphological analysis is used to extract connected regions, and the defect type is determined by combining area thresholds and shape parameters.
[0018] Compared with existing technologies, traditional methods typically only perform defect detection on a single processed image, making it difficult to take into account feature information under different lighting conditions. This solution effectively integrates the characteristic advantages of the original image, enhanced image, and inverted image through a multi-image fusion strategy, overcoming the problem of incomplete information in a single image. Compared with traditional single-scale analysis methods, multi-resolution fusion methods can preserve detailed features while reducing computational complexity, making them more adaptable to the real-time requirements of industrial inspection. In addition, the collaborative processing mechanism of double-sided images can avoid defect omissions caused by single-view inspection.
[0019] Through the above technical solutions, this application can effectively improve defect detection accuracy under complex lighting conditions and reduce false detections and missed detections caused by uneven lighting. While ensuring detection accuracy, the multi-resolution fusion method reduces computing resource consumption through a layered processing mechanism, meeting the production line's requirements for real-time detection. The dual-sided image collaborative processing mechanism fully captures the three-dimensional defect characteristics of the steel strip surface, improving the reliability of the detection system.
[0020] Based on the above content, a defect detection method for steel strip is proposed, which includes the following steps: obtaining original images of the front and back of the steel strip, inverting the original images to obtain inverted images, performing image enhancement on the original images and the inverted images to obtain original enhanced images and inverted enhanced restored images; wherein the calculation formula of the original image and the inverted image is I'=1-I, I is the original image, and I' is the inverted image; when performing image enhancement on the original image and the inverted image, the following steps are included: decomposing the original image and the inverted image into an illumination map and a reflection map, that is, , by estimating L and calculating R using the formula, L is calculated by filtering the image when estimating L; after obtaining L, it is subjected to illumination correction, the formula is as follows: ; In the above formula is the correction coefficient, L is the filtered illumination map, where Adaptive calculation is performed based on the current brightness of the illumination map, and the formula is: Where, is the i-th pixel in the original image, is the i-th pixel in the image that needs to be corrected.
[0021] The inversion operation refers to reversing the pixel values of the original image. This can be achieved by taking the complement of the grayscale value of each pixel. For example, in an 8-bit grayscale image, the pixel value x becomes 255-x after inversion. Decomposing an image into an illuminance map and a reflectance map refers to separating the illumination component of the image from the reflectance component. Specifically, a filtering-based method can be used to estimate the illuminance component L, and the reflectance component R is calculated by the ratio of the original image to L. The correction coefficient in illumination correction refers to the parameter used to adjust the illuminance component. Specifically, it can be dynamically adjusted based on the local brightness difference between the original image and the filtered illuminance map. For example, adaptive optimization is achieved by calculating the ratio of the original image pixel to the corresponding illuminance map pixel.
[0022] Specifically, in the image enhancement process, an inverted image is first generated through an inversion operation, so that the originally overexposed highlight areas become dark areas after inversion, making it easier to extract details in the subsequent enhancement steps. The original image and the inverted image are then decomposed into an illuminance map and a reflection map, respectively. The illuminance map is estimated by a filtering algorithm, and the reflection map is calculated by the ratio of the original image to the illuminance map. In the illumination correction stage, the correction coefficient is dynamically adjusted according to the local brightness difference between the original image and the illuminance map. For example, when the brightness of a certain area of the original image is significantly higher than that of the illuminance map, the intensity of the illuminance component of the area is reduced to suppress overexposure. Through the above steps, the uneven illumination problem in the original image and the inverted image is targeted, providing clearer input data for subsequent fusion and defect detection.
[0023] Compared with the prior art, the traditional method usually adopts fixed parameters for illumination correction, which is difficult to adapt to the local brightness mutation of the steel strip surface caused by reflection or shielding. The scheme can adaptively adjust the illumination component according to the brightness distribution of different regions of the image by dynamically calculating the correction coefficient, for example, reducing the illumination intensity in the overexposed area to restore the details, and enhancing the light in the low brightness area to improve the contrast. In addition, the bidirectional processing of the inverse image and the original image can effectively cover the detection needs of the high light and dark area defects.
[0024] Through the above technical scheme, the application can solve the problem of image detail loss caused by reflection or low illumination on the surface of the steel strip, for example, converting the overexposed area into a processable dark area through the inverse operation in the metal highlight area, and then combining with the adaptive illumination correction to restore the hidden defect features. At the same time, the dynamically adjusted correction coefficient avoids the lack of adaptability of the traditional fixed parameter method in complex lighting environment, and improves the accuracy and robustness of defect detection.
[0025] The application further proposes the following formula when filtering the illumination map: , wherein: is a filter window centered on k; is a pixel point in is the i-th pixel point of the output image; is the i-th pixel point of the guide image; , is the linear coefficient of the linear function, and then a minimum constraint function is established: , is the i-th pixel point of the input image; is a regularization coefficient, fixed as 0.1, wherein , solves using the least square method, and the following can be obtained: , wherein: is the number of pixel points in the filter window is the k-th filter window of the input image; , are the average values of the pixels in the filter window of the guide image I and the input image p, respectively; is the variance of the guide image I in the filter window , wherein the guide image I is the input image p.
[0026] Among them, the filter window refers to the local area set with the pixel point k as the center, which can be implemented by a rectangular or circular neighborhood structure to limit the range of pixels participating in the filtering calculation. The linear coefficient refers to the parameter used to adjust the relationship between the input image and the guide image. It can be obtained by least squares optimization and is used to establish a mapping relationship between the input image and the guide image. The minimization constraint function refers to an optimization objective function that combines the difference between the input image and the guide image and the linear coefficient regularization term. Specifically, the filter smoothness and detail retention ability can be balanced by adjusting the regularization coefficient. The guide image refers to a reference image used to guide the filtering process. Specifically, the input image itself can be used as the guide image to ensure that the filtering process retains the structural characteristics of the original image.
[0027] Specifically, the filtering process decomposes the input image into a combination of a guide image and linear coefficients by setting a linear relationship within a local window. By minimizing the difference between the input image and the linear combination while constraining the magnitude of the linear coefficients, noise can be effectively suppressed while preserving edge details. During the solution process, the linear coefficients are optimized using the least squares method, so that the filtered illumination map can both eliminate uneven lighting and avoid texture loss caused by oversmoothing. The consistency of the guide image with the input image further ensures that the filtering process does not introduce artifacts or structural distortion.
[0028] Compared with existing technologies, traditional filtering methods such as bilateral filtering or Gaussian filtering rely solely on fixed kernel functions for smoothing, making it difficult to strike a balance between noise suppression and detail preservation. This solution, by introducing a guide image and adaptive linear coefficients, establishes an optimization model based on local statistical characteristics, capable of dynamically adjusting the filtering intensity under varying lighting conditions. Compared to traditional methods, this solution effectively eliminates illumination interference in highlight areas while preserving detailed features such as tiny scratches on metal surfaces. Its computational complexity is also low, making it suitable for real-time processing in industrial scenarios.
[0029] Through the above technical solution, this application can achieve adaptive illumination correction for the uneven brightness problem present in steel strip surface images. By optimizing the linear coefficient during the filtering process, the interference of light spots in overexposed areas is suppressed while retaining defect details in low-light areas, providing a high-quality image foundation for subsequent multi-resolution fusion and defect detection. This method can still stably extract effective features in complex lighting environments, reducing the risk of false detection and missed detection due to poor image quality, while meeting the production line's requirements for real-time processing efficiency.
[0030] The present application further proposes that the weight map is calculated in step S200 according to the following formula: ; Among them: subscript represents the pixel (i, j) in the k-th image, respectively, are the impact factors of contrast C, saturation S, and good exposure E in the weight map, and the values of all are defaulted to 1.
[0031] Among them, the contrast refers to the difference between light and dark in the local area of the image, which can be realized by calculating the standard deviation of the pixel neighborhood, and is used to represent the distinction between defects and background. The saturation refers to the quantitative index of color purity, which can be extracted by the S channel value in the HSV color space, and is used to identify color deviation areas caused by oxidation or pollution. The good exposure refers to the measure of pixel brightness in the preset reasonable range, which can be calculated by a piecewise linear function to punish overexposed or underexposed areas, and is used to suppress the influence of high light interference on defect judgment. The impact factor refers to the relative importance parameter of each feature in weight calculation, which can be set by empirical value or adaptive adjustment algorithm, and is used to balance the contribution proportion of different features to the final fusion effect.
[0032] Specifically, in the steel strip surface image processing process, the contrast, saturation and exposure features of the original image, the original enhanced image and the inverse enhanced restored image are calculated in parallel, and the three feature maps are superimposed according to the preset weight to generate the weight map of each input image. The contrast feature calculates the local standard deviation through a sliding window to enhance the saliency of defect edges; the saturation feature directly extracts the S component in the HSV color space to highlight the color anomaly of oxidation patches; the exposure feature uses a piecewise function to map the 0-255 grayscale range nonlinearly to suppress the interference of overexposed areas on defect detection. The impact factors of the three features are defaulted to equal weight, which can be dynamically optimized through the parameter adjustment module according to the actual detection environment.
[0033] Compared with the prior art, the traditional method usually only uses a single feature (such as contrast) to construct a weight map, resulting in that the overexposure information in the high light area is not effectively suppressed, and color abnormal defects are easily missed. The present scheme balances the illumination robustness and color sensitivity while maintaining the calculation efficiency through the multi-dimensional feature fusion mechanism, overcoming the dual problems of high light interference and color missing in metal surface detection.
[0034] Through the above technical scheme, the present application effectively solves the feature extraction deviation problem caused by uneven illumination in steel strip surface defect detection, enhances the saliency expression of defect areas through the multi-feature weighted fusion mechanism, and realizes more stable defect recognition effect under complex illumination conditions in industrial field, while maintaining the lightweight characteristics of the weight calculation process to meet the real-time requirements of the production line.
[0035] The present application further proposes a multi-resolution fusion method to fuse and obtain a fused image as follows: constructing a Gaussian pyramid and a Laplacian pyramid based on the original image, the original enhanced image and the inverse enhanced restored image, performing fusion at each resolution, and performing the fusion on the Gaussian pyramid layers of the original image, the original enhanced image and the inverse enhanced restored image. , perform weighted fusion according to the weight map, and the fusion formula is: Where, The Gaussian pyramid layer after the lth layer fusion; The weight map of the k-th image at layer l; The l-th level Gaussian pyramid of the k-th image; At the same time, the Laplacian pyramid layer of the original image, the original enhanced image and the inverse enhanced restored image , perform weighted fusion according to the weight map, and the fusion formula is: Where, The Laplacian pyramid layer after the lth layer fusion; The weight map of the k-th image at layer l; The lth Laplacian pyramid layer of the kth image; Then the pyramid is reconstructed layer by layer in the order of top layer to bottom layer: From the topmost Gaussian pyramid layer First, the Laplace pyramid layers are Add it to the upsampled Gaussian pyramid layer to reconstruct a higher resolution image: + Where Upsample(⋅) is the upsampling operation that restores the low-resolution image to high resolution. : The reconstructed l-1th level Gaussian pyramid.
[0036] Among them, the Gaussian pyramid refers to an image sequence generated by layer-by-layer downsampling, which can be implemented by alternate row and column sampling, and is used to represent the low-frequency information of the image at different resolutions. The Laplacian pyramid refers to an image sequence generated by the difference between adjacent layers of the Gaussian pyramid, which can be implemented by difference calculation, and is used to retain high-frequency detail information. The weight map refers to a matrix that reflects the contribution of different images in the fusion process, which can be calculated and generated using contrast, saturation, and exposure indicators, and is used to guide the fusion ratio at each resolution layer. Layer-by-layer reconstruction refers to the process of gradually restoring the image resolution from the top layer of the pyramid to the bottom layer, which can be implemented by upsampling and superimposing Laplacian layers, and is used to synthesize the final high-quality fused image.
[0037] Specifically, this method constructs Gaussian and Laplacian pyramids to represent multi-source images in layers, independently performing weighted fusion operations at each resolution level. For example, for the Gaussian pyramid layer, the low-frequency components of the corresponding layers of each input image are linearly combined according to the weight coefficients; for the Laplacian pyramid layer, the same operation is performed on the high-frequency detail components of each image. During the reconstruction phase, a top-down iterative approach is used to superimpose the fused low-frequency basis layer by layer with the high-frequency details, ultimately generating a fused image with complete spectral information. This layered processing mechanism allows the advantageous features of different images to be effectively integrated at multiple scales, while avoiding the detail loss that may result from a single global fusion.
[0038] Compared with existing technologies, traditional multi-scale fusion methods usually require the complete storage of pyramid data at all levels, resulting in excessive memory usage and difficulty in parallel processing. However, this method uses a hierarchical independent fusion strategy to decouple the processing of Gaussian and Laplacian layers. For example, in hardware implementation, the computational tasks of different resolution layers can be assigned to multiple processing units for simultaneous execution. In addition, existing technologies often require the simultaneous loading of all pyramid layer data during image reconstruction, while this method uses a layer-by-layer recursive reconstruction method, retaining only the intermediate results of the current processing layer and the previous layer, significantly reducing the memory access bandwidth requirements.
[0039] Through the above-mentioned technical solution, this application effectively solves the contradiction between real-time performance and resource consumption in multi-source image fusion in industrial inspection scenarios. For example, in a steel strip surface inspection system, this method can achieve rapid fusion processing of three input images with limited computing resources while maintaining the integrity of defect features. Through hierarchical fusion and recursive reconstruction mechanisms, it avoids the memory bottleneck of traditional pyramid methods while ensuring the ability of the fused image to restore details at multiple scales, providing a high-quality input data foundation for subsequent defect identification.
[0040] This application further proposes a steel strip defect detection method, which specifically includes Gaussian denoising of the fused image, binary segmentation using the Otsu algorithm to extract the foreground, extracting the defect area through the 8-neighborhood connected domain labeling algorithm, and defect judgment based on area, aspect ratio, compactness and edge strength parameters. When the area is greater than 20 pixels and the aspect ratio exceeds 4, it is judged as a scratch defect; when the compactness exceeds 0.7, it is judged as a hole defect; when the edge strength exceeds 30, it is judged to be a defect. If any condition is met, it is marked as a defect.
[0041] The Gaussian denoising refers to smoothing the image by using a Gaussian filter to eliminate noise interference, and can be realized by convolution operation of a two-dimensional Gaussian kernel and the image. The step can effectively suppress high-frequency noise and retain edge information. The Otsu algorithm refers to an adaptive threshold segmentation method based on maximum inter-class variance, which can automatically determine the optimal segmentation threshold and is suitable for scenes where the gray scale distribution of the steel strip surface is uneven. The 8-neighborhood connected component labeling algorithm refers to a region labeling method based on the adjacency relationship of pixels, which can accurately segment the continuous defect region by scanning the pixel and its eight adjacent pixels to determine the connectivity. The area parameter is used to exclude micro-noise interference, the aspect ratio parameter is used to identify the linear scratch feature, the compactness parameter is used to distinguish the morphological features of hole defects, and the edge strength parameter is used to capture the gradient change of the defect boundary.
[0042] Specifically, after image fusion is completed, high-frequency noise is first eliminated by Gaussian filtering, and then the Otsu algorithm is used to automatically calculate the segmentation threshold to convert the image into a binary image to separate the foreground and background. Then, the 8-neighborhood connected component labeling algorithm is used to traverse the binary image to label all connected regions as candidate defects. The area, aspect ratio, compactness and edge strength parameters are calculated for each labeled region, and when any parameter exceeds the preset threshold, it is determined that the region has a defect. The multi-condition judgment mechanism can cover different types of defects with different morphological features, such as identifying elongated scratches by aspect ratio, identifying circular holes by compactness, and capturing defects with clear boundaries by edge strength.
[0043] Compared with the prior art, the traditional method usually only relies on a single feature to judge defects, such as screening only according to the area threshold, which is easy to misjudge due to noise interference. However, the present scheme can effectively distinguish between real defects and noise interference through a multi-parameter joint judgment mechanism, such as a small noise point that may trigger the area condition but cannot meet the requirements of other parameters, and a high-brightness reflective area that may trigger the edge strength but cannot meet the morphological parameter requirements. At the same time, the combination of the Otsu algorithm and the 8-neighborhood labeling algorithm reduces the calculation time on the basis of ensuring segmentation accuracy, and has higher execution efficiency than the traditional region growing algorithm.
[0044] Through the above technical scheme, the present application solves the misjudgment and missed detection problems caused by single feature judgment in steel strip surface defect detection, overcomes the interference of high-brightness reflective areas on defect recognition, and realizes accurate classification of different morphological defects such as scratches and holes. The method can meet the real-time requirements of industrial production lines while ensuring detection accuracy, and can adapt to complex lighting conditions for steel strip surface detection scenes.
[0045] The present application further provides an electronic device comprising a memory and a processor; the memory is used to store a computer program; the processor is coupled with the memory and is used to execute the computer program to run the steel strip defect detection method.
[0046] The memory refers to a hardware module used to store computer programs and data, and can be implemented as a solid-state drive or flash memory chip. Its function is to store the program code and intermediate calculation results required by the steel strip defect detection algorithm. The processor refers to an arithmetic control unit used to execute computer programs, and can be implemented as a multi-core central processing unit or graphics processing unit. Its function is to complete computational tasks such as steel strip image processing, feature extraction, and defect determination in real time by calling the program code in the memory.
[0047] Specifically, the electronic device uses memory to store computer programs containing image enhancement, multi-resolution fusion, and defect detection logic. During operation, the processor performs the following operations: first, it reads the original images of the front and back of the steel strip from memory and performs an inversion operation and image enhancement. It then generates a fused image using a multi-resolution fusion method and performs defect detection based on connected domain analysis. During this process, the processor optimizes compute-intensive tasks such as image filtering and pyramid fusion through parallel computing, while using memory to cache intermediate image data to reduce data read and write latency.
[0048] Compared to existing technologies, traditional steel strip defect detection equipment typically relies on dedicated hardware acceleration modules or expensive industrial computers for real-time processing. This solution, however, utilizes a collaborative architecture of general-purpose processors and memory, maintaining computational efficiency while reducing hardware costs. Furthermore, the computational bottlenecks caused by complex filtering algorithms in existing technologies are alleviated through an optimized illumination correction algorithm, and the memory usage issues associated with multi-resolution fusion are improved through a layered weight calculation strategy.
[0049] Through the above technical solution, this application can achieve real-time detection of steel strip defects without relying on dedicated hardware, effectively addressing the stringent detection speed requirements of industrial production lines. At the same time, by optimizing algorithm execution efficiency and memory management mechanisms, the risk of missed detections caused by computational delays in traditional methods is reduced, and the detection accuracy of high-brightness reflective areas and minor defects is improved.
[0050] The present application further proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the steel strip defect detection method are implemented.
[0051] The term "computer-readable storage medium" refers to a physical medium used to store computer program code, and can be implemented using storage devices such as solid-state drives, USB flash drives, or optical disks. Its purpose is to provide persistent storage support for the steel strip defect detection algorithm, ensuring that the program code can be repeatedly called. The steps in the implementation method when the computer program is executed by the processor refer to the processor running the instruction sequence in the storage medium. This can be implemented using multi-threaded scheduling or parallel computing technology. Its purpose is to transform the algorithmic logic of steel strip image processing, multi-resolution fusion, and defect detection into an executable computational process, thereby enhancing the automation of the detection process.
[0052] Specifically, after the computer program is loaded into the processor, it executes the steps of image acquisition, inversion, image enhancement, weight map calculation, multi-resolution fusion, and defect determination in a preset instruction sequence. During the image enhancement phase, the illumination maps of the original image and the inverted image are decomposed and adaptive illumination correction is performed to eliminate uneven brightness on the steel strip surface caused by reflections or occlusions. During the multi-resolution fusion phase, a weighted fusion strategy of Gaussian and Laplacian pyramids is utilized to retain effective features in different images. During the defect detection phase, connected domain analysis and morphological criteria are used to accurately identify defects such as scratches and holes. This process can optimize computationally intensive operations such as filtering and pyramid decomposition through hardware acceleration modules, thereby meeting the real-time requirements of industrial inspection.
[0053] Compared with existing technologies, traditional methods rely on manual visual inspection or single-feature analysis, which can be subject to strong subjectivity, high false positive rates, and low computational efficiency. This solution, by combining computer programs with storage media, solidifies complex image processing algorithms into a repeatable instruction set. This not only reduces the need for manual intervention but also significantly improves defect detection accuracy and processing speed through multi-resolution fusion and parallel computing optimization. Furthermore, this solution eliminates the need for dedicated hardware acceleration equipment, reducing industrial deployment costs.
[0054] Through the above-mentioned technical solution, this application effectively solves the technical problems of poor image quality, insufficient real-time performance, and high false detection and missed detection rates in steel strip surface defect detection. By programmatically executing image enhancement and multi-resolution fusion algorithms, it is able to adaptively eliminate uneven lighting and reflection interference, while using a pyramid fusion strategy to retain multi-scale features, thereby enhancing the contrast and edge information of the defect area. In addition, based on multi-criteria analysis of connected domain area, aspect ratio, and edge strength, the accuracy of defect classification is further improved, meeting the dual requirements of industrial production lines for detection accuracy and efficiency.
[0055] The present application further proposes an electronic device, comprising a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to run a steel strip defect detection method.
[0056] Memory refers to a hardware module used to store data and instructions, specifically dynamic random access memory or flash memory. It provides the processor with the program code and intermediate data required to execute the steel strip defect detection method. The processor, a hardware unit that performs computational tasks, specifically a multi-core central processing unit or graphics processing unit, accelerates image processing steps through parallel computing to meet the real-time requirements of industrial production lines.
[0057] Specifically, the electronic device uses memory to store a computer program containing image enhancement, multi-resolution fusion, and defect detection algorithms. The processor calls this program to perform layered processing on the steel strip image. During the image enhancement phase, the processor eliminates brightness unevenness through filtering and illumination correction. During the multi-resolution fusion phase, the processor constructs Gaussian and Laplacian pyramids, retaining the dominant features of different images through weighted fusion. During the defect detection phase, the processor performs binary segmentation and connected domain analysis, combining area, aspect ratio, and edge strength parameters to achieve multi-feature joint judgment.
[0058] In some specific embodiments, the processor may use multi-threading technology to perform parallel calculations on the fusion process of the Gaussian pyramid layer and the Laplacian pyramid layer, for example, assigning the weighted fusion tasks of different pyramid layers to independent computing units, thereby shortening the processing time of a single frame image.
[0059] Compared with existing technologies, traditional equipment relies on dedicated hardware acceleration modules to process complex algorithms, resulting in high costs and limited scalability. However, this solution optimizes the algorithm structure and calculation process, enabling general-purpose processors to efficiently perform multi-resolution fusion and defect determination tasks, thereby ensuring detection accuracy while reducing hardware deployment costs.
[0060] Through the above technical solution, this application can realize real-time detection of steel strip surface defects without relying on dedicated acceleration hardware, effectively solving the processing delay problem caused by the high algorithm complexity of traditional methods, and at the same time reducing the false detection rate and missed detection rate through a multi-feature joint judgment mechanism, adapting to the dual needs of industrial production lines for detection speed and accuracy.
[0061] The present application further proposes an electronic device, comprising a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to run a steel strip defect detection method.
[0062] Memory refers to the hardware module used to store computer programs and data generated during processing. It can be implemented as a solid-state drive or dynamic random access memory (DRAM). It is used to store image processing algorithms, defect determination rules, and intermediate calculation results. Processor refers to the computing unit that executes computer program instructions to complete image enhancement, fusion, and defect detection tasks. It can be implemented as a multi-core central processing unit or graphics processing unit (GPU). Parallel computing accelerates steps such as Gaussian pyramid fusion and connected domain extraction.
[0063] Specifically, the electronic device uses memory to store a computer program that includes image inversion, multi-resolution fusion, and defect area segmentation. When executing the program, the processor inverts the original images of the front and back of the steel strip according to preset steps to generate an inverted image. It then performs illumination correction by decomposing the illumination map and reflectance map, constructs Gaussian and Laplacian pyramids for multi-scale image fusion, and ultimately completes defect classification based on connected domain area, aspect ratio, and edge strength. During operation, the processor calls the weight map calculation formula and pyramid reconstruction algorithm stored in memory to process high-resolution steel strip images in real time.
[0064] Compared with existing technologies, traditional steel strip inspection equipment relies on a combination of dedicated image acquisition cards and industrial computers, resulting in high hardware costs and insufficient parallel computing capabilities. This solution, however, utilizes a collaborative architecture of general-purpose processors and memory. By optimizing algorithms, it reduces reliance on specialized hardware and leverages multi-core processors to achieve parallel acceleration of Gaussian filtering and Otsu segmentation, effectively meeting the inspection speed requirements of production lines. Existing solutions using FPGA acceleration require customized development, while this solution achieves equivalent real-time processing capabilities on a general-purpose computing platform by optimizing memory data access patterns and processor instruction scheduling.
[0065] Through the above technical solution, this application can quickly complete the surface defect detection of steel strips in an industrial field environment. The efficient computing capability of the processor ensures that the multi-resolution fusion algorithm is completed within milliseconds. The high-speed read and write characteristics of the memory support continuous processing of high-frame rate image streams, thereby avoiding the production line downtime caused by calculation delays in traditional methods. At the same time, through precise weight map calculation and pyramid reconstruction mechanism, it effectively suppresses the interference of metal surface reflections and improves the accuracy of defect identification.
[0066] For example, certain words are used in the specification and claims to refer to specific components. Those skilled in the art should understand that hardware manufacturers may use different terms to refer to the same component. This specification and claims do not use differences in names as a way to distinguish components, but use differences in the functions of the components as the criteria for distinction. For example, "including" mentioned throughout the specification and claims is an open term and should be interpreted as "including but not limited to". "Approximately" means that within an acceptable error range, those skilled in the art can solve technical problems within a certain error range and basically achieve technical effects.
[0067] It should be noted that the terms "include," "comprises," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a product or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such product or system. In the absence of further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the product or system comprising the element.
[0068] The foregoing description shows and describes several preferred embodiments of the present invention. However, as previously mentioned, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention can be used in various other combinations, modifications, and environments and can be modified within the scope of the present invention through the above teachings or through technology or knowledge in the relevant field. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention are intended to be protected by the appended claims.
Claims
1. A method for detecting defects in a steel strip, characterized in that: The steps include: S100, obtaining original images of the front and back sides of the steel strip, performing an inversion operation on the original images to obtain an inverted image, performing image enhancement on the original image and the inverted image to obtain an original enhanced image and an inverted enhanced image, and performing inversion restoration on the inverted enhanced image to obtain an inverted enhanced restored image; S200, respectively calculating weight maps of the original image, the original enhanced image, and the inverse enhanced restored image, and fusing them according to a multi-resolution fusion method to obtain a fused image; S300, extracting connected domains from the fused image, and determining whether there are scratches or holes on the surface of the steel strip based on the area, aspect ratio, density, and edge strength of the connected domains.
2. A steel strip defect detection method according to claim 1, characterized in that: The image enhancement process in step S100 includes: S100-1, decomposing the original image and the inverted image into an illumination map and a reflectance map, and estimating the illumination map using a guided filtering algorithm; S100-2. Perform illumination correction on the illuminance map. The correction coefficient γ is adaptively calculated based on the brightness of the current illuminance map, so that the average brightness of the corrected reflection map approaches the target value.
3. A steel strip defect detection method according to claim 2, characterized in that: In the guided filtering algorithm: a linear relationship is established within a local filtering window, and filtering parameters are solved by minimizing the difference between the input image and the linear output and constraining the coefficient amplitude; The filter window size is dynamically adjusted according to the surface texture granularity of the steel strip.
4. A steel strip defect detection method according to claim 3, characterized in that: The weight map is calculated by the following features: contrast: reflects the local grayscale difference and is used to enhance the defect edge; Saturation: Identifies oxidized or polluted areas based on the HSV color space. Good Exposure: Weights the overexposed / underexposed areas. The influence factors of the three are set to equal weight by default.
5. The method for detecting steel strip defects according to claim 1, wherein: The multi-resolution fusion method includes: constructing Gaussian pyramid and Laplacian pyramid for each image; At each resolution layer, the Gaussian layer and Laplacian layer are weightedly fused according to the weight map; reconstruction is performed layer by layer from top to bottom: the fused Gaussian layer is upsampled, and the fused Laplacian layer of the same layer is superimposed to iteratively generate the final fused image.
6. A steel strip defect detection method according to claim 1, characterized in that: The defect determination method includes: performing Gaussian denoising and Otsu binary segmentation on the fused image; extracting candidate regions using 8-neighborhood connected domain labeling; and determining a defect if any of the following conditions are met: (a) area > 20 pixels and aspect ratio > 4, marked as a steel strip scratch defect; (b) density > 0.7, marked as a steel strip hole defect; (c) edge strength > 30, marked as a significant defect.
7. An electronic device, characterized in that: include: memory and processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to run the steel strip defect detection method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which implements the steps of the method according to any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Workpiece apparent defect detection method based on machine vision
CN106204614A
Image enhancement method capable of simultaneously enhancing definition of high-illumination area and low-illumination area
CN116228553A
Casting blank surface quality defect detection method and device
CN117495819A