A method for detecting pollutants in high-purity quartz sand based on image recognition

By generating normalized images of quartz sand particles under different lighting conditions and calculating edge conformity and inversion consistency ratio, the problem of distinguishing between halo deposition and real pollutants in high-purity quartz sand is solved, thereby improving the accuracy and reliability of pollutant detection in high-purity quartz sand.

CN120997832BActive Publication Date: 2026-01-23BEIJING YAZE QUARTZ MATERIAL CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511528247.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-01-23
Estimated Expiration
2045-10-24

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately distinguish between annular halo deposits and actual particulate contaminants in high-purity quartz sand, which can easily lead to misjudgments and a systematic overestimation of pollution levels.

Method used

An image recognition-based method is used to generate normalized images of quartz sand particles under different lighting orientations. By calculating the edge conformity, boundary pixel ratio, and inversion consistency ratio, it is determined whether the candidate connected region of the ring is the target contamination area. Multi-dimensional quantization is performed using the illumination inversion law and color difference.

Benefits of technology

It improves the ability to distinguish between halo artifacts and real pollutants, avoids misjudgments caused by differences in lighting and color, and enhances the accuracy and reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997832B_ABST
    Figure CN120997832B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on image recognition's high-purity quartz sand in pollutant detection method, it is related to pollutant detection technical field, including: generating the first normalized image and second normalized image of quartz sand particle;Based on the first normalized image and second normalized image generation recessed flip boundary chart and global flip sign chart;To the ring characteristic extraction of first normalized image, obtain target connected domain set;Based on the ring candidate connected domain of target connected domain set and recessed flip boundary chart, calculate edge conformality degree.The application improves the accuracy of high-purity quartz sand pollutant detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pollutant detection technology, and in particular to a method for detecting pollutants in high-purity quartz sand based on image recognition. Background Technology

[0002] High-purity silica sand is widely used in high-end industries such as semiconductor manufacturing, optical fiber drawing, precision optical devices, and solar photovoltaics due to its excellent optical properties and extremely low impurity content. In these applications, even slight differences in the purity of silica sand can significantly affect the performance and reliability of the final product. Therefore, the detection and control of contaminants such as iron particles are crucial.

[0003] In actual production, high-purity quartz sand often undergoes acid washing, scrubbing, and drying processes. These processes can easily lead to the deposition of iron impurities or oxides on the surface of quartz sand particles, especially at the edges of tiny pits on the particle surface, potentially forming color-band-like deposition phenomena. These deposits typically appear as ring-shaped halos in images, closely resembling actual iron particle contaminants, significantly increasing the difficulty of detection and identification. Traditional detection methods relying on single images are easily affected by lighting direction, particle geometry, and local color differences, leading to unstable detection results or even misjudgments.

[0004] Existing technologies typically rely on manually set thresholds or image differences under unidirectional illumination to identify pollutants when addressing the aforementioned problems. This approach suffers from poor robustness and insufficient adaptability. In particular, when faced with ring-shaped halos that resemble the morphology of actual particulate pollutants, existing methods often struggle to distinguish them accurately, easily misclassifying ring-shaped deposits as independent pollutant particles, thus leading to a systematic overestimation of pollution levels. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies, which often make it difficult to accurately distinguish and easily misjudge halo deposits as independent contaminant particles, and to propose a method for detecting contaminants in high-purity quartz sand based on image recognition.

[0006] To address the problems existing in the prior art, the present invention adopts the following technical solution:

[0007] A method for detecting contaminants in high-purity quartz sand based on image recognition includes:

[0008] S1, the first and second normalized images of generated quartz sand particles;

[0009] S2. Generate a concave flip boundary map and a global flip symbol map based on the first normalized image and the second normalized image;

[0010] S3. Extract the ring feature from the first normalized image to obtain the target connected component set;

[0011] S4. Calculate the edge conformity based on the ring candidate connected regions and the concave flipped boundary graph of the target connected region set;

[0012] S5. Calculate the proportion of boundary pixels of the candidate connected components of the ring, and calculate the inversion consistency ratio based on the candidate connected components of the ring and the global inversion symbol map;

[0013] S6. Determine whether the candidate connected region of the ring is the target contaminated region based on the edge conformity, the proportion of boundary pixels, and the inversion consistency ratio.

[0014] Preferably, generating a first normalized image and a second normalized image of quartz sand particles includes:

[0015] The initial original image of the quartz sand particles is normalized to obtain the first normalized image;

[0016] The initial second original image of the quartz sand particles was normalized to obtain the second normalized image.

[0017] Preferably, generating a concave flip boundary map and a global flip symbol map based on the first normalized image and the second normalized image includes:

[0018] The first normalized image and the second normalized image are respectively converted into a first azimuth measurement image and a second azimuth brightness image;

[0019] The pixel brightness values ​​of the first azimuth measurement image and the pixel brightness values ​​of the second azimuth measurement image are calculated to obtain a brightness difference image.

[0020] The pixel brightness values ​​of the first azimuth measurement image and the pixel brightness values ​​of the second azimuth measurement image are summed to obtain the brightness and image.

[0021] The ratio of the brightness difference image and the brightness sum image is calculated to obtain the contrast lighting difference ratio.

[0022] Image stitching is performed on all the contrast lighting difference ratios to obtain contrast lighting difference ratio images;

[0023] Zero-crossing detection is performed on the contrast illumination difference ratio image to obtain zero-crossing points;

[0024] The zero-crossing points are refined to obtain the concave flip boundary map;

[0025] Gradient calculation is performed on the first azimuth brightness image to obtain the first brightness gradient image;

[0026] Gradient calculation is performed on the second-position brightness image to obtain the second brightness gradient image;

[0027] Perform a dot product operation on the first brightness gradient image and the second brightness gradient image to obtain a dot product image;

[0028] Sign determination is performed on the dot product image to obtain a globally flipped sign image.

[0029] Preferably, the loop feature is extracted from the first normalized image to obtain a set of target connected components, including:

[0030] The first normalized image is converted to a color space to obtain a chromaticity component image;

[0031] Perform a white cap operation on the chrominance component image to obtain the white cap result;

[0032] The white top hat result is binarized to obtain the thin band candidate mask;

[0033] Connected component segmentation is performed on the thin strip candidate mask to obtain multiple thin strip candidate connected components;

[0034] Geometric filtering is performed on the connected components to obtain the target set of connected components.

[0035] Preferably, the edge conformity is calculated based on the candidate connected components of the ring and the concave flipped boundary graph of the target connected component set, including:

[0036] Extract each candidate connected component of a cycle from the target connected component set;

[0037] Dilation processing is applied to the concave inverted boundary map to obtain the dilated boundary map;

[0038] The overlap degree of the boundary pixel set and the dilated boundary map of the candidate connected domain of the ring is calculated to obtain the number of conformally attached pixels;

[0039] The edge conformance is obtained by calculating the ratio of the number of conformal edge-fitting pixels to the set of boundary pixels of the candidate connected region of the ring.

[0040] Preferably, calculating the proportion of boundary pixels of the candidate connected components of the ring includes:

[0041] For each boundary pixel in the boundary pixel set of the candidate connected region of the ring, obtain the inner chromaticity value inside the boundary of the candidate connected region of the ring along the outward normal direction of the boundary pixel, and obtain the outer chromaticity value outside the boundary of the candidate connected region of the ring.

[0042] Calculate the proportion of boundary pixels whose outer chromaticity value is greater than the inner chromaticity value.

[0043] Preferably, the inversion consistency ratio is calculated based on the ring candidate connected components and the global inverted symbol graph, including:

[0044] In the set of boundary pixels in the candidate connected region of the ring, read the symbol of the corresponding boundary pixel in the global flip symbol map;

[0045] The number of pixels with a count of -1;

[0046] The inversion consistency ratio is obtained by dividing the number of pixels with a sign of -1 by the total number of pixels at the boundary.

[0047] Preferably, determining whether a candidate connected component of a ring is a target contaminated region based on edge conformity, boundary pixel ratio, and inversion consistency ratio includes:

[0048] The first threshold is obtained by performing percentile statistics on the conformal properties of the edge fitting.

[0049] The second threshold is obtained by performing percentile statistics on the proportion of boundary pixels.

[0050] The third threshold is obtained by performing percentile statistics on the inversion consistency ratio;

[0051] If the conformal degree of the edge is greater than or equal to the first threshold, and the proportion of boundary pixels is greater than or equal to the second threshold, and the inversion consistency ratio is greater than or equal to the third threshold, then the candidate connected region of the ring is determined to be a ring halo artifact region; otherwise, the candidate connected region of the ring is determined to be a target contaminated region.

[0052] Compared with the prior art, the beneficial effects of the present invention are:

[0053] 1. This invention acquires two normalized images of quartz sand particles under illumination conditions with a 180-degree difference in orientation, and generates a concave reversal boundary map and a global reversal symbol map. It effectively utilizes the light-dark reversal pattern of the concave area on the particle surface under opposing illumination, which can clearly delineate the position and shape of the concave structure. This method of extracting boundaries based on illumination reversal patterns avoids misjudgment caused by local noise or color differences under single illumination conditions, and improves the ability to identify the boundary characteristics of halo artifacts and real pollutants.

[0054] 2. This invention utilizes white-hat computing, binarization, and connected component segmentation on the chroma channel of a normalized image to extract regions that may contain ring-like characteristics. It then quantifies the geometric distribution, color differences, and gradient changes under illumination of candidate regions by calculating edge conformity, boundary pixel ratio, and inversion consistency ratio. These quantification metrics effectively identify ring-like artifact regions attached to the edges of depressions and distinguish them from irregularly distributed real contamination particles, thus solving the misjudgment problem caused by the similarity between ring-like deposition and independent particle morphology in existing technologies.

[0055] 3. This invention employs an adaptive thresholding method based on percentile statistics, setting judgment criteria for edge conformity, boundary pixel ratio, and inversion consistency ratio, thus avoiding the insufficient adaptability of traditional methods that rely on fixed thresholds. Through the joint judgment of these three indicators, if a candidate region simultaneously satisfies geometric fit, a darker outer and lighter inner color distribution, and illumination inversion characteristics, it is determined to be a halo artifact. This achieves accurate differentiation between halo artifacts and real contaminants, effectively preventing the systematic overestimation of contamination levels, thereby improving the accuracy and reliability of contaminant detection in high-purity quartz sand. Attached Figure Description

[0056] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0057] Figure 1 This is a schematic flowchart of a method for detecting contaminants in high-purity quartz sand based on image recognition, provided in an embodiment of the present invention. Detailed Implementation

[0058] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0059] Example: This example provides a method for detecting contaminants in high-purity quartz sand based on image recognition. See [link to example]. Figure 1 Specifically, including:

[0060] S1, the first and second normalized images of generated quartz sand particles;

[0061] In an embodiment of the present invention, generating a first normalized image and a second normalized image of quartz sand particles includes:

[0062] The initial original image of the quartz sand particles is normalized to obtain the first normalized image;

[0063] The initial second original image of the quartz sand particles was normalized to obtain the second normalized image.

[0064] Specifically, the initial first and second original images are raw digital image data of the surface of high-purity quartz sand particles acquired under illumination conditions differing by 180 degrees. These images reflect the true surface optical characteristics of the same quartz sand particle under opposite illumination directions. The first normalized image is obtained by unifying the brightness and color of the initial first original image. Its physical significance lies in eliminating differences in light source intensity and sensor response during acquisition, enabling the image to accurately represent the optical information of the quartz sand particle surface. The second normalized image is obtained by processing the initial second original image in the same way. Its physical significance lies in ensuring a consistent brightness and color benchmark with the first normalized image, allowing the two images, separated by 180 degrees, to be compared and analyzed in subsequent processing to reveal the differences between the surface structure of the quartz sand particles and contaminants.

[0065] Specifically, the initial first original image of the quartz sand particles is normalized to obtain a first normalized image, and the initial second original image of the quartz sand particles is normalized to obtain a second normalized image. The normalization process involves uniformly correcting the brightness and color of the acquired original images to eliminate overall deviations caused by differences in lighting conditions and sensor response, ensuring that the images acquired from both directions have a consistent reference. The first and second normalized images correspond to the surface reflection characteristics of quartz sand particles when the lighting orientation differs by 180 degrees. Under a unified brightness and color reference, subsequent differential calculations and comparative analyses can be performed. Through this processing, the comparability and reliability of the image data are guaranteed.

[0066] S2. Generate a concave flip boundary map and a global flip symbol map based on the first normalized image and the second normalized image;

[0067] In an embodiment of the present invention, generating a concave flip boundary map and a global flip symbol map based on a first normalized image and a second normalized image includes:

[0068] The first normalized image and the second normalized image are respectively converted into a first azimuth measurement image and a second azimuth brightness image;

[0069] The pixel brightness values ​​of the first azimuth measurement image and the pixel brightness values ​​of the second azimuth measurement image are calculated to obtain a brightness difference image.

[0070] The pixel brightness values ​​of the first azimuth measurement image and the pixel brightness values ​​of the second azimuth measurement image are summed to obtain the brightness and image.

[0071] The ratio of the brightness difference image and the brightness sum image is calculated to obtain the contrast lighting difference ratio.

[0072] Specifically, the first and second azimuth brightness images are single-channel brightness information images obtained by converting the first and second normalized images, respectively, reflecting the surface reflection intensity distribution of quartz sand particles under illumination azimuth differences of 180 degrees. The brightness difference image is obtained by performing a difference operation on the pixel brightness values ​​of the first and second azimuth brightness images, representing the difference in brightness at the same location under opposing illumination, thus highlighting the reflection changes caused by the uneven structure of the particle surface. The brightness sum image is obtained by summing the pixel brightness values ​​of the first and second azimuth brightness images, comprehensively reflecting the overall brightness level of the same location under two illumination directions, serving as a normalization and comparison benchmark. The opposing illumination difference ratio is obtained by calculating the ratio of the brightness difference image to the brightness sum image, measuring the degree of brightness reversal at the same location under opposing illumination in a relative manner.

[0073] Specifically, since the first and second normalized images are images of the target area acquired under opposing illumination, the brightness changes of structures such as concave boundaries under opposing illumination have specific physical laws. That is, the brightness difference can reflect the brightness change range under opposing illumination, and the sum of brightness values ​​can reflect the overall brightness basis of the area. By calculating the difference in pixel brightness values ​​between the first and second azimuth measurement images, a brightness difference image is obtained. The sum of the two is calculated to obtain a brightness sum image. Then, the ratio of the brightness difference image to the brightness sum image can highlight the relative degree of brightness change under opposing illumination. This ratio is the opposing illumination difference ratio, which can provide a quantitative basis for subsequent analysis of boundary inversion characteristics under opposing illumination.

[0074] Image stitching is performed on all the contrast lighting difference ratios to obtain contrast lighting difference ratio images;

[0075] Specifically, the contrast illumination difference ratio values ​​calculated at different pixel positions of the quartz sand particles are mapped point by point according to their corresponding spatial coordinates and arranged into a two-dimensional matrix with the same size as the original image to form a complete two-dimensional data distribution. In this process, the contrast illumination difference ratio value of each pixel is assigned to the pixel unit at the same position in the matrix, thereby realizing the reconstruction from a single set of numerical points to the overall image. Through the above mapping and stitching, the obtained contrast illumination difference ratio image can fully present the brightness reversal of the quartz sand particle surface under contrast illumination conditions, providing a unified and continuous input basis for subsequent zero-cross detection and boundary extraction.

[0076] Zero-crossing detection is performed on the contrast illumination difference ratio image to obtain zero-crossing points;

[0077] The zero-crossing points are refined to obtain the concave flip boundary map;

[0078] Specifically, firstly, a zero-crossing detection operation is performed on the contrast illumination difference ratio image: traversing each pixel in the image, for each pixel, selecting its 3×3 neighborhood, checking the contrast illumination difference ratio value of the pixels in the neighborhood, and determining whether there is a value change from positive to negative or from negative to positive that crosses zero; if there is such a value change crossing zero in the neighborhood of a pixel, then the pixel is marked as a zero-crossing point. After traversing the entire contrast illumination difference ratio image, a set of all zero-crossing points is obtained. Subsequently, the set of zero-crossing points is refined: using an iterative Hilditch refinement algorithm, the connected regions formed by the zero-crossing points are iteratively processed one by one. In each iteration, it is determined whether each zero-crossing point is a deletable pixel, and all deletable pixels are deleted; this iterative process is repeated until the region formed by the zero-crossing points is refined into continuous lines of single-pixel width, finally obtaining a concave-flip boundary map that can accurately represent the concave boundary flip position.

[0079] Specifically, the contrast-illumination difference image is a composite image obtained by combining multiple pixels with varying brightness levels under different illumination orientations after ratio processing. It comprehensively reflects the brightness reversal distribution on the surface of quartz sand particles under contrast-illumination conditions. Zero-crossing points are sets of pixels obtained by detecting the contrast-illumination difference image; they mark locations where brightness differences transition from positive to negative, corresponding to the boundaries of the geometric structure on the quartz sand particle surface. The concave reversal boundary map is a single-pixel line drawing obtained by refining the zero-crossing points. It clearly and concisely outlines the edge contours of concave areas on the quartz sand particle surface, providing a geometric benchmark for subsequent determination of the relationship between contaminants and halo artifacts.

[0080] Gradient calculation is performed on the first azimuth brightness image to obtain the first brightness gradient image;

[0081] Gradient calculation is performed on the second-position brightness image to obtain the second brightness gradient image;

[0082] Specifically, when performing gradient calculations on the first azimuth image, the Sobel operator is used to calculate the gradient components of the image in the horizontal and vertical directions sequentially. First, a horizontal gradient image is obtained by convolving the first azimuth image with a horizontal Sobel convolution kernel. Then, a vertical gradient image is obtained by convolving the first azimuth image with a vertical Sobel convolution kernel. Subsequently, the gradient values ​​of corresponding pixels in the horizontal and vertical gradient images are synthesized by taking the square root of the sum of squares to obtain the first azimuth gradient image, which reflects the strength and direction of the brightness changes at each pixel position. For the second azimuth image, the same Sobel operator and calculation process as the first azimuth image are used to obtain the horizontal and vertical gradient images respectively, and then synthesized to obtain the second azimuth gradient image.

[0083] Perform a dot product operation on the first brightness gradient image and the second brightness gradient image to obtain a dot product image;

[0084] Sign determination is performed on the dot product image to obtain a globally flipped sign image.

[0085] Specifically, when performing a dot product operation on the first and second brightness gradient images, each pixel at a corresponding position in both images is traversed. The gradient vector of the pixel in the first brightness gradient image is multiplied by the gradient vector of the corresponding pixel in the second brightness gradient image. That is, each component of the gradient vector is multiplied separately and then summed. The result of the dot product of each pair of corresponding pixels is used as the pixel value at the corresponding position in the dot product image, thus obtaining the complete dot product image. Then, the sign of the dot product image is determined. Each pixel in the dot product image is traversed again. If the pixel value is greater than zero, the sign of the pixel is determined to be positive and marked as 1. If the pixel value is less than zero, the sign of the pixel is determined to be negative and marked as -1. If the pixel value is equal to zero, the sign can be marked according to actual needs (such as default marking as 0 or further determination based on neighborhood information). Finally, a global flipped sign image that reflects the distribution of the dot product sign of the gradient vector is obtained.

[0086] Specifically, the first brightness gradient image is obtained by performing gradient operations on the brightness image in the first orientation. It reflects the direction and intensity of brightness changes on the surface of quartz sand particles under the first illumination direction, showcasing the edge characteristics of the surface's fine structure. The second brightness gradient image is obtained by performing gradient operations on the brightness image in the second orientation. It reflects the direction and intensity of brightness changes on the surface of quartz sand particles under illumination conditions that differ from the first illumination direction by 180 degrees. The dot product image is obtained by performing a dot product operation on the first and second brightness gradient images pixel by pixel. It characterizes the consistency of the brightness gradient direction at the same location under opposing illumination conditions. A positive dot product indicates that the gradient directions are basically consistent, while a negative dot product indicates that the gradient direction has reversed. The global flip symbol image is the result image formed after determining the sign of the dot product image. It visually marks which areas have had their brightness gradients reversed under opposing illumination, thus providing auxiliary evidence for identifying the concave boundaries of the quartz sand particle surface.

[0087] In general, the purpose of generating the concave inversion boundary map and the global inversion symbol map is to fully utilize the brightness reversal characteristic formed by the 180-degree difference in illumination orientation to reveal the true geometric structure of the quartz sand particle surface. By comparing two normalized images under opposing illumination, the brightness reversal pattern of the concave region on the particle surface under different illumination conditions can be effectively detected, thereby generating the concave inversion boundary map, which can clearly depict the contours of surface etching pits and microstructures. At the same time, by calculating the brightness gradient direction of the two normalized images and generating the global inversion symbol map, it is possible to visually mark which regions have a consistent gradient reversal under opposing illumination, thus providing evidence combining geometry and illumination. The advantage of this approach is that it can avoid misjudgments caused by noise or local color difference under a single illumination image, enhance the reliability of boundary extraction, and provide dual verification for the subsequent discrimination of ring candidate connected components.

[0088] S3. Extract the ring feature from the first normalized image to obtain the target connected component set;

[0089] In an embodiment of the present invention, a ring feature extraction is performed on the first normalized image to obtain a target connected component set, including:

[0090] The first normalized image is converted to a color space to obtain a chromaticity component image;

[0091] Specifically, each pixel of the first normalized image is converted from the original red, green, and blue three-channel representation to a color space with higher perceptual uniformity. During this process, luminance and chromaticity information are separated to avoid the influence of overall luminance variations on color determination. After the conversion, chromaticity component channels that characterize the red-green color difference are extracted from the new color space, and the values ​​of these components for all pixels are reconstructed into a two-dimensional matrix according to their original spatial positions, thus forming a chromaticity component image. This chromaticity component image can realistically reflect the local color shift effects on the surface of quartz sand particles caused by iron impurities.

[0092] Perform a white cap operation on the chrominance component image to obtain the white cap result;

[0093] The white top hat result is binarized to obtain the thin band candidate mask;

[0094] Specifically, when performing a white-hat operation on the chromaticity component image, a structuring element matching the width of the thin band characteristics to be extracted is first selected. This structuring element is either a rectangular or a disk-shaped element, with a size set to 5×5 pixels to 7×7 pixels to accommodate the width of the ring artifact thin bands that may exist in high-purity quartz sand. Then, this structuring element is used to perform an opening operation on the chromaticity component image. That is, the chromaticity component image is first eroded to remove small bright noise, and then the eroded image is dilated to restore the overall shape of the target area. After the opening operation is completed, the original chromaticity component image is subtracted from the opening operation result, and the resulting difference image is the white-hat result. This result can effectively highlight the thin band characteristics in the chromaticity component image where the brightness is higher than the surrounding area, while suppressing interference from the background and large bright areas. When binarizing the white cap result, first calculate the median of all pixel values ​​in the white cap result, then calculate the median absolute deviation based on the median, and use the sum of the median and 1.5 times the median absolute deviation as the binarization threshold; traverse each pixel in the white cap result, if the pixel value is greater than or equal to the binarization threshold, mark the pixel as a foreground pixel and assign it a value of 255, if the pixel value is less than the binarization threshold, mark the pixel as a background pixel and assign it a value of 0. After traversal, a thin strip candidate mask is obtained that retains only the thin strip foreground region.

[0095] Specifically, the chromaticity component image is a single-channel image obtained by converting the first normalized image from its original color space to a chromaticity-dominated color space. Its purpose is to highlight the color differences on the surface of quartz sand particles caused by iron impurities, allowing color characteristics to be displayed independently. The white cap result is an image obtained by performing a morphological white cap operation on the chromaticity component image. Its purpose is to remove large, uniform areas and highlight bright, thin bands within localized areas, thereby enhancing the contrast between potential contaminant rings and the background. The band candidate mask is an image obtained by binarizing the white cap result. Its purpose is to distinguish regions that may contain ring-like characteristics from other regions, forming an initial range of candidate targets and laying the foundation for subsequent connected component segmentation and ring candidate determination.

[0096] Connected component segmentation is performed on the thin strip candidate mask to obtain multiple thin strip candidate connected components;

[0097] Geometric filtering is performed on the connected components to obtain the target set of connected components.

[0098] Specifically, when performing connected component segmentation on the thin strip candidate mask, the 8-neighborhood connectivity analysis method is used. First, all pixels in the thin strip candidate mask are traversed. When a foreground pixel with a pixel value of 255 is detected and is not labeled, the connected component labeling process is started. This pixel and all consecutive foreground pixels in its 8 neighborhoods are divided into the same connected component, and a unique label is assigned to each independent connected component. After the traversal is completed, the foreground pixels in the thin strip candidate mask are divided into multiple unconnected thin strip candidate connected components according to different label, and the pixel coordinate set of each thin strip candidate connected component is recorded. When performing geometric filtering on connected components, the core geometric parameters of each thin-band candidate connected component are first calculated. The area parameter is obtained by counting the total number of pixels contained in each connected component, and the area filtering range is set to 10 pixels to 200 pixels to exclude excessively small noise areas and excessively large non-target areas. The fineness parameter is calculated by dividing the square of the perimeter by the product of 4π and the area, and the fineness threshold is set to be greater than 3.5 to filter connected components with a thin-band shape. The roundness parameter is calculated by dividing the product of 4π and the area by the square of the perimeter, and the roundness threshold is set to be less than 0.6 to exclude near-circular non-thin-band areas. Then, each thin-band candidate connected component is verified to see if it simultaneously meets the filtering conditions of area, fineness, and roundness. All thin-band candidate connected components that meet the conditions are summarized to obtain the target connected component set.

[0099] Specifically, the thin-band candidate mask is a set of regions obtained by binarizing the white-hat results, used to mark areas on the surface of quartz sand particles that may have annular or band-shaped chromatic anomalies. The thin-band candidate connected region is a set of independent pixel regions obtained after connectivity analysis of the thin-band candidate mask, used to group interconnected candidate pixels into a single region to represent a complete suspected annular structure. The target connected region set is a set of regions obtained after further geometric feature filtering of multiple thin-band candidate connected regions. Its physical significance lies in eliminating noisy regions that do not conform to the characteristics of an annular morphology, retaining only valid candidate regions that may truly correspond to annular artifacts or real contaminants.

[0100] S4. Calculate the edge conformity based on the ring candidate connected regions and the concave flipped boundary graph of the target connected region set;

[0101] In an embodiment of the present invention, the edge conformity is calculated based on the ring candidate connected regions and the concave flipped boundary graph of the target connected region set, including:

[0102] Extract each candidate connected component of a cycle from the target connected component set;

[0103] Dilation processing is applied to the concave inverted boundary map to obtain the dilated boundary map;

[0104] Specifically, when extracting the candidate ring connected components from the target connected component set one by one, the unique identifier label of each connected component in the target connected component set is read first. Each connected component is extracted in ascending order of the identifier label. At the same time, the complete pixel coordinate information of each extracted candidate ring connected component is recorded, including the row coordinates and column coordinates of all pixels in the connected component, as well as the set of boundary pixel coordinates of the candidate ring connected component obtained by the edge detection algorithm, so as to provide basic data support for subsequent calculation of edge conformity. When dilating the concave-flipped boundary map, a 3×3 square structuring element is first selected. The center pixel of this structuring element is the foreground pixel, and its eight surrounding neighboring pixels are also foreground pixels, which can effectively cover the neighborhood range of the boundary pixels in the concave-flipped boundary map. Then, this structuring element is used to perform morphological dilation operations on the concave-flipped boundary map. That is, the concave-flipped boundary map is traversed pixel by pixel through the structuring element. When the center pixel of the structuring element coincides with the foreground pixel (boundary pixel) in the concave-flipped boundary map, all pixels within the coverage area of ​​the structuring element are marked as foreground pixels. After the traversal is completed, an expanded boundary map with an enlarged boundary range that can tolerate pixel-level positional deviations is obtained. This expanded boundary map can avoid the situation where the overlap between the boundary of the candidate connected component of the ring and the concave boundary is missed due to small errors in the positioning of the boundary pixels in the concave-flipped boundary map.

[0105] The overlap degree of the boundary pixel set and the dilated boundary map of the candidate connected domain of the ring is calculated to obtain the number of conformally attached pixels;

[0106] The edge conformance is obtained by calculating the ratio of the number of conformal edge-fitting pixels to the set of boundary pixels of the candidate connected region of the ring.

[0107] Specifically, when calculating the number of conformal edge-fitting pixels, the boundary pixel set of the candidate connected region of the ring is first retrieved. This set contains the row and column coordinates of all pixels on the boundary of the candidate connected region of the ring. Simultaneously, the dilated boundary map is read, where foreground pixels represent the pixels after the concave boundary is dilated and are assigned a value of 255, while background pixels are assigned a value of 0. Then, each pixel in the boundary pixel set of the candidate connected region of the ring is traversed, and the corresponding pixel position is located in the dilated boundary map based on the coordinates of each pixel. It is determined whether the pixel value at that position is 255. If it is 255, the boundary pixel is determined to coincide with the concave boundary in the dilated boundary map. The number of all pixels determined to coincide is counted, and this number is the number of conformal edge-fitting pixels. When calculating the conformal fitting degree, the total number of pixels in the boundary pixel set of the candidate connected region of the ring is first counted. Then, the number of conformal edge-fitting pixels is divided by the total number of boundary pixels. Four decimal places are retained during the calculation to ensure precision. The resulting quotient is the conformal fitting degree, which quantifies the degree of fit between the boundary of the candidate connected region of the ring and the concave boundary.

[0108] Specifically, the ring candidate connected region is a candidate region with closed-loop characteristics selected from the target connected region set. It represents a local area on the surface of quartz sand particles where ring artifacts or real contaminants may form. The dilated boundary map is a boundary expansion image obtained by morphologically dilating the concave inverted boundary map. It expands the boundary lines outward to accommodate deviations caused by pixel discrepancies or detection errors, thereby ensuring the stability of boundary matching. The conformal edge-fitting pixel count refers to the number of pixels whose boundary pixel set of the ring candidate connected region coincides with the dilated boundary map. It reflects the degree of fit between the boundary of the ring candidate region and the concave boundary. The edge conformance is a ratio calculated by dividing the conformal edge-fitting pixel count by the total number of boundary pixels of the ring candidate connected region. It quantitatively indicates whether the boundary of the ring candidate region is distributed along the concave edge; a higher value indicates a higher likelihood of a ring artifact.

[0109] Specifically, from the calculation logic of edge conformance, this index is obtained by statistically analyzing the number of overlapping pixels of the boundary of the candidate ring region with the dilated concave boundary (dilated boundary map), and then dividing by the total number of pixels of the candidate ring boundary. If the candidate ring region is a ring halo artifact region, because it is generated attached to the concave edge, its boundary will overlap with the dilated concave boundary in large numbers, resulting in a high proportion of conformal edge-fitting pixels and thus a high edge conformance. If the candidate ring region corresponds to a real pollutant, because it is not attached to the concave edge, the number of overlapping pixels with the concave boundary is small, resulting in a low edge conformance. Therefore, edge conformance can quantitatively reflect the degree to which the boundary of the candidate ring region is distributed along the concave edge, and the higher the value, the more the candidate ring conforms to the essential characteristic of ring halo artifacts attached to the concave boundary, and the more likely it is to be a ring halo artifact.

[0110] S5. Calculate the proportion of boundary pixels of the candidate connected components of the ring, and calculate the inversion consistency ratio based on the candidate connected components of the ring and the global inversion symbol map;

[0111] In an embodiment of the present invention, calculating the proportion of boundary pixels of a candidate connected region of a ring includes:

[0112] For each boundary pixel in the boundary pixel set of the candidate connected region of the ring, obtain the inner chromaticity value inside the boundary of the candidate connected region of the ring along the outward normal direction of the boundary pixel, and obtain the outer chromaticity value outside the boundary of the candidate connected region of the ring.

[0113] Calculate the proportion of boundary pixels whose outer chromaticity value is greater than the inner chromaticity value.

[0114] Specifically, first, the set of boundary pixels of the candidate connected component of the ring and the chroma component image obtained by color space conversion of the first normalized image are retrieved. Then, each boundary pixel in the set of boundary pixels is traversed. For each boundary pixel, the boundary tangent direction is calculated using the coordinates of its two adjacent boundary pixels. Next, the outward normal of the pixel is determined based on the perpendicular direction of the tangent, and this outward normal points outward from the candidate connected component of the ring. Then, based on the outward normal direction, the coordinates of the current boundary pixel are offset by 1 pixel unit inward from the candidate connected component of the ring to determine the inner sampling point. The corresponding coordinates of this inner sampling point in the chroma component image are then read. The pixel value is used as the inner chromaticity value. At the same time, the coordinates of the current boundary pixel are offset by 1 pixel unit outside the connected component pointed to by the outward normal to determine the outer sampling point. The pixel value corresponding to the outer sampling point in the chromaticity component image is read as the outer chromaticity value. After obtaining the inner and outer chromaticity values ​​of all boundary pixels, the number of boundary pixels with outer chromaticity values ​​greater than inner chromaticity values ​​is counted. Then, this counted number is divided by the total number of pixels in the boundary pixel set of the candidate connected component of the ring. Three decimal places are retained in the calculation process to ensure quantization accuracy. The result is the proportion of boundary pixels with outer chromaticity values ​​greater than inner chromaticity values.

[0115] Specifically, the inner chromaticity value is the chromaticity value sampled along the outward normal direction of the boundary pixels, reflecting the color characteristics inside the ring candidate region. The outer chromaticity value is the chromaticity value sampled along the outward normal direction of the boundary pixels, reflecting the color characteristics of the adjacent area outside the ring candidate region. The boundary pixel ratio is obtained by counting the number of pixels with outer chromaticity values ​​greater than inner chromaticity values ​​among all boundary pixels and dividing by the total number of boundary pixels. It quantitatively characterizes whether the ring candidate region exhibits a color distribution characteristic of being darker on the outside and lighter on the inside. The higher this ratio, the more it conforms to the typical pattern of ring halo artifacts deposited along the concave boundary.

[0116] In embodiments of the present invention, the calculation of the inversion consistency ratio based on the ring candidate connected component and the global inverted symbol graph includes:

[0117] In the set of boundary pixels in the candidate connected region of the ring, read the symbol of the corresponding boundary pixel in the global flip symbol map;

[0118] The number of pixels with a count of -1;

[0119] The inversion consistency ratio is obtained by dividing the number of pixels with a sign of -1 by the total number of pixels at the boundary.

[0120] Specifically, the boundary pixel set contains the row and column coordinates of each boundary pixel. The values ​​of 1, -1, or 0 for each pixel in the global inverted symbol map correspond to different gradient sign characteristics. Each boundary pixel in the boundary pixel set of the candidate connected region of the ring is traversed one by one. Based on the row and column coordinates of each boundary pixel, the corresponding pixel position in the global inverted symbol map is found, and the sign value of the pixel at that position is read. During the reading process, if a pixel with a sign value of 0 is encountered, it can be set to not be included in the statistical range according to the actual detection requirements. After reading the sign values ​​of all boundary pixels, the number of pixels with a sign value of -1 is counted. At the same time, the total number of boundary pixels in the boundary pixel set of the candidate connected region of the ring that participated in the sign value reading is counted. The number of pixels with a sign value of -1 is divided by the total number of boundary pixels. Three decimal places are retained in the calculation to ensure quantization accuracy. The quotient obtained is the inversion consistency ratio.

[0121] Specifically, the inversion consistency ratio characterizes whether the brightness gradient of the ring candidate region's boundary is completely reversed under opposing illumination conditions. Since the concave boundaries on the surface of quartz sand particles exhibit completely opposite brightness directions under illumination at 180-degree intervals, a high inversion consistency ratio for a ring candidate region indicates that the boundary of that region is highly consistent with the concave boundary, and is more likely to correspond to a ring halo artifact.

[0122] S6. Determine whether the candidate connected region of the ring is the target contaminated region based on the edge conformity, the proportion of boundary pixels, and the inversion consistency ratio.

[0123] In embodiments of the present invention, determining whether a candidate connected region of a ring is a target contaminated region based on edge conformity, boundary pixel ratio, and inversion consistency ratio includes:

[0124] The first threshold is obtained by performing percentile statistics on the conformal properties of the edge fitting.

[0125] The second threshold is obtained by performing percentile statistics on the proportion of boundary pixels.

[0126] The third threshold is obtained by performing percentile statistics on the inversion consistency ratio;

[0127] Specifically, at least 50 sets of high-purity quartz sand samples with different levels of contamination and artifact distributions are collected. For each set of samples, the detection of candidate connected components of rings and the calculation of related parameters are completed according to the aforementioned steps. The edge conformity value, boundary pixel ratio value, and inversion consistency ratio value corresponding to all candidate connected components of rings in each set of samples are recorded, forming three independent data sets: the edge conformity value set, the boundary pixel ratio value set, and the inversion consistency ratio value set. When processing the edge conformity value set, all values ​​in the set are first sorted in ascending order. The position index corresponding to the 75th percentile is calculated based on the total number of values ​​in the set. The position index is obtained by multiplying the total number of values ​​by 0.75. If the calculation result is an integer, the edge conformity value corresponding to the integer index position is taken as the first threshold. If the calculation result is an integer, the edge conformity value is taken as the first threshold. If the result is a non-integer, the average of the edge conformance values ​​corresponding to the two integer positions adjacent to the non-integer index is taken as the first threshold. For the set of boundary pixel proportion values, the same processing procedure as the edge conformance value set is adopted. First, all values ​​are sorted in ascending order, and the position index corresponding to the 75th percentile is calculated. The second threshold is obtained by determining whether the position index is an integer or the value of the corresponding position or the average of adjacent values. For the set of inverted consistency proportion values, the same steps of ascending sorting, calculating the 75th percentile position index, and determining the threshold are followed to obtain the third threshold. In the entire percentile statistics process, all numerical calculations are retained to four decimal places to ensure the accuracy of the threshold. If there are abnormal extreme values ​​in any set of values, the outliers must be removed by the interquartile range method before sorting and percentile calculation to avoid abnormal data interfering with the accuracy of the threshold.

[0128] If the conformal degree of the edge is greater than or equal to the first threshold, and the proportion of boundary pixels is greater than or equal to the second threshold, and the inversion consistency ratio is greater than or equal to the third threshold, then the candidate connected region of the ring is determined to be a ring halo artifact region; otherwise, the candidate connected region of the ring is determined to be a target contaminated region.

[0129] Specifically, since edge conformance can quantitatively reflect the distribution degree of ring candidate connected domain boundaries along the concave edge, the boundary pixel ratio can reflect the distribution characteristics of chromaticity differences between the inner and outer sides of the ring candidate boundary, and the inversion consistency ratio can characterize the inversion law of gradient sign under opposing illumination, and all three are key indicators extracted based on the essence of ring halo artifacts "attaching to concave boundaries and exhibiting specific chromaticity and gradient characteristics due to optical properties"; during the judgment, the edge conformance, boundary pixel ratio, and inversion consistency ratio values ​​corresponding to each ring candidate connected domain are extracted one by one and compared with the first value obtained in advance through percentile statistics. The threshold, second threshold, and third threshold are compared. If the conformity of the candidate connected region of the ring is greater than or equal to the first threshold, the proportion of boundary pixels is greater than or equal to the second threshold, and the inversion consistency proportion is greater than or equal to the third threshold, it indicates that it conforms to the characteristics of ring halo artifacts in terms of boundary conformity, chromaticity difference distribution, and gradient inversion law, and is therefore determined to be a ring halo artifact region. Conversely, if any one of the three indicators does not meet the corresponding threshold, it indicates that it does not have all the characteristics of ring halo artifacts and is more consistent with the random distribution and characteristics of real pollutants, and is therefore determined to be a target pollution region.

[0130] Specifically, the ring-shaped artifact region refers to a thin, ring-shaped color band formed in a quartz sand sample image due to the deposition of iron impurities along the edges of tiny etched pits or depressions on the particle surface during cleaning or drying. This region typically exhibits a boundary that closely adheres to the depression's inversion boundary, with a color distribution showing a pattern of darker outer areas and lighter inner areas. Furthermore, under opposing lighting conditions, the brightness gradient of the boundary pixels is completely reversed. Essentially, it is not an independent particle but rather an optical artifact attached to the depression boundary. The target contamination region, on the other hand, refers to a candidate region in a quartz sand sample image that does not exhibit ring-shaped artifact characteristics after joint thresholding based on edge conformity, boundary pixel ratio, and inversion consistency ratio. This region's boundary does not adhere to the depression's inversion boundary, its color distribution does not exhibit the pattern of darker outer areas and lighter inner areas, and it does not meet the characteristic of a complete brightness gradient reversal under opposing lighting conditions. It can characterize the actual independent iron particle contaminants present on the quartz sand sample surface and is the true contamination region that ultimately needs to be detected and statistically analyzed.

[0131] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting contaminants in high-purity quartz sand based on image recognition, characterized in that, Includes the following steps: S1, the first and second normalized images of generated quartz sand particles; S2. Generate a concave flip boundary map and a global flip symbol map based on the first normalized image and the second normalized image; The first normalized image and the second normalized image are respectively converted into a first azimuth measurement image and a second azimuth brightness image; The pixel brightness values ​​of the first azimuth measurement image and the pixel brightness values ​​of the second azimuth measurement image are calculated to obtain a brightness difference image. The pixel brightness values ​​of the first azimuth measurement image and the pixel brightness values ​​of the second azimuth measurement image are summed to obtain the brightness and image. The ratio of the brightness difference image and the brightness sum image is calculated to obtain the contrast lighting difference ratio. Image stitching is performed on all the contrast lighting difference ratios to obtain contrast lighting difference ratio images; Zero-crossing detection is performed on the contrast illumination difference ratio image to obtain zero-crossing points; The zero-crossing points are refined to obtain the concave flip boundary map; Gradient calculation is performed on the first azimuth brightness image to obtain the first brightness gradient image; Gradient calculation is performed on the second-position brightness image to obtain the second brightness gradient image; Perform a dot product operation on the first brightness gradient image and the second brightness gradient image to obtain a dot product image; Sign determination is performed on the dot product image to obtain a globally flipped sign image; S3. Extract the ring feature from the first normalized image to obtain the target connected component set; S4. Calculate the edge conformity based on the ring candidate connected regions and the concave flipped boundary graph of the target connected region set; Extract each candidate connected component of a cycle from the target connected component set; Dilation processing is applied to the concave inverted boundary map to obtain the dilated boundary map; The overlap degree of the boundary pixel set and the dilated boundary map of the candidate connected domain of the ring is calculated to obtain the number of conformally attached pixels; The edge conformance is obtained by calculating the ratio of the number of conformal edge-fitting pixels to the set of boundary pixels of the candidate connected components of the ring. S5. Calculate the proportion of boundary pixels of the candidate connected components of the ring, and calculate the inversion consistency ratio based on the candidate connected components of the ring and the global inversion symbol map; S6. Determine whether the candidate connected region of the ring is the target contaminated region based on the edge conformity, the proportion of boundary pixels, and the inversion consistency ratio.

2. The method for detecting contaminants in high-purity quartz sand based on image recognition according to claim 1, characterized in that, The first and second normalized images of the generated quartz sand particles include: The initial original image of the quartz sand particles is normalized to obtain the first normalized image; The initial second original image of the quartz sand particles was normalized to obtain the second normalized image.

3. The method for detecting contaminants in high-purity quartz sand based on image recognition according to claim 1, characterized in that, The loop feature is extracted from the first normalized image to obtain the target connected component set, including: The first normalized image is converted to a color space to obtain a chromaticity component image; Perform a white cap operation on the chrominance component image to obtain the white cap result; The white top hat result is binarized to obtain the thin band candidate mask; Connected component segmentation is performed on the thin strip candidate mask to obtain multiple thin strip candidate connected components; Geometric filtering is performed on the connected components to obtain the target set of connected components.

4. The method for detecting contaminants in high-purity quartz sand based on image recognition according to claim 1, characterized in that, Calculate the proportion of boundary pixels of candidate connected components of a ring, including: For each boundary pixel in the boundary pixel set of the candidate connected region of the ring, obtain the inner chromaticity value inside the boundary of the candidate connected region of the ring along the outward normal direction of the boundary pixel, and obtain the outer chromaticity value outside the boundary of the candidate connected region of the ring. Calculate the proportion of boundary pixels whose outer chromaticity value is greater than the inner chromaticity value.

5. The method for detecting contaminants in high-purity quartz sand based on image recognition according to claim 4, characterized in that, The inversion consistency ratio is calculated based on the candidate connected components of the ring and the global inverted symbol graph, including: In the set of boundary pixels in the candidate connected region of the ring, read the symbol of the corresponding boundary pixel in the global flip symbol map; The number of pixels with a count of -1; The inversion consistency ratio is obtained by dividing the number of pixels with a sign of -1 by the total number of pixels at the boundary.

6. The method for detecting contaminants in high-purity quartz sand based on image recognition according to claim 1, characterized in that, Determining whether a candidate connected region of a ring is a target contaminated region based on edge conformity, boundary pixel ratio, and inversion consistency ratio includes: The first threshold is obtained by performing percentile statistics on the conformal properties of the edge fitting. The second threshold is obtained by performing percentile statistics on the proportion of boundary pixels. The third threshold is obtained by performing percentile statistics on the inversion consistency ratio; If the conformal degree of the edge is greater than or equal to the first threshold, and the proportion of boundary pixels is greater than or equal to the second threshold, and the inversion consistency ratio is greater than or equal to the third threshold, then the candidate connected region of the ring is determined to be a ring halo artifact region; otherwise, the candidate connected region of the ring is determined to be a target contaminated region.

Citation Information

Patent Citations

  • Image recognition method and system for stone slab crack detection

    CN120339184A

  • Remote sensing sewage area identification method and system based on graph structure and multi-stage enhancement

    CN120726484A