A method for filtering and processing a clear image of a cast billet, finished material dendrite

CN122510102APending Publication Date: 2026-08-04BAOTOU SANHE INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BAOTOU SANHE INFORMATION TECH CO LTD
Filing Date
2026-06-04
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

[0004]传统滤波算法(如高斯、中值、维纳滤波)多属通用型方案,易造成枝晶边缘模糊或细枝晶细节丢失,无法适配枝晶图像“边缘精细、细节复杂”的特点;

Benefits of technology

[0034] The beneficial effects of this invention are: mechanism-driven algorithm, accurate adaptation to the scenario: breaking the limitations of general filtering, it strongly binds the solidification structure and defect morphology of the large and sparse billet/small and dense finished product with parameters such as sliding window size, step size, and threshold, realizing mechanism-driven adaptive filtering and solving the problem of poor adaptability of general methods;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122510102A_ABST
    Figure CN122510102A_ABST
Patent Text Reader

Abstract

This invention discloses a method for sharpening and filtering dendrite detection images of cast billets and finished products, comprising the following steps: First, preprocessing to eliminate on-site lighting and interference deviations; then, performing moving window layered filtering, where coarse filtering initializes the sliding window size and step size based on the differences in solidification structure and defect morphology of the sample to be tested, and fine filtering combines edge masking to introduce edge enhancement factors for weighted filtering of edge regions; next, detail enhancement is performed, applying a sharpening gain greater than that to weak detail regions than to strong detail regions, while leaving smooth backgrounds unsharpened; finally, adaptive correction is performed. This invention deeply embeds metallurgical physical mechanisms into the algorithm logic, achieving precise noise reduction, edge preservation, and anti-artifact synergy, with high computational efficiency and high adaptability to the real-time detection needs of different samples in metallurgical fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for sharpening and filtering images of dendrite detection in cast billets and finished products. Background Technology

[0002] Dendritic analysis, as a novel low-magnification inspection technique, can accurately characterize various minute defects and the morphology of as-cast solidification structures in samples. In recent years, with the clear national requirements for the development of high-quality special steel and the upgrading of industry quality control, dendritic analysis has become a key technical support connecting the understanding of microscopic mechanisms with macroscopic quality control.

[0003] However, actual dendrite inspection is mostly carried out on-site in steel production. Changes in natural light, arc light, and dust fluctuations can interfere with the imaging light source, resulting in "parasitic" images such as light streaks, light spots, and large areas of "masking fog." Since physically blocking interference is difficult to achieve, algorithmic filtering is necessary. Existing technologies have the following drawbacks:

[0004] Traditional filtering algorithms (such as Gaussian, median, and Wiener filtering) are mostly general-purpose schemes, which can easily cause blurred dendrite edges or loss of fine dendrite details, and cannot be adapted to the characteristics of dendrite images that are "fine in edge and complex in detail".

[0005] Deep learning-based filtering algorithms have high computational complexity and slow response, making it difficult to match the pace of real-time on-site inspections. They are also prone to artifacts due to over-sharpening, which affects the restoration of the true shape of the sample.

[0006] Existing filtering methods are not optimized for the differences in dendrite morphology between finished products and cast billets—cast billets have large, sparse dendrites that are susceptible to high-temperature noise interference, while finished products have small, dense dendrites that are susceptible to vibration ambiguity. General filtering methods cannot accurately match different degradation characteristics, thus limiting the detection results. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention provides a sharpening filtering method that uses optimized moving sliding window filtering as its core, accurately adapts to differences in solidification structure and defect morphology, balances noise reduction with detail preservation, avoids artifacts, and is computationally efficient.

[0008] In a first aspect, the present invention provides a method for sharpening and filtering dendrite detection images of cast billets and finished products, comprising the following steps:

[0009] Step S1: Perform grayscale conversion, illumination equalization, and invalid region cropping on the acquired original dendrite detection image in sequence to obtain a preprocessed grayscale image;

[0010] Step S2: Perform moving window layered filtering on the grayscale image, specifically including:

[0011] Coarse filtering: The moving window parameters are initialized based on the differences in solidification structure and defect morphology of the sample to be tested. For coarse and sparse dendrite morphology, a larger initial sliding window size and a larger sliding step size are initialized, while for fine and dense dendrite morphology, a smaller initial sliding window size and a smaller sliding step size are initialized. The moving window is slid point by point along the image, and the median and standard deviation of the gray values ​​of the pixels within the window are calculated. If the difference between the current pixel gray value and the median exceeds a preset noise threshold, the current pixel value is replaced with the median. The sliding window size is dynamically adjusted according to the standard deviation.

[0012] Fine filtering: Extract the dendrite edge mask of the image after coarse filtering to divide the dendrite edge region and the background region; apply equal weighted coefficients to the background region for sliding window filtering, and apply Gaussian weighted coefficients to the dendrite edge region and introduce an edge enhancement factor for sliding window filtering to enhance the gray level difference of edge pixels. After fusion, the finely filtered image is obtained.

[0013] Step S3: Perform detail enhancement processing on the finely filtered image, extract high-frequency detail features of the image, and divide the strong detail region, weak detail region and smooth background region; apply weak detail sharpening gain to the weak detail region, apply strong detail sharpening gain to the strong detail region, the weak detail sharpening gain is greater than the strong detail sharpening gain, and do not sharpen the smooth background region. After fusion, the detail-enhanced image is obtained.

[0014] Step S4: Perform adaptive correction on the detail-enhanced image, sequentially performing grayscale stretching, contrast enhancement, and pixel normalization to output the final sharpened dendritic image.

[0015] Preferably, the illumination equalization process in step S1 employs the contrast-constrained adaptive histogram equalization (CLAHE) algorithm.

[0016] Furthermore, for sample images with dense dendrite distribution, a larger tileGridSize parameter is selected; for sample images with sparse dendrite distribution, a smaller tileGridSize parameter is selected.

[0017] Preferably, in the coarse filtering of step S2, a preset noise threshold is set according to the degradation characteristics of the sample to be tested:

[0018] For sample images severely affected by high-temperature noise, a higher preset noise threshold is set; for sample images mainly affected by vibration blurring, a lower preset noise threshold is set.

[0019] Preferably, in the coarse filtering of step S2, dynamically adjusting the sliding window size based on the standard deviation specifically involves:

[0020] If the standard deviation of pixels within the sliding window is greater than the first preset standard deviation threshold, it indicates dense noise, and the size of the sliding window will be increased.

[0021] If the standard deviation of pixels within the sliding window is less than the second preset standard deviation threshold, it indicates that the region is smooth, and the size of the sliding window will be reduced.

[0022] Preferably, in the fine filtering step S2, the Sobel operator is used to detect dendrite edges to obtain an edge mask image; and a lower edge detection threshold is used for small and dense dendrite morphology, while a higher edge detection threshold is used for large and sparse dendrite morphology.

[0023] Preferably, in step S3, the Laplacian operator is used to extract the detailed features of the image;

[0024] For fine and dense dendrite morphology, the difference in sharpening gain between weak detail regions and strong detail regions is small; for coarse and sparse dendrite morphology, the difference in sharpening gain between weak detail regions and strong detail regions is large.

[0025] Preferably, in the adaptive correction of step S4:

[0026] For sample images severely affected by high-temperature noise, the upper limit of the preset average gray value range for gray-scale stretching is relatively high; for sample images mainly affected by vibration blurring, the upper limit of the preset average gray value range for gray-scale stretching is relatively low.

[0027] Secondly, the present invention provides a system for clarifying and filtering dendrite detection images of cast billets and finished products, comprising:

[0028] The preprocessing module is used to sequentially perform grayscale processing, illumination equalization processing, and invalid region cropping on the acquired raw dendrite detection image to obtain a preprocessed grayscale image;

[0029] The layered filtering module is used to perform moving window layered filtering on grayscale images, including a coarse filtering unit and a fine filtering unit. The coarse filtering unit initializes the moving window parameters based on the differences in solidification structure and defect morphology of the sample to be tested. Specifically, a larger initial sliding window size and a larger sliding step size are initialized for coarse and sparse dendrite morphology, while a smaller initial sliding window size and a smaller sliding step size are initialized for fine and dense dendrite morphology. The moving window slides point by point along the image, calculating the median and standard deviation of the grayscale values ​​of the pixels within the window. If the difference between the current pixel's grayscale value and the median exceeds a preset noise threshold, the current pixel value is replaced with the median. The sliding window size is dynamically adjusted based on the standard deviation. The fine filtering unit extracts the dendrite edge mask of the image after coarse filtering, dividing the dendrite edge region and the background region. The background region is filtered using an equally weighted coefficient, while the dendrite edge region is filtered using a Gaussian weighted coefficient and an edge enhancement factor is introduced to enhance the grayscale differences of the edge pixels. The resulting image is then fused to obtain the fine-filtered image.

[0030] The detail enhancement module is used to enhance the details of the finely filtered image, extract the high-frequency detail features of the image, and divide the strong detail region, weak detail region and smooth background region; apply weak detail sharpening gain to the weak detail region and apply strong detail sharpening gain to the strong detail region, with the weak detail sharpening gain being greater than the strong detail sharpening gain, and do not sharpen the smooth background region, and obtain the detail enhanced image after fusion.

[0031] The adaptive correction module is used to adaptively correct the detail-enhancing image by sequentially performing grayscale stretching, contrast enhancement, and pixel normalization, and outputting the final sharpened dendritic image.

[0032] Thirdly, the present invention provides an electronic device including a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, it implements any step of the sharpening filtering processing method of the first aspect of the present invention.

[0033] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a method for sharpening filtering.

[0034] The beneficial effects of this invention are: mechanism-driven algorithm, accurate adaptation to the scenario: breaking the limitations of general filtering, it strongly binds the solidification structure and defect morphology of the large and sparse billet / small and dense finished product with parameters such as sliding window size, step size, and threshold, realizing mechanism-driven adaptive filtering and solving the problem of poor adaptability of general methods;

[0035] Reverse non-uniform sharpening eliminates artifacts: The innovative sharpening logic of "high gain for weak details, low gain for strong details, and zero gain for background" is proposed. While enhancing fine dendrites, it fundamentally avoids the halo artifacts caused by over-sharpening in traditional algorithms, ensuring the authenticity of the sample morphology.

[0036] Edge enhancement synergy, balancing denoising and edge preservation: An edge enhancement factor and Gaussian weighting are introduced in fine filtering to actively increase the edge gray level difference while filtering and denoising, achieving a balance of "denoising and sharpening at the same time".

[0037] Lightweight computing, adapted to real-time field requirements: Based on an optimized mobile sliding window architecture, it avoids the computational burden of deep learning and can meet the needs of rapid on-site metallurgical inspection without the need for high-performance hardware. Attached Figure Description

[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is an overall flowchart of the moving sliding window filtering process for clarifying dendrite detection images of finished products and cast billets according to the present invention;

[0040] Figure 2 This is a schematic diagram of the original dendrite image containing noise and blurred edges in the embodiment;

[0041] Figure 3 This is a schematic diagram of a clear dendrite image processed by the present invention in the embodiment;

[0042] Figure 4 This is a schematic diagram showing the comparison images after traditional sliding window filtering processing in the embodiment;

[0043] Figure 5 This is a schematic diagram comparing image quality evaluation indicators of different filtering methods in the embodiments.

[0044] Figure 6 This is a screenshot of the visualization operation platform in the embodiment;

[0045] Figure 7 This is a flowchart of another embodiment of the method for clarifying and filtering dendrite detection images of cast billets and finished products according to the present invention. Detailed Implementation

[0046] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0047] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0048] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0049] The core technical solution of this invention is: based on an optimized moving sliding window filtering algorithm, through a four-step collaborative processing of "preprocessing - moving sliding window layered filtering - detail enhancement - adaptive correction," the clear filtering of dendrite detection images of finished products and cast billets is achieved. The moving sliding window filtering parameters and logic are optimized to address the specific characteristics of dendrite images of finished products and cast billets, balancing noise reduction, detail preservation, and computational efficiency to meet the real-time detection needs of metallurgical sites. The specific steps are as follows:

[0050] Reference Figures 1-6 This is one embodiment of the present invention, which provides a method for clarifying and filtering dendrite detection images of cast billets and finished products, including the following steps:

[0051] Step S1: Perform grayscale conversion, illumination equalization, and invalid region cropping on the acquired original dendrite detection image in sequence to obtain the preprocessed grayscale image.

[0052] This step specifically involves preprocessing the acquired raw dendrite detection images of finished products and cast billets to eliminate systematic biases generated during the metallurgical site image acquisition process (such as high-temperature illumination bias and equipment vibration interference), laying the foundation for subsequent moving window filtering processing. Specifically, this includes:

[0053] (1) Grayscale conversion: The color dendrite image is converted to a grayscale image using a weighted average method. The calculation formula is as follows: Where R(i,j), G(i,j), and B(i,j) represent the pixel values ​​of the original color image in the R, G, and B channels, respectively, and f(i,j) is the pixel value after grayscale conversion. The brightness characteristics of the dendritic images of the finished product and the billet are preserved, the computational complexity is reduced, and it is suitable for real-time on-site processing.

[0054] (2) Illumination equalization processing: The contrast-limited adaptive histogram equalization (CLAHE) algorithm is used to correct the illumination of the grayscale image, suppress the uneven illumination and brightness deviation caused by high temperature radiation, enhance the contrast between the dendrites and the background of the sample, and avoid the loss of fine dendrite details caused by local over-darkness or over-brightness. The clipLimit parameter of the CLAHE algorithm is set to 2.0~3.0, and the tileGridSize parameter is set to 8×8~16×16 to adapt to the detailed distribution characteristics of dendrites in the finished product and the billet (the dendrites in the billet are denser, so a grid of 12×12~16×16 can be selected).

[0055] (3) Invalid area cropping: Remove invalid black borders, device borders, or dust interference areas from the image edges, retain the valid detection areas containing finished materials and billet dendrites, reduce the interference of invalid pixels on the moving sliding window filtering process, improve computing efficiency, and adapt to the rapid detection needs of metallurgical sites.

[0056] Step S2: Perform moving window layered filtering on the grayscale image, specifically including:

[0057] Coarse filtering: The moving window parameters are initialized based on the differences in solidification structure and defect morphology of the sample to be tested. For coarse and sparse dendrite morphology, a larger initial sliding window size and a larger sliding step size are initialized, while for fine and dense dendrite morphology, a smaller initial sliding window size and a smaller sliding step size are initialized. The moving window is slid point by point along the image, and the median and standard deviation of the gray values ​​of the pixels within the window are calculated. If the difference between the current pixel gray value and the median exceeds a preset noise threshold, the current pixel value is replaced with the median. The sliding window size is dynamically adjusted according to the standard deviation.

[0058] Fine filtering: Extract the dendrite edge mask of the image after coarse filtering to divide the dendrite edge region and the background region; apply equal weighted coefficients to the background region for sliding window filtering, and apply Gaussian weighted coefficients to the dendrite edge region and introduce an edge enhancement factor for sliding window filtering to enhance the gray-level difference of edge pixels. After fusion, the finely filtered image is obtained.

[0059] This step specifically involves: For the preprocessed grayscale image, considering the morphological differences in dendrites between the finished product and the cast billet (coarse dendrites in the cast billet, fine and dense dendrites in the finished product), a layered moving sliding window filtering strategy of "coarse filtering-fine filtering" is adopted. The sliding window size, sliding step size, and filtering weights are optimized to remove different types of noise while preserving the dendrite details of the sample. The core is an optimized moving sliding window filtering algorithm, as detailed below:

[0060] Coarse filtering (initial noise removal):

[0061] An adaptive sliding window filtering algorithm is employed to remove impulse noise such as salt-and-pepper noise (which is easily generated by dust and sensor interference in the field) from dendrite images of finished products and cast billets, while avoiding blurring of dendrite edges in the samples. The core improvement lies in dynamically adjusting the size and sliding step of the sliding window based on the structural characteristics of dendrites in finished products and cast billets and the difference between pixel grayscale values ​​and neighboring pixels, thus adapting to the distribution characteristics of dendrites in different samples.

[0062] Specific steps:

[0063] (1) Initialize the sliding window parameters: For billet dendrites (coarse and sparsely distributed), the initial sliding window size is set to 5×5 and the sliding step size is set to 2; for finished product dendrites (fine and densely distributed), the initial sliding window size is set to 3×3 and the sliding step size is set to 1 to ensure coverage of fine dendrite details.

[0064] (2) Sliding window traversal of the image: slide the moving window along the pixel matrix of the image point by point, traverse each pixel, and calculate the median and standard deviation of the gray values ​​of all pixels in the sliding window;

[0065] (3) Noise Judgment and Replacement: If the difference between the current pixel grayscale value and the median in the sliding window exceeds the preset threshold (the threshold is set to 5~10, 8~10 for billet dendrites, and 5~7 for finished dendrites, to adapt to different noise intensities), it is judged as a noise pixel and the current pixel value is replaced with the median in the sliding window; otherwise, the current pixel value is retained (considered as a valid dendrite pixel).

[0066] (4) Adaptive window adjustment: If the standard deviation of pixels within the sliding window is too large (indicating dense noise, such as the high-temperature noise area in the billet image), the sliding window size is increased by 1 to 2 pixels; if the standard deviation is too small (indicating a smooth area, such as the dendritic background area in the finished product), the sliding window size is reduced by 1 to 2 pixels, dynamically optimizing the denoising effect and computational efficiency.

[0067] Fine filtering (deep noise removal + edge preservation):

[0068] Building upon coarse filtering, a weighted moving sliding window filtering algorithm (the core optimization algorithm) is employed to remove Gaussian noise (easily generated by equipment vibration and optical aberrations) from the dendrite images of finished products and cast billets, while preserving the dendrite edges and fine dendrite details of the sample. The core improvement lies in introducing dendrite edge detection factors for finished products and cast billets, setting different sliding window weighting coefficients for the dendrite edge region and the background region, avoiding edge blurring caused by traditional moving sliding window filtering, and adapting to the morphological characteristics of the sample dendrites.

[0069] Specific steps:

[0070] (1) Dendrite edge detection: The Sobel operator is used to detect the dendrite edges of the finished product and the billet to obtain the edge mask image, which accurately marks the dendrite edge area and the background area. The dendrite edge detection threshold of the billet can be appropriately reduced to adapt to fine dendrite edge detection.

[0071] (2) Weighted sliding window parameter settings: For the background area, an equal weighting coefficient (each weight is 1) is used, the sliding window size is consistent with the coarse filter, and Gaussian noise is removed at the depth; for the dendrite edge area, a Gaussian weighting coefficient is used (the weight of the center pixel of the sliding window is the highest, and it gradually decreases towards the edge) to reduce the smoothing intensity of the sliding window, and at the same time, an edge enhancement factor (the coefficient is set to 1.1~1.3) is introduced to enhance the gray-scale difference of edge pixels and ensure that the dendrite edges of the finished product and the billet are clear;

[0072] (3) Weighted filtering calculation: The sliding window is moved point by point along the image. The sum of the products of the gray value of each pixel in the window and the corresponding weight is calculated and divided by the total weight to obtain the filtered gray value of the current pixel.

[0073] (4) Result fusion: The filtering results of the edge region and the background region are fused to obtain a finely filtered image, achieving a balance between "denoising and edge preservation", while fully preserving the outline of the coarse dendrites of the billet and the details of the fine dendrites of the finished product.

[0074] Key advantages: The optimized moving sliding window filtering algorithm improves computational efficiency by more than 40% compared to the traditional moving sliding window filtering, improves noise removal rate of dendrite images of finished products and cast billets by more than 15%, and can accurately adapt to the morphological differences of dendrites in different samples, avoiding edge blurring and loss of details.

[0075] Step S3: Perform detail enhancement processing on the finely filtered image, extract high-frequency detail features of the image, and divide the strong detail region, weak detail region and smooth background region; apply weak detail sharpening gain to the weak detail region and apply strong detail sharpening gain to the strong detail region, with the weak detail sharpening gain being greater than the strong detail sharpening gain, and do not sharpen the smooth background region, and obtain the detail-enhanced image after fusion.

[0076] This step specifically involves: For the image after layered filtering using a sliding window, and considering the characteristics of dendrites in the finished product and the cast billet, an adaptive sharpening algorithm is used to enhance dendrite details (such as fine dendrites in the finished product and dendrite bifurcation points in the cast billet), while avoiding over-sharpening that could produce artifacts. The details are as follows:

[0077] (1) The Laplacian operator is used to extract the detailed features (high frequency components) of the image, and to separate the dendritic detail regions and smooth regions of the finished product and the cast billet. The extraction threshold of the dendritic detail region of the finished product can be appropriately reduced to ensure that the fine dendritic details are accurately identified.

[0078] (2) Based on the difference in grayscale values ​​in the detailed areas, the sharpening intensity is adaptively adjusted: for weak detail areas such as fine dendrites in the billet, the sharpening gain is increased (gain coefficient is set to 1.3~1.5); for strong detail areas such as the main dendrites in the finished product, the sharpening gain is decreased (gain coefficient is set to 0.8~1.0); for smooth background areas, no sharpening is performed to avoid amplifying background noise (such as noise generated by dust interference at the metallurgical site).

[0079] (3) The sharpened details are fused with the finely filtered image to obtain a clear image with enhanced details, ensuring that the dendrite outline of the billet is clear and the fine dendrite details of the finished product are distinguishable, while no artifacts are produced, which is suitable for subsequent quantitative analysis of dendrites.

[0080] Step S4: Perform adaptive correction on the detail-enhanced image, sequentially performing grayscale stretching, contrast enhancement, and pixel normalization to output the final sharpened dendritic image.

[0081] This step specifically involves: adaptively correcting the enhanced image to eliminate grayscale deviations that may occur during the moving sliding window filtering process, adapting to the brightness differences between the finished product and the cast billet images, and ensuring uniform image brightness and realistic dendrite morphology of the sample. Specifically, this includes:

[0082] (1) Calculate the average gray value and gray standard deviation of the image. If the gray value deviates from the preset range (the preset range is 80~200, 90~200 can be selected for the billet image, and 80~180 can be selected for the finished product image to adapt to the imaging brightness of different samples), then perform gray stretching on the image and adjust the brightness to a reasonable range.

[0083] (2) An adaptive threshold segmentation algorithm is adopted to further enhance the contrast between the dendrite body and the background of the finished product and the billet, so as to ensure that the dendrite outline is clear and facilitates subsequent dendrite identification and size measurement.

[0084] (3) Perform pixel normalization on the corrected image to make the gray value distribution uniform, so as to provide a standardized image for subsequent quantitative statistics of dendrites in finished products and cast billets (such as dendrite spacing calculation and dendrite uniformity assessment).

[0085] The filtering method of this invention can adaptively adjust the core parameters (with a focus on optimizing the moving sliding window filtering parameters) according to the differences in dendrite morphology of the finished product and the degree of image degradation. The specific parameter ranges are as follows:

[0086]

[0087] Preferably, the illumination equalization process in step S1 employs the contrast-constrained adaptive histogram equalization (CLAHE) algorithm.

[0088] Furthermore, for sample images with dense dendrite distribution, a larger tileGridSize parameter is selected; for sample images with sparse dendrite distribution, a smaller tileGridSize parameter is selected.

[0089] Preferably, in the coarse filtering of step S2, a preset noise threshold is set according to the degradation characteristics of the sample to be tested:

[0090] For sample images severely affected by high-temperature noise, a higher preset noise threshold is set; for sample images mainly affected by vibration blurring, a lower preset noise threshold is set.

[0091] Preferably, in the coarse filtering of step S2, dynamically adjusting the sliding window size based on the standard deviation specifically involves:

[0092] If the standard deviation of pixels within the sliding window is greater than the first preset standard deviation threshold, it indicates dense noise, and the size of the sliding window will be increased.

[0093] If the standard deviation of pixels within the sliding window is less than the second preset standard deviation threshold, it indicates that the region is smooth, and the size of the sliding window will be reduced.

[0094] Preferably, in the fine filtering step S2, the Sobel operator is used to detect dendrite edges to obtain an edge mask image; and a lower edge detection threshold is used for small and dense dendrite morphology, while a higher edge detection threshold is used for large and sparse dendrite morphology.

[0095] Preferably, in step S3, the Laplacian operator is used to extract the detailed features of the image;

[0096] For fine and dense dendrite morphology, the difference in sharpening gain between weak detail regions and strong detail regions is small; for coarse and sparse dendrite morphology, the difference in sharpening gain between weak detail regions and strong detail regions is large.

[0097] Preferably, in the adaptive correction of step S4:

[0098] For sample images severely affected by high-temperature noise, the upper limit of the preset average gray value range for gray-scale stretching is relatively high; for sample images mainly affected by vibration blurring, the upper limit of the preset average gray value range for gray-scale stretching is relatively low.

[0099] Example: Sharpening of Dendrite Detection Images from Timber by Moving Sliding Window Filtering

[0100] Experimental conditions

[0101] Original image: Dendritic image of low carbon steel billet acquired using a high-resolution scanning device. The image resolution is 1024×1024 pixels. It is a color image with slight Gaussian noise (noise variance 0.03), a small amount of salt-and-pepper noise, and local uneven illumination (caused by high temperature radiation). The billet dendrites are coarse and have blurred edges. The details of dendrite bifurcation are masked by noise.

[0102] Processing equipment: General industrial computer (CPU: Intel Core i5-10400, memory: 8GB), adapted for embedded equipment in metallurgical fields;

[0103] Comparison of methods: traditional sliding window filtering, traditional Wiener filtering, and deep learning filtering (CNN filtering).

[0104] Processing steps

[0105] Image preprocessing: The color sample dendrite image was converted to a grayscale image using a weighted average method; illumination equalization was performed using the CLAHE algorithm, with clipLimit=2.8 and tileGridSize=10×10; invalid black borders and device borders were cropped from the image edges, retaining the effective detection area; layered filtering was performed using a sliding window.

[0106] Coarse filtering: Adaptive moving sliding window filtering is used, with a sliding window size of 5×5, a sliding step size of 2, and a noise threshold of 9. The image is traversed and the sliding window size is dynamically adjusted to remove salt-and-pepper noise. Fine filtering: Weighted moving sliding window filtering is used, with the Sobel operator detecting dendrite edges of the sample. The background area uses equal weighting coefficients, and the edge area uses Gaussian weighting coefficients. The edge enhancement factor is set to 1.15, and Gaussian noise is removed by depth removal to preserve dendrite edges. Detail enhancement processing: The Laplacian operator is used to extract dendrite detail features of the sample. The sharpening gain for weak detail areas (dendrite bifurcation) is set to 1.25, and the sharpening gain for strong detail areas (dendrite body) is set to 0.85. The detail features are then fused with the filtered image.

[0107] Adaptive correction: The average gray value of the calculated image is 130, which is within the preset range (90~200), so no gray-scale stretching is required; adaptive threshold segmentation is used to enhance the contrast, and pixel normalization is performed to obtain a cleared filtered dendritic image of the sample.

[0108] Processing effect

[0109] After processing in this embodiment, the noise removal rate of the sample dendrite image is 96.8%, the detail retention rate is 98.8%, PSNR=38.2dB, SSIM=0.945, the sample dendrite outline is clear, the details of dendrite bifurcation are distinguishable, and the dendrite spacing measurement error is 1.6%. Compared with traditional moving sliding window filtering (PSNR=30.5dB, SSIM=0.82, processing time 0.7s), traditional Wiener filtering (PSNR=31.8dB, SSIM=0.84), and CNN filtering (PSNR=37.0dB, SSIM=0.93, processing time 1.2s), the optimized moving sliding window filtering of this invention has significant advantages in noise reduction effect, detail retention, and computational efficiency, and can meet the needs of quantitative statistics of sample dendrites and real-time detection in metallurgical fields.

[0110] Secondly, the present invention provides a system for clarifying and filtering dendrite detection images of cast billets and finished products, comprising:

[0111] The preprocessing module is used to sequentially perform grayscale processing, illumination equalization processing, and invalid region cropping on the acquired raw dendrite detection image to obtain a preprocessed grayscale image;

[0112] The layered filtering module is used to perform moving window layered filtering on grayscale images, including a coarse filtering unit and a fine filtering unit. The coarse filtering unit initializes the moving window parameters based on the differences in solidification structure and defect morphology of the sample to be tested. Specifically, a larger initial sliding window size and a larger sliding step size are initialized for coarse and sparse dendrite morphology, while a smaller initial sliding window size and a smaller sliding step size are initialized for fine and dense dendrite morphology. The moving window slides point by point along the image, calculating the median and standard deviation of the grayscale values ​​of the pixels within the window. If the difference between the current pixel's grayscale value and the median exceeds a preset noise threshold, the current pixel value is replaced with the median. The sliding window size is dynamically adjusted based on the standard deviation. The fine filtering unit extracts the dendrite edge mask of the image after coarse filtering, dividing the dendrite edge region and the background region. The background region is filtered using an equally weighted coefficient, while the dendrite edge region is filtered using a Gaussian weighted coefficient and an edge enhancement factor is introduced to enhance the grayscale differences of the edge pixels. The resulting image is then fused to obtain the fine-filtered image.

[0113] The detail enhancement module is used to enhance the details of the finely filtered image, extract the high-frequency detail features of the image, and divide the strong detail region, weak detail region and smooth background region; apply weak detail sharpening gain to the weak detail region and apply strong detail sharpening gain to the strong detail region, with the weak detail sharpening gain being greater than the strong detail sharpening gain, and do not sharpen the smooth background region, and obtain the detail enhanced image after fusion.

[0114] The adaptive correction module is used to adaptively correct the detail-enhancing image by sequentially performing grayscale stretching, contrast enhancement, and pixel normalization, and outputting the final sharpened dendritic image.

[0115] This embodiment also provides a computer device applicable to the above-described method, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method proposed in the above embodiment.

[0116] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0117] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the method described in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0118] In summary, compared with existing technologies, this invention, with optimized moving sliding window filtering as its core, is specifically optimized for dendrite detection scenarios in finished products and cast billets, and has the following significant beneficial effects, all of which can be quantitatively verified through experimental data:

[0119] 1. Excellent noise reduction effect with complete detail preservation: Based on optimized moving sliding window filtering, a layered filtering strategy is adopted to accurately remove various types of noise such as Gaussian noise and salt-and-pepper noise in the dendrite images of finished products and cast billets, with a noise removal rate of ≥96%; at the same time, through adaptive adjustment and weighted optimization of sliding window parameters, key details such as the dendrite outline of the cast billet and the fine dendrites of the finished product are preserved to the maximum extent, with a detail retention rate of ≥98.5%, which solves the problem of "difficulty in balancing noise reduction and detail retention" in traditional filtering, and clearly restores the true morphology of dendrites in the sample;

[0120] 2. Significantly improved accuracy in dendrite detection: Through illumination equalization, detail enhancement, and adaptive correction, combined with the edge preservation advantage of moving sliding window filtering, the contrast between the dendrite body and the background of the finished product and billet is improved by more than 35%, and the subsequent dendrite identification accuracy is improved by more than 28%. The dendrite size measurement error is ≤1.8%, which can effectively support subsequent work such as quantitative statistics of dendrites (such as dendrite spacing calculation and dendrite uniformity assessment), help the quality inspection of finished products and billets, and reduce quality misjudgment.

[0121] 3. High computational efficiency, suitable for real-time on-site metallurgical inspection: The core optimized moving sliding window filtering algorithm simplifies the computational logic and reduces computational complexity. The processing time for a single 1024×1024 pixel dendrite image of finished product / cast billet is ≤0.4s, which can be adapted to real-time on-site inspection scenarios without the need for high-performance hardware equipment, thus reducing inspection costs.

[0122] 4. High versatility and precise adaptation to finished product and billet scenarios: It can adaptively adjust the moving sliding window filter and related parameters according to the morphological differences (coarse / fine) of dendrites in finished products and billets and the image degradation characteristics (vibration blur / high temperature noise), adapting to dendrite images of finished products and billets acquired by different processes, thus solving the problem of poor adaptability of general filtering methods;

[0123] 5. High image fidelity and no artifacts: Adaptive sharpening and correction strategies are adopted, combined with the advantages of moving sliding window weighted filtering, to avoid artifacts caused by over-sharpening. The peak signal-to-noise ratio (PSNR) of the filtered image is ≥36dB and the structural similarity (SSIM) is ≥0.93, ensuring the authenticity of the dendrite morphology of the sample and providing reliable image support for dendrite detection of finished products and cast billets.

[0124] 6. Simple operation and easy engineering application: The entire process is highly automated, requiring no manual intervention. It can be directly integrated into existing dendrite detection systems for finished products and cast billets without requiring large-scale modifications to existing testing equipment. It is easy to apply in engineering and can be widely promoted in the field of production quality monitoring.

[0125] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for sharpening and filtering dendrite detection images of cast billets and finished products, characterized in that, Includes the following steps: Step S1: Perform grayscale conversion, illumination equalization, and invalid region cropping on the acquired original dendrite detection image in sequence to obtain a preprocessed grayscale image; Step S2: Perform moving window layered filtering on the grayscale image, specifically including: Coarse filtering: The moving window parameters are initialized based on the differences in solidification structure and defect morphology of the sample to be tested. Specifically, a larger initial sliding window size and a larger sliding step size are initialized for coarse and sparse dendrite morphology, while a smaller initial sliding window size and a smaller sliding step size are initialized for fine and dense dendrite morphology. The moving window is slid point by point along the image, and the median and standard deviation of the gray values ​​of the pixels within the window are calculated. If the difference between the current pixel gray value and the median exceeds a preset noise threshold, the current pixel value is replaced with the median. The sliding window size is dynamically adjusted based on the standard deviation. Fine filtering: Extract the dendrite edge mask of the image after coarse filtering to divide the dendrite edge region and the background region; apply equal weighted coefficients to the background region for sliding window filtering, and apply Gaussian weighted coefficients to the dendrite edge region and introduce an edge enhancement factor for sliding window filtering to enhance the gray level difference of edge pixels. After fusion, the finely filtered image is obtained. Step S3: Perform detail enhancement processing on the finely filtered image, extract high-frequency detail features of the image, and divide the strong detail region, weak detail region and smooth background region; apply weak detail sharpening gain to the weak detail region and apply strong detail sharpening gain to the strong detail region, wherein the weak detail sharpening gain is greater than the strong detail sharpening gain, and the smooth background region is not sharpened, and the image is obtained after fusion. Step S4: Perform adaptive correction on the detail-enhanced image, sequentially performing grayscale stretching, contrast enhancement, and pixel normalization processing, and output the final sharpened dendritic image.

2. The method according to claim 1, characterized in that, The illumination equalization process in step S1 adopts the contrast-limited adaptive histogram equalization (CLAHE) algorithm. Furthermore, for sample images with dense dendrite distribution, a larger tileGridSize parameter is selected; for sample images with sparse dendrite distribution, a smaller tileGridSize parameter is selected.

3. The method according to claim 1, characterized in that, In the coarse filtering of step S2, a preset noise threshold is set according to the degradation characteristics of the sample to be tested: For sample images severely affected by high-temperature noise, a higher preset noise threshold is set; for sample images mainly affected by vibration blurring, a lower preset noise threshold is set.

4. The method according to claim 1, characterized in that, In the coarse filtering step S2, dynamically adjusting the sliding window size based on the standard deviation specifically involves: If the standard deviation of pixels within the sliding window is greater than the first preset standard deviation threshold, it indicates dense noise, and the size of the sliding window will be increased. If the standard deviation of pixels within the sliding window is less than the second preset standard deviation threshold, it indicates that the region is smooth, and the size of the sliding window will be reduced.

5. The method according to claim 1, characterized in that, In the fine filtering step S2, the Sobel operator is used to detect dendrite edges to obtain an edge mask image; and a lower edge detection threshold is used for small and dense dendrite morphology, while a higher edge detection threshold is used for large and sparse dendrite morphology.

6. The method according to claim 1, characterized in that, In step S3, the Laplacian operator is used to extract detailed features of the image; For fine and dense dendrite morphology, the difference in sharpening gain between weak detail regions and strong detail regions is small; for coarse and sparse dendrite morphology, the difference in sharpening gain between weak detail regions and strong detail regions is large.

7. The method according to claim 1, characterized in that, In the adaptive correction of step S4: For sample images severely affected by high-temperature noise, the upper limit of the preset average gray value range for gray-scale stretching is relatively high; for sample images mainly affected by vibration blurring, the upper limit of the preset average gray value range for gray-scale stretching is relatively low.

8. A system for refining and filtering dendrite detection images of cast billets and finished products, characterized in that, include: The preprocessing module is used to sequentially perform grayscale processing, illumination equalization processing, and invalid region cropping on the acquired raw dendrite detection image to obtain a preprocessed grayscale image; The layered filtering module is used to perform moving sliding window layered filtering processing on the grayscale image, including a coarse filtering unit and a fine filtering unit; The coarse filtering unit initializes the sliding window parameters based on the differences in solidification structure and defect morphology of the sample to be tested. Specifically, a larger initial sliding window size and a larger sliding step size are initialized for coarse and sparse dendrite morphology, while a smaller initial sliding window size and a smaller sliding step size are initialized for fine and dense dendrite morphology. The sliding window is moved point-by-point along the image, and the median and standard deviation of the gray values ​​of the pixels within the window are calculated. If the difference between the current pixel's gray value and the median exceeds a preset noise threshold, the current pixel value is replaced with the median. The sliding window size is dynamically adjusted based on the standard deviation. The fine filtering unit extracts the dendrite edge mask from the coarse-filtered image, dividing the dendrite edge region and the background region. A sliding window filter is applied to the background region using equal weighting coefficients, while a sliding window filter is applied to the dendrite edge region using Gaussian weighting coefficients and introducing an edge enhancement factor to strengthen the gray-level differences of the edge pixels. The resulting image is then fused to obtain the fine-filtered image. The detail enhancement module is used to perform detail enhancement processing on the finely filtered image, extract high-frequency detail features of the image, and divide the image into strong detail regions, weak detail regions, and smooth background regions. A weak detail sharpening gain is applied to the weak detail regions, and a strong detail sharpening gain is applied to the strong detail regions. The weak detail sharpening gain is greater than the strong detail sharpening gain, and the smooth background regions are not sharpened. The resulting image is a detail-enhanced image after fusion. An adaptive correction module is used to adaptively correct the detail-enhanced image by sequentially performing grayscale stretching, contrast enhancement, and pixel normalization to output the final sharpened dendritic image.

9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the method as described in any one of claims 1 to 7.