A steel surface image enhancement method based on a sub-region autonomous strategy

By combining regional autonomous strategies and median filtering, the problems of noise amplification and structural damage in steel surface defect detection are solved, achieving efficient image enhancement and defect recognition.

CN122243843APending Publication Date: 2026-06-19LIAONING UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LIAONING UNIVERSITY
Filing Date
2026-03-23
Publication Date
2026-06-19

Smart Images

  • Figure CN122243843A_ABST
    Figure CN122243843A_ABST
Patent Text Reader

Abstract

A method for enhancing steel surface images based on a regional autonomous strategy belongs to the field of computer vision and image processing technology. The steps are as follows: 1. Image preprocessing: Acquire the original image of the steel surface and convert the input RGB color image to a grayscale image; 2. Defect region detection: Use the Canny edge detection algorithm to perform edge detection on the grayscale image and extract potential defect boundary information; 3. Regional CLAHE enhancement: Based on the region mask generated in step 2, perform contrast-limited adaptive histogram equalization on the defect region and the background region respectively, and set different enhancement parameters; 4. Median filtering; 5. Weighted image fusion: Perform weighted fusion processing on the enhanced image obtained in step 3 and the filtered image obtained in step 4 to obtain the final output image. This invention can improve the overall quality and defect identifiability of steel surface images through the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology, and in particular to an image enhancement method for detecting defects on steel surfaces, specifically a steel surface image enhancement method based on a combination of regional autonomous strategy and median filtering. Background Technology

[0002] In the steel manufacturing and quality inspection process, accurate detection of steel surface defects is of great significance for ensuring product quality and production safety. Common steel surface defects include cracks, scratches, pits, and inclusions. These defects usually exhibit fine and low-contrast texture features and are easily affected by complex lighting conditions, surface reflection characteristics, and noise from image acquisition equipment, thus leading to a decrease in image quality.

[0003] Currently, in steel surface defect detection systems, image enhancement techniques are commonly used to preprocess acquired images to improve image contrast and highlight defect features. Commonly used image enhancement methods include histogram equalization (HE), contrast-limited adaptive histogram equalization (CLAHE), and enhancement methods based on Retinex theory.

[0004] Histogram equalization can effectively improve the overall contrast of an image, but because it processes the entire image globally, it can easily amplify noise, thus affecting the accuracy of subsequent defect identification. The CLAHE method divides the image into multiple local regions and performs histogram equalization on each region separately, which alleviates the noise amplification problem to some extent. However, it still has the following shortcomings in steel surface image processing: (1) Under complex background conditions, CLAHE is prone to over-enhancing the background region, thus amplifying noise texture; (2) Traditional CLAHE does not distinguish between the defect region and the background region, resulting in limited enhancement of defect features; (3) During the enhancement process, it is easy to destroy the structural continuity of the image, affecting the performance of subsequent defect detection algorithms.

[0005] Therefore, how to effectively suppress background noise amplification while enhancing the surface defect characteristics of steel and maintaining the integrity of image structural information has become a technical problem that urgently needs to be solved in the existing technology. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing image enhancement methods in the application of steel surface defect detection, and to provide a steel surface image enhancement method based on a regional autonomous strategy. By partitioning the image into defect areas and background areas, and combining it with a median filtering denoising strategy, the method enhances defect features while suppressing noise amplification, thereby improving the overall quality and defect identifiability of the steel surface image.

[0007] To achieve the above objectives, the technical solution adopted in this invention is: a method for enhancing steel surface images based on a regional autonomy strategy, the steps of which are as follows:

[0008] Step 1: Image preprocessing: Obtain the original image of the steel surface and convert the input RGB color image into a grayscale image.

[0009] Step 2, Defect Region Detection: The Canny edge detection algorithm is used to perform edge detection on the grayscale image, where the low threshold range is 20-50 and the high threshold range is 80-150; the edge detection results are subjected to morphological dilation operation, with the dilation structuring element size being 3×3-7×7 and the number of iterations being 1-3, in order to connect discrete edges and form continuous regions; let the edge image be E, the structuring element be P, and D be the dilated image; the dilation operation is expressed as formula (1), and a binary defect region mask is generated based on the dilation result D, dividing the image into the defect region Ωdef and the background region Ωbg;

[0010]

[0011] Step 3: Perform contrast-limited adaptive histogram equalization on the defect area and the background area respectively, where the principle formula is shown in Equation (2):

[0012]

[0013] Wherein: Ienh is the enhanced image, the image is I, the contrast limiting parameters are Kd, Kb and the neighborhood size is NB, Ωdef is the defect region and Ωbg is the background region; the contrast limiting factor Kd of the defect region is 2.5 to 4.0; the contrast limiting factor Kb of the background region is 1.0 to 2.0; the block size is 6×6 to 10×10; and the two enhancement results are selected and fused at the pixel level based on the defect mask to obtain the preliminary enhanced image;

[0014] A contrast limit parameter of 3.0 is applied to the defect area to enhance the defect edges and texture features; a contrast limit parameter of 1.5 is applied to the background area to suppress the enhancement of background texture and noise.

[0015] Step 4: Perform median filtering on the enhanced image obtained in Step 3. The filtering window size is 3×3 to 7×7 to remove noise and preserve edge structure. The median filtering process can be expressed as formula (3).

[0016]

[0017] Where: M refers to the median filtering operation, n represents the size of the filtering window, and Imed is the image after filtering.

[0018] Step 5: Image Weighted Fusion: The enhanced image obtained in Step 3 and the filtered image obtained in Step 4 are weighted and fused to balance the high contrast effect of CLAHE enhancement and the structural smoothing effect of median filtering. A weighted fusion strategy is used to generate the final output image; the formula is shown below:

[0019]

[0020] Where: Ifinal is the final output image, γ is a weighting coefficient used to balance the contributions of the enhanced image and the median filtered image, and γ is 0.2 to 0.5.

[0021] In step four:

[0022] By sorting the pixel neighborhood in the image using a sliding window and replacing the center pixel with the median, salt-and-pepper noise is removed while maintaining the image edge structure, and the continuity of linear structural features such as cracks, scratches, and slender defects is preserved.

[0023] In step five: the weighted fusion process combines the two images by introducing weighting coefficients, enhancing image details while further reducing noise interference, resulting in a steel surface image with clear structure and low noise. The final output is the enhanced steel surface image.

[0024] The beneficial effects of this invention are:

[0025] 1. By partitioning the defect area and the background area, differential enhancement is achieved, thereby improving the contrast of the defect area;

[0026] 2. Effectively suppresses the problem of excessive background noise enhancement caused by traditional CLAHE;

[0027] 3. Introduce median filtering to improve image denoising capabilities while preserving edge structure;

[0028] 4. A weighted fusion strategy is adopted to enhance details while ensuring overall image smoothness;

[0029] 5. Improving the identifiability of steel surface defects is beneficial for improving the performance of subsequent target detection algorithms. Attached Figure Description

[0030] Figure 1 This is a schematic diagram of the overall process of the steel surface image enhancement method of the present invention.

[0031] Figure 2 This is a schematic diagram of defect region segmentation based on edge detection.

[0032] Figure 3 This is a schematic diagram comparing the image effects before and after processing by the method of the present invention. Detailed Implementation

[0033] The present invention will be further described below with reference to specific embodiments.

[0034] In practical applications, images of the steel surface are first acquired using an industrial camera and then input into an image processing system. The system first converts the acquired color images to grayscale to obtain a grayscale image. Then, as... Figure 2 As shown, the Canny edge detection algorithm is used to process grayscale images to extract edge information from the images.

[0035] After obtaining the edge information, the edge region is expanded using a morphological dilation operation, transforming the originally discrete defect edges into a continuous region, thus constructing a defect region mask. Based on this mask, the image is divided into defect regions and background regions.

[0036] Subsequently, CLAHE enhancement processing was performed on both regions. A higher contrast limit parameter was set for the defect region to highlight fine structural features such as cracks and scratches; a lower contrast limit parameter was set for the background region to avoid over-enhancing the background texture.

[0037] After region enhancement, median filtering is performed on the image. This operation uses a sliding window to obtain neighboring pixels and calculates their medians to replace the center pixel, thereby effectively removing image noise while preserving the image edge structure.

[0038] Finally, as Figure 3 As shown, the enhanced image and the filtered image are weighted and fused to obtain the final enhanced image. This image retains structural information while having higher contrast and lower noise levels, effectively improving the recognition accuracy of steel surface defect detection algorithms.

[0039] As shown in Table 1:

[0040] Table 1: Comparison of Image Enhancement Algorithms

[0041]

[0042] Experimental results show that, compared with traditional HE, CLAHE and Retinex enhancement methods, the method of the present invention has significant advantages in terms of image structure preservation, noise suppression and image sharpness, and can effectively improve the quality of steel surface defect images.

Claims

1. A method for enhancing steel surface images based on a regional autonomy strategy, characterized in that, The steps are as follows: Step 1: Image preprocessing: Obtain the original image of the steel surface and convert the input RGB color image into a grayscale image; Step 2, Defect Region Detection: The Canny edge detection algorithm is used to perform edge detection on the grayscale image, with a low threshold range of 20-50 and a high threshold range of 80-150. Morphological dilation is performed on the edge detection results, with the dilation structuring element size ranging from 3×3 to 7×7 and the number of iterations ranging from 1 to 3, to connect discrete edges and form continuous regions. Let the edge image be E, the structuring element be P, and D be the dilated image. The dilation operation is expressed as formula (1). A binary defect region mask is generated based on the dilation result D, and the image is divided into defect regions Ω. def With background area Ω bg ; Step 3: Perform contrast-limited adaptive histogram equalization on the defect area and the background area respectively, where the principle formula is shown in Equation (2): Among them: I enh For the enhanced image, image I, contrast limiting parameter K d K b and neighborhood size N B Ω def For the defect area, Ω bg The contrast limiting factor K is for the background area and the defect area. d The contrast limiting factor K for the background area is 2.5–4.

0. b The value is 1.0 to 2.0; the block size is 6×6 to 10×10; and the two enhancement results are selected and fused at the pixel level based on the defect mask to obtain a preliminary enhanced image; Step 4: Perform median filtering on the enhanced image obtained in Step 3. The filtering window size is 3×3 to 7×7 to remove noise and preserve edge structure. The median filtering process can be expressed as formula (3). Where: M refers to the median filtering operation, n represents the filter window size, and I... med The image after filtering; Step 5: Image Weighted Fusion: The enhanced image obtained in Step 3 and the filtered image obtained in Step 4 are weighted and fused to balance the high contrast effect of CLAHE enhancement and the structural smoothing effect of median filtering. A weighted fusion strategy is used to generate the final output image; the formula is shown below: Among them: I final For the final output image, γ is a weighting coefficient used to balance the contributions of the enhanced image and the median filtered image; γ ranges from 0.2 to 0.

5.

2. The method for enhancing steel surface images based on a regional autonomy strategy according to claim 1, characterized in that, In step three: A contrast limit parameter of 3.0 is applied to the defect area to enhance the defect edges and texture features; A contrast limit parameter of 1.5 is applied to the background area to suppress the enhancement of background texture and noise.

3. The method for enhancing steel surface images based on a regional autonomy strategy according to claim 1, characterized in that, In step four: By sorting the pixel neighborhood in the image using a sliding window and replacing the center pixel with the median, salt-and-pepper noise is removed while maintaining the image edge structure, and the continuity of linear structural features such as cracks, scratches, and slender defects is preserved.

4. The method for enhancing steel surface images based on a regional autonomy strategy according to claim 1, characterized in that, In step five, the weighted fusion process combines two images by introducing weighting coefficients, which enhances image details while further reducing noise interference, resulting in a steel surface image with clear structure and low noise. Finally, the enhanced steel surface image is output.