Visual detection system and equipment for grinding wheel
By detecting surface defects on grinding wheels in polar coordinates and utilizing threshold segmentation and density analysis, the problem of surface texture influence on grinding wheels was solved, achieving high-precision defect detection and quality assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHENGZHOU JUKUN MEASUREMENT & CONTROL TECHNOLOGY CO LTD
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies neglect the inherent uneven texture of the grinding wheel surface in the detection of surface defects, resulting in a high misjudgment rate and difficulty in consistently and accurately detecting material spot defects.
Using image processing methods in polar coordinates, local and global density indices are determined through threshold segmentation and density analysis. Combined with sparsity evaluation and gray-level entropy difference, candidate defect areas are screened and overall defect indices are determined, thus achieving automatic detection of grinding wheels.
It significantly reduced the false positive rate, improved the detection rate of real defects, provided an objective quality score, and achieved a leap from qualitative to quantitative detection.
Smart Images

Figure CN122048909A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of grinding wheel inspection technology, and specifically to a visual inspection system and equipment for grinding wheels. Background Technology
[0002] As a key grinding tool in industrial manufacturing, the quality of grinding wheels directly affects the precision, surface finish, production efficiency, and even the safety of operators. Traditional manual visual inspection methods are inefficient, subjective, inconsistent, and prone to fatigue-related omissions, failing to meet the quality and efficiency requirements of modern industrial production.
[0003] With the development of machine vision technology, image-based automatic detection technology is gradually being applied to the detection of surface defects on grinding wheels. Existing technologies typically employ methods such as threshold segmentation, edge detection, or template matching with fixed features. However, when applied to the detection of material spots on grinding wheels, these methods often overlook the fact that the surface of the grinding wheel itself is composed of countless abrasive grains and binders. The surface of the grinding wheel exhibits inherent, uneven textures and voids, which are objective physical laws. These methods struggle to reliably and accurately detect the true material spot defect areas from this complex background texture that varies with grit size. Summary of the Invention
[0004] To address the technical problem that methods such as threshold segmentation, edge detection, or template matching with fixed features neglect the inherent and uneven texture of the grinding wheel surface, resulting in a high misjudgment rate of defective areas, this invention provides a visual inspection system and device for grinding wheels. The specific technical solution adopted is as follows: This invention proposes a visual inspection system for grinding wheels, the system comprising: The image processing module is used to acquire images of the abrasive ring area of the grinding wheel and map them to a preset polar coordinate system; it performs threshold segmentation on the image to obtain multiple foreground connected regions; The density analysis module is used to extract the polar coordinates of the centroids of each foreground connected component; determine the local density index of each connected component based on the polar coordinates of the centroids of its neighboring connected components that satisfy the preset proximity conditions; and determine the global density index based on the local density indices of all connected components. The sparsity evaluation module is used to filter out candidate connected components whose local density index is lower than the global density index; based on the candidate connected components and their neighboring connected components, candidate defect regions are delineated in the image; and the sparsity evaluation value is determined according to the number of pixels in the candidate defect region, the local density index of the associated candidate connected components, and the area. The determination module is used to determine the regional defect index based on the sparse evaluation value of the candidate defect region, the difference between the gray-level entropy of the candidate defect region and the preset background reference entropy; and to mark the region with the regional defect index exceeding the preset threshold as the target defect region. The detection module is used to determine the overall defect index based on the number of pixels in the image, the number of pixels in the target defect area, and the regional defect index; and to detect the passability of the grinding wheel based on the overall defect index.
[0005] Furthermore, the geometric center of the abrasive ring region image is taken as the pole of the polar coordinate system; and a preset physical reference direction is taken as the polar axis of the polar coordinate system; the method further includes: The position coordinates of each pixel in the abrasive ring region image in the Cartesian coordinate system; Calculate the distance between the pixel's position coordinates and the pole, and use the distance as the polar radius of the pixel in the polar coordinate system; Calculate the angle from the polar axis to the direction where the pixel is located, and use the angle as the polar angle value of the pixel in the polar coordinate system; The coordinates of a pixel in the polar coordinate system are determined based on its polar radius and polar angle values.
[0006] Furthermore, the thresholding of the image to obtain multiple foreground connected components includes: A preset threshold segmentation algorithm is used to determine the segmentation threshold. Pixels with gray values lower than the segmentation threshold in the image are classified as foreground pixels. Connectivity analysis is then performed on the foreground pixels to obtain multiple foreground connected components.
[0007] Furthermore, the process for determining neighboring connected components that satisfy preset proximity conditions includes: For each connected component, obtain the angle between the centroid of the connected component and the centroids of other connected components in the polar coordinate system, as well as the absolute difference of the polar radius in the polar coordinate system. If the included angle is less than the preset critical angle, calculate the cosine function value of the included angle; based on the absolute difference of the polar radius and the cosine function value, calculate the effective distance value between the connected component and other corresponding connected components; If the included angle is not less than the preset critical angle, the effective distance value between the connected component and other corresponding connected components is determined to be invalid or infinite. Sort all the calculated effective distance values in ascending order to form a distance sequence; select the first preset number of other connected components from the sorted distance sequence as the neighboring connected components of the connected component. Among them, effective distance values that are considered invalid or infinite are placed at the end of the distance sequence during sorting.
[0008] Furthermore, the process of determining the local density index includes: Calculate the arithmetic mean of the effective distances between a connected component and each of its neighboring connected components, and use this as the average distance. Get the first number of pixels contained in the connected component; Calculate the product of the average distance and the first quantity, and use it as the first intermediate value; The value of the exponential function with the natural constant as the base and the first intermediate negative value as the exponent is calculated as a local density index.
[0009] Further, the step of delineating candidate defect regions in the image based on candidate connected components and their neighboring connected components includes: Using the candidate connected component as the center, obtain all target neighbor connected components that satisfy the local density index being lower than the global density index; In the Cartesian coordinate system, extract the centroid coordinates of the candidate connected domain and the target neighboring connected domain; Using all extracted centroids as vertices, calculate the minimum convex polygon that encloses all vertices; Within the image area covered by the smallest convex polygon, the region consisting of all pixels that do not belong to any foreground connected region is defined as the candidate defect region.
[0010] Further, determining the sparsity evaluation value based on the number of pixels within the candidate defect region, the local density index of the associated candidate connected components, and the area includes: For each candidate defect region, obtain the target candidate connected component and its target neighbor connected component associated with the candidate defect region; Calculate the arithmetic mean of the local density indices of the target candidate connected regions and their target neighboring connected regions associated with the candidate defective regions, as the density index mean; and calculate the difference between the global density index and the density index mean, as the average density loss value. Calculate the average area of all target candidate connected components and their target neighbor connected components; calculate the ratio of the number of pixels in the candidate defect region to the average area, and use it as the first ratio. Divide the first ratio by the sum of the global density index and the positive integer 1 to obtain the relative area ratio. The product of the average density loss value and the relative area ratio is calculated as the sparsity evaluation value of the candidate defective region.
[0011] Furthermore, the process for determining the regional defect index includes: Obtain a preset background reference entropy that characterizes the uniformity of grayscale distribution in normal background regions; For each candidate defect region, calculate the internal gray-level entropy of the candidate defect region; calculate the entropy difference between the internal gray-level entropy and the preset background reference entropy; and perform non-negativity processing on the entropy difference value, wherein the non-negativity processing includes retaining the entropy difference value if the entropy difference value is positive or zero; and replacing the entropy difference value with zero if the entropy difference value is negative. The product of the sparse evaluation value and the entropy difference value of the candidate defect region is normalized to obtain the regional defect index.
[0012] Furthermore, the process for determining the overall defect index includes: All target defect areas identified in the front and back images of the grinding wheel are compiled to form a global defect list; For each target defect region in the global defect list, the number of pixels in the target defect region is weighted by the sum of the region defect index and the positive integer 1, and the weighted number of the target defect region is obtained. Calculate the sum of the weighted counts of all target defect areas as the total weighted count; Divide the total weighted number by the total number of pixels in the abrasive ring area on one side of the grinding wheel to obtain the overall defect index.
[0013] A visual inspection device for grinding wheels includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of a visual inspection system for grinding wheels.
[0014] The present invention has the following beneficial effects: This invention establishes a polar coordinate system and analyzes the distribution density of the foreground connected domain to determine an adaptive local density index and a global density index. The global density index is used as a texture density benchmark to locate sparse texture regions, enabling the detection algorithm to deeply analyze the texture density level of the current grinding wheel. This effectively overcomes the interference of the inherent texture and voids of the grinding wheel itself, significantly improving the ability to extract real defect signals from complex backgrounds. First, the sparsity evaluation value is used to analyze texture sparsity to locate suspicious candidate defect regions. Then, the uniformity of grayscale distribution within the candidate defect regions is combined with... Cross-validation is performed using the difference between the internal grayscale entropy and the background reference entropy. This comprehensive approach ensures that only areas exhibiting abnormalities in both texture distribution and internal structure are identified as material spots, significantly reducing the probability of misjudging normal texture gaps and reflections as defects, while ensuring the detection rate of true defects. The overall defect index integrates the area, severity, and spatial distribution of defective regions, providing an objective and quantitative quality score for each grinding wheel. This score not only serves as an objective basis for subsequent pass / fail determination but also represents a leap from qualitative testing to quantitative analysis. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. 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.
[0016] Figure 1 This is a schematic diagram of a visual inspection system for grinding wheels provided in one embodiment of the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a visual inspection system and device for grinding wheels proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0019] The following description, in conjunction with the accompanying drawings, details a specific solution for a visual inspection system and equipment for grinding wheels provided by the present invention.
[0020] Please see Figure 1 The diagram illustrates a visual inspection system for grinding wheels according to an embodiment of the present invention. The system includes: The image processing module 101 is used to acquire images of the abrasive ring area of the grinding wheel and map them to a preset polar coordinate system; and to perform threshold segmentation on the image to obtain multiple foreground connected regions.
[0021] It is important to understand that since the material spot is usually present in the abrasive layer, the chuck and the background area have completely different texture and grayscale characteristics. Therefore, if the chuck and the background area are also taken into account, it will seriously interfere with all subsequent algorithms such as threshold segmentation and texture density analysis, leading to fundamental errors.
[0022] To acquire images of the abrasive ring area, for example, high-resolution images of both sides of the grinding wheel are acquired using an industrial camera and specific lighting. After acquisition, preprocessing is performed first, that is, the region of interest (ROI) containing only the abrasive ring is precisely segmented from the original image, and the background and metal chuck are removed.
[0023] It should be noted that the extraction of the region of interest (ROI) in an image is a technique well known to those skilled in the art, and will not be described in detail in this embodiment.
[0024] It is important to understand that, because the normal surface of a grinding wheel is usually full of abrasive recesses, it will form a large number of small shadows under low-angle light. The overall image will present a texture with light and dark contrast, mainly in medium to low grayscale. On the other hand, material spots are raised hard lumps. Under low-angle light, the top of them reflects light directly, forming a small area of high brightness, while blocking the recesses below them. This eliminates the original shadows of the grinding wheel, making the texture of the area where the grinding wheel is located disappear, becoming relatively flat and brighter overall. Therefore, in order for the abrasive recesses on the surface of the grinding wheel to form clear shadows, they are represented as low grayscale areas in the image; while the raised material spots are represented as high grayscale areas due to frontal reflection. In order to establish a stable and interpretable contrast between the raised and recessed areas in the image, this invention requires specific lighting, such as low-angle ring light or coaxial light.
[0025] It's important to understand that the abrasive layer on a grinding wheel is a standard ring shape. While Cartesian coordinates are suitable for handling rectangular areas, polar coordinates are naturally suited for circular and toroidal problems. Furthermore, it's understandable that in polar coordinates, analysis along the polar radius corresponds to radial uniformity testing of the grinding wheel, and analysis along the polar angle corresponds to circumferential uniformity testing. Therefore, to simplify subsequent quantitative analysis of texture distribution uniformity and to ensure a consistent analytical benchmark between different grinding wheels and between the front and back sides of the same grinding wheel, the image can be mapped to a preset polar coordinate system.
[0026] In this embodiment, the geometric center of the abrasive ring region image is taken as the pole of the polar coordinate system; and a preset physical reference direction is taken as the polar axis of the polar coordinate system.
[0027] It should be noted that the system uses image processing algorithms (such as contour fitting or Hough circle transform) to calculate the center of the concentric circles at the inner and outer boundaries of the abrasive ring region. This center is established as the pole of the polar coordinate system. The method for calculating the center of the concentric circles is a publicly available technique and will not be described in detail in this embodiment.
[0028] Since the rotation angle of the grinding wheel is random each time it is loaded, in order to avoid the situation where the zero-degree position of the grinding wheel may be different in two tests, resulting in the inability to compare and reproduce the analysis results, it is necessary to provide a constant and absolute angular reference system for the entire abrasive ring area. For example, identify a physical mark (such as a specific pin hole, engraving, or color block) that is pre-set and clearly set on the grinding wheel chuck or fixture, construct a line connecting the pole to the center of the physical mark, and define the direction of the line as the preset physical reference direction, which is the polar axis of the polar coordinate system.
[0029] It can be understood that the direction of the polar axis is set as the 0-degree reference of the polar angle. The polar angle value of any point in the image (that is, the angle traversed by rotating counterclockwise from the polar axis to the direction where the point is located) directly and uniquely corresponds to the circumferential position of that point on the grinding wheel ring. For example, a polar angle value of 90° represents the position of rotating 90 degrees counterclockwise from the reference mark.
[0030] To accurately obtain the coordinates of each pixel in the image in the polar coordinate system, as a possible implementation method, the position coordinates of each pixel in the abrasive ring region image in the Cartesian coordinate system are calculated; the distance between the pixel's position coordinates and the pole is used as the polar radius value of the pixel in the polar coordinate system; the angle from the polar axis direction to the direction where the pixel is located is calculated and used as the polar angle value of the pixel in the polar coordinate system; based on the polar radius value and the polar angle value, the coordinates of the pixel in the polar coordinate system are determined.
[0031] For example, the position of each pixel in the abrasive ring region image is obtained in the original image. This position is usually stored in Cartesian coordinates (x, y), where x represents the column number of each pixel from the left edge of the image, and y represents the row number of each pixel from the top of the image. Then, for each pixel (x, y), the Euclidean distance from each pixel to the pole is calculated (the specific calculation method of Euclidean distance will not be described in this embodiment). The calculated Euclidean distance value is the polar radius of each pixel. For each pixel (x, y), the system calculates the angle from the polar axis direction (a ray from the center of the circle to the 0-degree reference mark) to the direction where each pixel is located, which can be accurately calculated using inverse trigonometric functions. This angle value is the polar angle of the pixel. The calculated (polar radius, polar angle) is used as the coordinates of each pixel in the polar coordinate system.
[0032] It is important to understand that, as mentioned above, under specific lighting conditions, the top of raised material spots reflects light in a high grayscale, while normal abrasive grain depressions produce shadows in a low grayscale. Therefore, a reverse strategy can be adopted: instead of directly searching for bright material spots (due to their susceptibility to reflection interference), a threshold segmentation method can be used to stably identify all normal low-grayscale textures, i.e., foreground pixels. By accurately extracting all normal texture units (i.e., foreground connected components), it is only necessary to search for areas that severely lack normal texture units to indirectly locate the material spots. Using low-grayscale areas as foreground connected components facilitates the analysis and exploration of normal texture maps, providing direct analytical objects for subsequent density analysis and sparsity detection.
[0033] In this embodiment, a preset threshold segmentation algorithm is used to determine the segmentation threshold. Pixels with gray values lower than the segmentation threshold in the image are classified as foreground pixels. Connectivity analysis is then performed on the foreground pixels to obtain multiple foreground connected components.
[0034] It should be noted that the preset threshold segmentation algorithm prioritizes the Otsu method. The Otsu method analyzes the grayscale distribution of the image to traverse all possible grayscale values and adaptively determines an optimal threshold, i.e., the segmentation threshold. The Otsu method can most effectively separate the shadows (low grayscale groups) formed by abrasive grain depressions from the top of the abrasive grains, the surface of the binder, and possible material spots (high grayscale groups).
[0035] As mentioned above, the normal abrasive grain depressions on the surface of the grinding wheel form shadows, which are represented as low grayscale areas in the image. Therefore, the foreground pixels physically correspond to the normal surface texture that is not covered by the raised material spots.
[0036] It should be noted that connected component analysis is a well-known technique in the art, and will not be described in detail in this embodiment. For example, the 8-neighborhood rule can be used to identify and aggregate spatially adjacent (i.e., top, bottom, left, right and four diagonal directions) foreground pixels to form an independent connected region, called the foreground connected component.
[0037] The density analysis module 102 is used to extract the polar coordinates of the centroids of each foreground connected domain; determine the local density index of each connected domain based on the polar coordinates of the centroids of each connected domain and its neighboring connected domains that satisfy the preset proximity conditions; and determine the global density index based on the local density indices of all connected domains.
[0038] It should be noted that the specific method for extracting the centroid of a connected component is a common technique in this field, and will not be described in detail in this embodiment. For example, since image pixels are distributed on a Cartesian grid, when calculating the centroid, it is usually necessary to first convert back to the Cartesian coordinate system (x, y) for calculation. The x-coordinate of the centroid of a connected component is (the sum of the x-coordinates of all pixels in the connected component) ÷ (the total number of pixels contained in the connected component), and the y-coordinate of the centroid is (the sum of the y-coordinates of all pixels in the connected component) ÷ (the total number of pixels contained in the connected component). Then, using the previously established polar coordinate mapping relationship, the Cartesian coordinates of the centroid are converted to their corresponding polar coordinates.
[0039] It is important to understand that on a toroidal grinding wheel, the "distance" between two texture units cannot be measured solely by straight-line distance. Points on the inner and outer rings at the same angle, though far apart in a straight line, are radially aligned and closely related in the toroidal structure. Conversely, points directly in front and directly behind, though perhaps very close in a straight line, are almost unrelated in the toroidal structure. Therefore, this toroidal perception can be comprehensively simulated by combining radial distance and angle, ensuring that adjacent connected regions are truly spatially related texture units.
[0040] In this embodiment, for each connected component, the angle between the centroid of the connected component and the centroids of other connected components in the polar coordinate system, as well as the absolute difference of the polar radius in the polar coordinate system, are obtained. If the angle is less than a preset critical angle, the cosine function value of the angle is calculated. Based on the absolute difference of the polar radius and the cosine function value, the effective distance value between the connected component and the corresponding other connected components is calculated. If the angle is not less than the preset critical angle, the effective distance value between the connected component and the corresponding other connected components is determined to be invalid or infinite. All the calculated effective distance values are sorted in ascending order to form a distance sequence. From the sorted distance sequence, a preset number of other connected components are selected as the neighboring connected components of the connected component. Among them, the effective distance values that are considered invalid or infinite are placed at the end of the distance sequence during sorting.
[0041] Other connected components are all foreground connected components that are selected as the current analysis center in the current computation round.
[0042] The included angle, the absolute difference of the polar angles of the centroids of two connected domains in the polar coordinate system, characterizes the degree of separation between the two connected domains in the circumferential direction.
[0043] The absolute difference of polar radii is the absolute value of the difference of the polar radii of the centroids of two connected domains in polar coordinates. It characterizes the degree of separation of the two connected domains in the radial direction (from the center outwards).
[0044] It's important to understand that the impact of material defects is localized; a defect only disrupts the texture of a small area around it. Therefore, when evaluating whether the texture density of a connected region is normal, we only need to refer to other connected regions near the connected region (those that are close in both the circumferential and radial directions), and should not be influenced by distant or back areas. Thus, a preset critical angle can be set to directly exclude other connected regions that are almost opposite or perpendicular to the connected region in the circumferential direction from the scope of "neighborhood" consideration.
[0045] It should be noted that the specific value of the preset critical angle is determined according to the actual situation, and this embodiment does not make a specific limitation. For example, in order to exclude other connected regions that are almost opposite or perpendicular to the connected region in the circumferential direction, it can be strictly limited to the quadrant in which the currently analyzed connected region is located. This ensures that the currently analyzed connected region will only consider other connected regions with an angle of less than 90 degrees as possible "neighbors", preventing the misassociation of texture units that are unrelated to the ring. Therefore, the preset critical angle is usually set to 90 degrees.
[0046] To accurately obtain the effective distance value, as an example, the absolute difference of the polar radius is divided by the cosine function value to obtain the effective distance value.
[0047] It should be noted that, as can be seen from the aforementioned rules of this invention, when the included angle is greater than or equal to the preset critical angle (e.g., 90 degrees), the effective distance is determined to be infinite (invalid), and no further quantization calculation is performed. Therefore, the program will never encounter a situation where the cosine function value is zero. The mathematical fact that the cosine function value is zero is logically intercepted in advance by the judgment condition of the preset critical angle.
[0048] It's important to understand that the absolute difference in the extreme radius reflects the distance between the centroid of one connected domain and another connected domain in the radial direction. The smaller the angle between the centroids of one connected domain and another, the larger the cosine function value, indicating that the two connected domains are "perceived" closer. This reflects that on the toroidal surface, the more consistent the directions of the two connected domains are, and the closer their relationship is. Conversely, the greater the directional deviation (the larger the angle), the more the effective distance value will be magnified. In particular, when the angle is greater than 90°, it is considered that the two connected domains have exceeded the local range, and the effective distance value is no longer calculated. Instead, it is directly regarded as infinitely far away, and the effective distance value is determined to be invalid or infinite.
[0049] It should be noted that by assigning a value much larger than the theoretical maximum distance of the image size as the effective distance value of infinity, for example, assuming the image resolution is 2000x2000 pixels, the maximum possible size of this ring (from the inner diameter to the outer diameter) will not exceed the length of the image diagonal, 2828 pixels. Even considering extreme image sizes and the ring filling the entire image, the distance between a real connected component will not exceed 3000 pixels. However, for safety reasons, a value much larger than 3000 can be selected. In engineering practice, infinity is usually taken as 100000.
[0050] It should be noted that the specific value of the preset number is determined according to actual needs, and this embodiment does not impose a specific limitation. For example, the preset number needs to be large enough to cover the number of statistically significant neighboring connected regions around the currently analyzed connected region, so as to calculate a stable local density index; at the same time, it cannot be too large, so as not to include irrelevant or too far-away connected regions and destroy "locality". Through engineering practice, it is known that the preset number is usually 10.
[0051] It is understandable that all other connected components marked as invalid or assigned to infinity will be automatically placed at the end of the sequence due to their extremely large values. Therefore, when selecting the first preset number of other connected components from the beginning of the sequence, these invalid or infinity-assigned other connected components will never be selected.
[0052] In this embodiment, the arithmetic mean of the effective distances between a connected component and its neighboring connected components is calculated as the average distance; the first number of pixels contained in the connected component is obtained; the product of the average distance and the first number is calculated as the first intermediate value; and the exponential function value with the natural constant as the base and the negative number of the first intermediate value as the exponent is calculated as the local density index.
[0053] Average distance quantifies the local density from the perspective of spatial relationships. Specifically, the smaller the average distance between a connected component and its neighboring connected components, the more compact and dense the texture units around the connected component are; conversely, the larger the average distance between a connected component and its neighboring connected components, the more open and sparse the surrounding area is.
[0054] The first quantity, also known as the area of a connected region, represents the "size" of a particular connected region. A connected region with a larger area occupies a more significant visual weight in the local region, meaning that there may be deeper abrasive depressions or wider texture features there. Therefore, using area as a product factor allows larger texture features to make a greater positive contribution to the final local density index at the same average distance.
[0055] The first median is a comprehensive negative indicator that combines the average distance and the first quantity. It reflects the degree of openness around a connected domain (i.e., the sparseness of the surrounding texture) and its "size". The larger the first median, the more sparse or insignificant the texture of the connected domain tends to be.
[0056] It is important to understand that if the first median value of a connected component is larger, it means that the connected component is either surrounded by a large area (large average distance), or has a large area itself, or both. In short, it generally indicates that the texture of the connected component is sparser, and therefore, the texture of the connected component is less dense, that is, the local density index is smaller.
[0057] In this embodiment, the arithmetic mean of the local density indices of all connected components is calculated as the global density index.
[0058] The global density index quantifies the "average density" of the normal surface texture of a grinding wheel under specific lighting conditions.
[0059] It should be noted that the global density index may differ for images of different abrasive ring regions of different grinding wheels. Therefore, the global density index can be used not only as a threshold for judging "sparse" or "dense" to detect whether the current grinding wheel is coarse or fine and automatically adjust the strictness of the judgment, but also because changes in the overall brightness of the image will affect the calculation of the local density index, while the global density index will fluctuate synchronously. Therefore, the global density index can be used as a benchmark for judging "sparse" to maintain the relativity of the benchmark.
[0060] The sparsity evaluation module 103 is used to filter out candidate connected components whose local density index is lower than the global density index; based on the candidate connected components and their neighboring connected components, candidate defect regions are delineated in the image; and the sparsity evaluation value is determined according to the number of pixels in the candidate defect region, the local density index of the associated candidate connected components, and the area.
[0061] It can be understood that if the local density index of a certain connected component is lower than the global density index, it means that the local density of the texture of the connected component is lower than the average level of the entire grinding wheel. This connected component is like a "low-density signal point" scattered on the image, indicating areas where there may be defects.
[0062] It is important to understand that a single low-density candidate connected domain may be noise, but a group of low-density candidate connected domains that are spatially clustered strongly suggests the existence of a common source of damage (i.e., a material spot) among these candidate connected domains. A convex hull is calculated using the centroids of these candidate connected domains, which can delineate the influence boundary of this potential source of damage. The central region of this convex hull is the candidate location of the defect.
[0063] In this embodiment, all target neighboring connected regions that satisfy the condition that the local density index is lower than the global density index are obtained with the candidate connected region as the center; in the Cartesian coordinate system, the centroid coordinates of the candidate connected regions and the target neighboring connected regions are extracted; with all the extracted centroids as vertices, the minimum convex polygon that wraps all vertices is calculated; the region formed by all pixels that do not belong to any foreground connected region within the image area covered by the minimum convex polygon is defined as the candidate defect region.
[0064] In this context, it is understood that the target connected component is selected from all its neighboring connected components, with the local density index being lower than the global density index.
[0065] It should be noted that, in the Cartesian coordinate system, the centroid coordinates of the candidate connected domain and the target neighboring connected domain can be extracted by referring to the centroid coordinate confirmation method of the connected domain in the density analysis module 102, which will not be repeated in this embodiment.
[0066] It should be noted that the specific method for calculating the minimum convex hull based on some discrete points is a well-known technique to those skilled in the art, and will not be described in detail in this embodiment. For example, all the obtained centroids are regarded as a set of scattered points in two-dimensional space. The system uses the Graham Scan algorithm to calculate the convex polygon with the smallest area that can enclose all these points. This polygon is called the minimum convex hull of these centroids.
[0067] It can be understood that within the image region covered by the smallest convex polygon, the system distinguishes two types of pixels: one type is pixels that belong to any foreground connected region (normal texture); the other type is pixels that do not belong to any foreground connected region.
[0068] A candidate defect region refers to an image region defined by a minimum convex polygon, consisting of all pixels that are not classified as foreground connected components. In other words, it is the set of pixels remaining after deducting all known normal texture units (i.e., foreground connected components) within the area covered by the minimum convex polygon. Candidate defect regions correspond to "abnormal blank areas" in an image that may be covered by raised material spots and therefore lack normal abrasive grain texture.
[0069] It is important to understand that since there are normal texture gaps on the surface of grinding wheels, it is easy to misjudge large gaps on coarse-grained grinding wheels as defects based solely on the area of blank areas. Therefore, it is necessary to consider both the degree of texture density loss around the candidate defect area (i.e., average density loss value) and the relative size of the area. When both the average density loss value and the relative area ratio are significant, it is ensured that only abnormal areas that truly destroy the texture can obtain high scores. Furthermore, since the texture density of different grit grinding wheels varies greatly, a global density index is introduced as a dynamic correction factor to automatically adjust the judgment criteria, making the judgment more stringent for fine-textured grinding wheels and relatively more lenient for sparse-textured grinding wheels.
[0070] In this embodiment, for each candidate defect region, the target candidate connected domain and its target neighboring connected domain associated with the candidate defect region are obtained; the arithmetic mean of the local density indices of the target candidate connected domain and its target neighboring connected domain associated with the candidate defect region is calculated as the density index mean; the difference between the global density index and the density index mean is calculated as the average density loss value; the average area of all target candidate connected domains and their target neighboring connected domains is calculated; the ratio of the number of pixels in the candidate defect region to the average area is calculated as the first ratio; the first ratio is divided by the sum of the global density index and the positive integer 1 to obtain the relative area ratio; the product of the average density loss value and the relative area ratio is calculated as the sparsity evaluation value of the candidate defect region.
[0071] It should be noted that the candidate defect region refers to the target candidate connected region and its target neighboring connected regions used when defining the candidate defect region.
[0072] The mean density index represents the average density of the low-density texture community (i.e., the target candidate connected region and its neighboring connected regions) surrounding a candidate defect region. A lower mean density index indicates that the low-density texture community surrounding the candidate defect region is generally sparser; a higher mean density index indicates that although there are a few lagging elements, the overall low-density texture community is still close to normal levels.
[0073] The average density loss value quantifies the degree to which the average density level of the texture surrounding a candidate defect area is lacking compared to the normal density level of the entire grinding wheel. The larger the average density loss value, the more severe the degradation or lack of the local texture environment around the candidate defect area, and the lower the average texture density is than it should be.
[0074] It can be understood that the number of pixels in a certain region of an image actually reflects the area of that region. Therefore, the area of the target candidate connected region can be characterized by the number of pixels in the target candidate connected region, and the area of the target neighbor connected region can be characterized by the number of pixels in the target neighbor connected region.
[0075] It should be noted that the average area is calculated from the area of all foreground connected regions that constitute a candidate defect region. Since each foreground connected region contains at least one pixel, the average area is always a positive number.
[0076] The first ratio measures the significance of the area size of a candidate defect region relative to the area size of the normal texture community in its surrounding local environment (i.e., the target candidate connected region and its target neighboring connected regions). Specifically, if the first ratio of a candidate defect region is closer to 1, it indicates that the candidate defect region is about the same size as the surrounding normal texture community, and this candidate defect region is likely just a slightly larger normal gap; if the first ratio is much greater than 1, it indicates that the candidate defect region is much larger than the surrounding normal texture community, which is a relatively abnormally large gap, and the probability of it being a defect increases sharply.
[0077] The relative area ratio is the relative significance of a candidate defect area in the local environment after calibration with the overall texture density level of the current grinding wheel (i.e., the global density index).
[0078] It is important to understand that for grinding wheels with fine texture (i.e., a large global density index), the correction factor (1 + global density index) increases, thereby reducing the relative area ratio, improving the judgment standard, and avoiding false alarms for normal small gaps. For grinding wheels with sparse texture (i.e., a small global density index value), the correction effect is weakened, and the relative area ratio mainly reflects the significance of the candidate defect area relative to the area of the surrounding normal texture community, ensuring detection sensitivity.
[0079] It is important to understand that if the average density loss value and the relative area ratio of a candidate defect area are both very large, it indicates that the texture around the candidate defect area is severely damaged, and the candidate defect area itself also appears very large in the global background. This is a strong defect signal.
[0080] The determination module 104 is used to determine the regional defect index based on the sparse evaluation value of the candidate defect region, the difference between the gray-level entropy of the candidate defect region and the preset background reference entropy; and to mark the region where the regional defect index exceeds the preset threshold as the target defect region.
[0081] It is important to understand that genuine raised abrasive grain defects not only result in sparse surface texture but also typically exhibit irregular internal structures and chaotic grayscale distribution. In contrast, while smooth, normal large abrasive grain gaps also exhibit sparse texture, their internal grayscale is uniform. Therefore, by comprehensively analyzing the differences between the sparsity evaluation value, grayscale entropy, and the preset background reference entropy, it is possible to effectively distinguish between genuine raised abrasive grain defects and smooth but large normal abrasive grain gaps. Only areas that exhibit abnormalities in both texture distribution and internal structure can be identified as target defects, thereby significantly reducing the false detection rate and improving the reliability of detection.
[0082] In this embodiment, a preset background reference entropy representing the uniformity of grayscale distribution in a normal background region is obtained; for each candidate defect region, the internal grayscale entropy of the candidate defect region is calculated; the entropy difference value between the internal grayscale entropy and the preset background reference entropy is calculated; and the entropy difference value is non-negatively processed, wherein the non-negative processing includes retaining the entropy difference value if the entropy difference value is positive or zero; and replacing the entropy difference value with zero if the entropy difference value is negative; the product of the sparse evaluation value of the candidate defect region and the entropy difference value is normalized to obtain the region defect index.
[0083] It should be noted that the preset background reference entropy can be determined based on the sample image of a flawless grinding wheel. This embodiment does not impose specific limitations. For example, in the sample image of a flawless grinding wheel, one or more specific, flat background areas (such as a large area of the binder surface or the flat top area of the abrasive grains) are selected, the gray-level entropy of these areas is calculated, and the average value of the gray-level entropy is taken to obtain the value of the preset background reference entropy, such as 5.2.
[0084] It should be noted that the internal gray-level entropy refers to the gray-level entropy of the candidate defect area. The specific calculation method of gray-level entropy is a technical means well known to those skilled in the art, and will not be described in detail in this embodiment.
[0085] A negative entropy difference value reflects that the gray-level distribution inside the candidate defect area is more uniform and ordered than that of the normal background area. This means that the pixel gray-level values inside a certain candidate defect area are more concentrated and the gray-level histogram is sharper. From the imaging perspective, the candidate defect area is extremely smooth with almost no texture, noise or brightness variation.
[0086] It should be noted that the formula for calculating the entropy difference value is: Entropy difference value = Internal grayscale entropy - Preset background reference entropy.
[0087] It is important to understand that if the internal uniformity of a candidate defect area reaches or exceeds the normal level, that is, the entropy difference value is negative, no matter how sparse the texture of the candidate defect area looks (i.e., how high the sparseness evaluation value is), the regional defect index of the candidate defect area will be forced to zero, thereby absolutely excluding the possibility that it is a material spot.
[0088] It should be noted that, in order to eliminate the influence of regional defect index shift caused by differences in overall contrast, lighting and other factors between different images, the product of the sparse evaluation value and the entropy difference value of all candidate defect regions of the current grinding wheel is linearly normalized and mapped to the interval [0, 1] to obtain the regional defect index.
[0089] It should be noted that the specific value of the preset threshold can be determined based on historical qualified sample data and industry-standard product quality. This embodiment does not impose specific limitations. For example, it can be determined based on the statistical distribution of regional defect indicators of historical qualified samples. For example, it can be set to 0.6, that is, candidate defect areas with regional defect indicators exceeding 0.6 are judged as target defect areas.
[0090] The detection module 105 is used to determine the overall defect index based on the number of pixels in the image, the number of pixels in the target defect area, and the regional defect index; and to detect the passability of the grinding wheel based on the overall defect index.
[0091] It is important to understand that, in order to comprehensively and quantitatively evaluate all identified defects on the grinding wheel and objectively determine its overall quality, it is necessary to understand that simply relying on the number of defects or the sum of their areas cannot scientifically reflect the actual impact of the differences in severity (such as irregularity) of different defects on the quality of the grinding wheel. Therefore, the regional defect index of each target defect area can be used as a weight to perform a weighted summation and normalization of the target defect area areas. The resulting overall defect index takes into account the "quantity," "physical size," and "severity" of the defect areas, thus providing a scientific basis for the final qualification determination.
[0092] In this embodiment, all target defect areas identified in the front and back images of the grinding wheel are collected to form a global defect list. For each target defect area in the global defect list, the number of pixels in the target defect area is weighted using the sum of the regional defect index and the positive integer 1 as the weight, to obtain the weighted number of the target defect area. The sum of the weighted numbers of all target defect areas is calculated as the total weighted number. The total weighted number is divided by the total number of pixels in the abrasive ring area on one side of the grinding wheel to obtain the overall defect index.
[0093] To create a complete global defect list, as an example, target defect area lists are obtained from the front and back images of the grinding wheel after assessment. Based on the polar coordinate system, the target defect areas on both sides are spatially matched. For pairs of target defect areas on both sides with similar centroid polar coordinates and identified as corresponding to the same physical entity defect, they are merged into a unified target defect area. The merged target defect area is then combined with the unmatched independent target defect areas to form a global defect list representing all independent physical defects of the entire grinding wheel.
[0094] It should be noted that "similar centroid polar coordinates" means that the centroids of a certain target defect area in the front image and a certain target defect area in the back image are similar. That is, if the two target defect areas simultaneously meet the following two conditions, they are determined to correspond to the same physical entity defect: Condition 1 is similar angle: the absolute difference of the polar angle of the centroids of the two target defect areas is less than a preset angle tolerance threshold; Condition 2 is similar radially: the absolute difference of the polar radius of the two target defect areas is less than a preset radial tolerance threshold.
[0095] The specific values of the preset angle tolerance threshold and the preset radial tolerance threshold can be preset according to the thickness of the grinding wheel, image resolution and detection accuracy requirements. For example, considering the centroid calculation error and the possibility of slight deflection of the grinding wheel, the preset angle tolerance threshold can be set to 5°; considering the physical thickness of the grinding wheel (there may be slight radial offset on the image projection of the same position on the front and back sides) and imaging error, the preset radial tolerance threshold can be set to 5 to 10 pixels.
[0096] In this context, it can be understood that fusion refers to taking the maximum value of the regional defect index in the target defect area on both the front and back sides, and the maximum value of the number of pixels in the target defect area.
[0097] It is important to understand that since the range of the regional defect index is [0, 1], if the regional defect index is used directly as the weight, the area contribution of a defect will be severely weakened when the regional defect index of a defect is very small. This may cause the algorithm to over-ignore minor defects. Therefore, the sum of the regional defect index and the positive integer 1 is used as the weight.
[0098] The weighted quantity, the "equivalent weight" of a certain target defect area in the overall quality assessment, not only takes into account the physical size of the target defect area (i.e. the number of pixels in the target defect area), but also amplifies it according to the severity of the defect in the target defect area (i.e., the area defect index).
[0099] It should be noted that the abrasive ring area of the grinding wheel is a solid workpiece with a definite physical size and area. As long as the grinding wheel exists, its abrasive area will inevitably occupy a certain space. Therefore, the total number of pixels in the abrasive ring area on one side cannot be zero.
[0100] As an example, the calculated overall defect index is compared with a preset overall defect acceptance threshold. If the overall defect index is not greater than the preset overall defect acceptance threshold, the current grinding wheel is determined to be a qualified product; if the overall defect index is greater than the preset overall defect acceptance threshold, it is determined to be a non-qualified product. Finally, the pass / fail determination result is output, and sorting, marking, or alarm operations can be performed in conjunction with the pass / fail determination result.
[0101] The preset overall defect qualification threshold is set in advance based on the statistical characteristics of product quality standards and historical qualified sample data. This embodiment does not make specific limitations. For example, it is assumed that the coverage area of any grinding wheel spot shall not exceed 5% of the total area. The preset overall defect qualification threshold can be 0.05.
[0102] A visual inspection device for grinding wheels includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of a visual inspection system for grinding wheels.
[0103] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0104] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A visual inspection system for grinding wheels, characterized in that, The system includes: The image processing module is used to acquire images of the abrasive ring area of the grinding wheel and map them to a preset polar coordinate system; it performs threshold segmentation on the image to obtain multiple foreground connected regions; The density analysis module is used to extract the polar coordinates of the centroids of each foreground connected component; determine the local density index of each connected component based on the polar coordinates of the centroids of its neighboring connected components that satisfy the preset proximity conditions; and determine the global density index based on the local density indices of all connected components. The sparsity evaluation module is used to filter out candidate connected components whose local density index is lower than the global density index; based on the candidate connected components and their neighboring connected components, candidate defect regions are delineated in the image; and the sparsity evaluation value is determined according to the number of pixels in the candidate defect region, the local density index of the associated candidate connected components, and the area. The determination module is used to determine the regional defect index based on the sparse evaluation value of the candidate defect region, the difference between the gray-level entropy of the candidate defect region and the preset background reference entropy; and to mark the region with the regional defect index exceeding the preset threshold as the target defect region. The detection module is used to determine the overall defect index based on the number of pixels in the image, the number of pixels in the target defect area, and the regional defect index; and to detect the passability of the grinding wheel based on the overall defect index.
2. The visual inspection system for grinding wheels according to claim 1, characterized in that, The method further includes: using the geometric center of the abrasive ring region image as the pole of the polar coordinate system; and using a preset physical reference direction as the polar axis of the polar coordinate system; the method also includes: The position coordinates of each pixel in the abrasive ring region image in the Cartesian coordinate system; Calculate the distance between the pixel's position coordinates and the pole, and use the distance as the polar radius of the pixel in the polar coordinate system; Calculate the angle from the polar axis to the direction where the pixel is located, and use the angle as the polar angle value of the pixel in the polar coordinate system; The coordinates of a pixel in the polar coordinate system are determined based on its polar radius and polar angle values.
3. The visual inspection system for grinding wheels according to claim 1, characterized in that, The threshold segmentation of the image to obtain multiple foreground connected components includes: A preset threshold segmentation algorithm is used to determine the segmentation threshold. Pixels with gray values lower than the segmentation threshold in the image are classified as foreground pixels. Connectivity analysis is then performed on the foreground pixels to obtain multiple foreground connected components.
4. The visual inspection system for grinding wheels according to claim 2, characterized in that, The process of determining neighboring connected components that satisfy preset proximity conditions includes: For each connected component, obtain the angle between the centroid of the connected component and the centroids of other connected components in the polar coordinate system, as well as the absolute difference of the polar radius in the polar coordinate system. If the included angle is less than the preset critical angle, calculate the cosine function value of the included angle; based on the absolute difference of the polar radius and the cosine function value, calculate the effective distance value between the connected component and other corresponding connected components; If the included angle is not less than the preset critical angle, the effective distance value between the connected component and other corresponding connected components is determined to be invalid or infinite. Sort all the calculated effective distance values in ascending order to form a distance sequence; select the first preset number of other connected components from the sorted distance sequence as the neighboring connected components of the connected component. Among them, effective distance values that are considered invalid or infinite are placed at the end of the distance sequence during sorting.
5. The visual inspection system for grinding wheels according to claim 4, characterized in that, The process of determining the local density index includes: Calculate the arithmetic mean of the effective distances between a connected component and each of its neighboring connected components, and use this as the average distance. Get the first number of pixels contained in the connected component; Calculate the product of the average distance and the first quantity, and use it as the first intermediate value; The value of the exponential function with the natural constant as the base and the first intermediate negative value as the exponent is calculated as a local density index.
6. The visual inspection system for grinding wheels according to claim 1, characterized in that, The step of delineating candidate defect regions in an image based on candidate connected components and their neighboring connected components includes: Using the candidate connected component as the center, obtain all target neighbor connected components that satisfy the local density index being lower than the global density index; In the Cartesian coordinate system, extract the centroid coordinates of the candidate connected domain and the target neighboring connected domain; Using all extracted centroids as vertices, calculate the smallest convex polygon that encloses all vertices; Within the image area covered by the smallest convex polygon, the region consisting of all pixels that do not belong to any foreground connected region is defined as the candidate defect region.
7. The visual inspection system for grinding wheels according to claim 6, characterized in that, The process of determining the sparsity evaluation value based on the number of pixels within the candidate defect region, the local density index of the associated candidate connected components, and the area includes: For each candidate defect region, obtain the target candidate connected component and its target neighbor connected component associated with the candidate defect region; Calculate the arithmetic mean of the local density indices of the target candidate connected regions and their target neighboring connected regions associated with the candidate defective regions, as the density index mean; and calculate the difference between the global density index and the density index mean, as the average density loss value. Calculate the average area of all target candidate connected components and their target neighbor connected components; calculate the ratio of the number of pixels in the candidate defect region to the average area, and use it as the first ratio. Divide the first ratio by the sum of the global density index and the positive integer 1 to obtain the relative area ratio. The product of the average density loss value and the relative area ratio is calculated as the sparsity evaluation value of the candidate defective region.
8. The visual inspection system for grinding wheels according to claim 1, characterized in that, The process for determining the regional defect index includes: Obtain a preset background reference entropy that characterizes the uniformity of grayscale distribution in normal background regions; For each candidate defect region, calculate the internal gray-level entropy of the candidate defect region; calculate the entropy difference between the internal gray-level entropy and the preset background reference entropy; and perform non-negativity processing on the entropy difference value, wherein the non-negativity processing includes retaining the entropy difference value if the entropy difference value is positive or zero; and replacing the entropy difference value with zero if the entropy difference value is negative. The product of the sparse evaluation value and the entropy difference value of the candidate defect region is normalized to obtain the regional defect index.
9. The visual inspection system for grinding wheels according to claim 8, characterized in that, The process for determining the overall defect index includes: All target defect areas identified in the front and back images of the grinding wheel are compiled to form a global defect list; For each target defect region in the global defect list, the number of pixels in the target defect region is weighted by the sum of the region defect index and the positive integer 1, and the weighted number of the target defect region is obtained. Calculate the sum of the weighted counts of all target defect areas as the total weighted count; Divide the total weighted number by the total number of pixels in the abrasive ring area on one side of the grinding wheel to obtain the overall defect index.
10. A visual inspection device for grinding wheels, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the system as claimed in any one of claims 1 to 9.