A grinding wheel defect detection method based on machine vision
By graying and spectrum analysis of the grinding wheel surface image, local density values and clustering algorithms are used to screen suspected crack areas, and confidence is obtained by combining the gradient direction, the problem of insufficient accuracy of crack detection on the grinding wheel surface is solved, and the accuracy and efficiency of detection are improved.
Patent Information
- Application Number
- CN202510305240.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-03-14
AI Technical Summary
In the prior art, crack detection of grinding wheel surface images has insufficient accuracy, especially due to mis-detection and missed detection problems caused by uneven surface roughness and texture similarity.
By greying the grinding wheel surface image, the circumferential circle is obtained and divided into multiple images, the spectrum differences between the aliquot images are analyzed, and the suspected crack areas are screened using local density values and clustering algorithms, and the confidence is obtained in combination with the gradient direction for accurate detection.
It improves the accuracy and robustness of crack detection on the surface of the grinding wheel, reduces false inspections and missed inspections, and improves quality inspection efficiency.
Smart Images

Figure CN119831990B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a grinding wheel defect detection method based on machine vision. Background Art
[0002] A grinding wheel is a tool used for machining operations such as grinding, polishing, and cutting. Composed of hard abrasive particles and a binder, it is widely used in mechanical processing. The production process for a grinding wheel includes steps such as raw material batching, mixing, forming, sintering, cooling, and dressing. During the production process, defects such as cracks may appear on the grinding wheel due to factors such as uneven raw material mixing or the influence of temperature during sintering. Therefore, detecting defects such as cracks in produced grinding wheels is of great significance to ensuring their quality.
[0003] In the existing technology, threshold segmentation is usually used to detect crack defects in produced grinding wheels, and the traditional threshold segmentation method usually relies on the difference in pixel intensity in the image to distinguish cracks from the background. However, the surface of the grinding wheel usually has different roughness, and there may be locally smooth or rough areas. This uneven surface characteristic will cause the brightness and texture in the grinding wheel surface image to change. Secondly, the grinding wheel surface may have patterns such as printed textures. These textures and cracks may have visual similarities, resulting in the cracks may have no obvious intensity difference with the surrounding areas, ultimately leading to misidentification or missed detection.
[0004] Therefore, how to improve the accuracy of detecting crack defects in grinding wheels has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides a grinding wheel defect detection method based on machine vision to solve the problem of how to improve the accuracy of detecting crack defects in the grinding wheel.
[0006] An embodiment of the present invention provides a method for detecting grinding wheel defects based on machine vision, the method comprising the following steps:
[0007] Capturing an image of the surface of a grinding wheel produced on a quality inspection line to obtain a grinding wheel surface image, gray-scaling the grinding wheel surface image to obtain a corresponding grayscale image, obtaining a circumscribed circle of the grinding wheel in the grayscale image, and dividing the circumscribed circle into a preset number of equally divided images based on the center of the circumscribed circle;
[0008] For any equally divided image, obtaining a local density value of the any equally divided image based on the difference in spectrum data between the any equally divided image and other equally divided images, and sorting the local density values of each of the equally divided images in ascending order to obtain a target local density value sequence;
[0009] The target local density value sequence is clustered using the maximum and minimum values in the target local density value sequence as initial cluster centers to obtain two clusters, and based on the difference between the two clusters, whether there are cracks in the grinding wheel surface is detected; if suspected cracks are detected in the grinding wheel surface, a suspected abnormal cluster is obtained from all clusters;
[0010] According to the gradient direction of the pixel points in the equally divided image corresponding to each local density value in the suspected abnormal cluster, the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster is obtained respectively, and according to the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster, the crack defect in the grinding wheel surface is detected.
[0011] Preferably, obtaining the local density value of any equally divided image according to the difference in spectrum data between any equally divided image and other equally divided images includes:
[0012] After rotating each of the equally divided images to the same preset direction, obtaining a frequency spectrum corresponding to each of the equally divided images;
[0013] For any other equally divided image, based on the spectrogram of the any equally divided image and the spectrogram of the any other equally divided image, obtain the square of the mean square error of the spectrum data in the horizontal direction and the square of the mean square error of the spectrum data in the vertical direction, respectively denoted as the horizontal error and the vertical error; and based on the horizontal error and the vertical error, obtain a spectrum difference index between the any equally divided image and the any other equally divided image;
[0014] A local density value of any equally divided image is obtained according to a frequency spectrum difference index between any equally divided image and each other equally divided image.
[0015] Preferably, obtaining the local density value of any equally divided image according to the spectrum difference index between any equally divided image and each other equally divided image includes:
[0016] Performing mean processing on the spectrum difference index of any equally divided image and each other equally divided image to obtain an average spectrum difference index, performing normalization processing on the average spectrum difference index to obtain a corresponding normalized value, and obtaining the local density value of any equally divided image according to the difference between a constant 1 and the normalized value.
[0017] Preferably, detecting whether there are cracks on the surface of the grinding wheel based on the difference between the two clusters includes:
[0018] respectively obtaining the sum of the local density values contained in each of the clusters, marking the cluster corresponding to the minimum sum as the first cluster, and marking the cluster corresponding to the maximum sum as the second cluster;
[0019] Obtaining an average value of all local density values in the first cluster, recorded as a first average value; obtaining an average value of all local density values in the second cluster, recorded as a second average value; calculating the absolute value of the difference between every two local density values in the second cluster, and obtaining an accumulated value of the absolute values of the differences;
[0020] Calculating an absolute value of a difference between the first average value and the second average value, recording the difference as an average difference value, and obtaining a crack judgment index according to a ratio between the average difference value and a cumulative value of the absolute values of the differences;
[0021] A preset crack judgment index threshold is obtained, and if the crack judgment index is greater than the crack judgment index threshold, it is determined that a crack is suspected to exist in the grinding wheel surface.
[0022] Preferably, obtaining a suspected abnormal cluster from all clusters includes:
[0023] The first cluster is regarded as a suspected abnormal cluster.
[0024] Preferably, obtaining the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster according to the gradient direction of the pixel points in the equally divided image corresponding to each local density value in the suspected abnormal cluster includes:
[0025] Mark the equally divided images corresponding to the cluster centers of non-suspected abnormal clusters as reference images.
[0026] After rotating the reference image and the equally divided images corresponding to each local density value in the suspected abnormal cluster to the same preset direction, respectively obtaining the gradient direction of each pixel point in each equally divided image corresponding to the reference image and the suspected abnormal cluster;
[0027] For any equally divided image corresponding to the suspected abnormal cluster, mark the pixels in the equally divided image that have a gradient direction different from that of the pixels in the reference image to obtain marked pixels, and perform statistics on the gradient directions of all marked pixels according to a preset gradient direction interval to obtain a gradient direction histogram, wherein the horizontal axis of the gradient direction histogram is the gradient direction interval and the vertical axis is the number of marked pixels;
[0028] The maximum ordinate value in the gradient direction histogram is obtained, recorded as the maximum amplitude, the average of all ordinate values in the gradient direction histogram except the maximum amplitude is obtained, recorded as the average amplitude, and the ratio of the maximum amplitude to the average amplitude is normalized to obtain the confidence level of the presence of cracks in any of the equally divided images.
[0029] Preferably, the detecting crack defects in the grinding wheel surface according to the confidence level of the presence of cracks in each equally divided image corresponding to the suspected abnormal cluster comprises:
[0030] A preset confidence threshold is obtained. If the confidence corresponding to any equally divided image in the suspected abnormal cluster is greater than the confidence threshold, it is confirmed that a crack defect exists on the surface of the grinding wheel.
[0031] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0032] The present invention takes into account that when cracks exist on the grinding wheel surface, the area occupied by them is small. The grayscale image corresponding to the grinding wheel surface is equally divided to obtain multiple equally divided images, and the spectral differences between the equally divided images are analyzed to facilitate measuring the differences between the equally divided images, and the local density value of each equally divided image is obtained, which is used to divide the equally divided images into two clusters according to the local density values, and quickly screen out clusters suspected of having cracks, that is, suspected clusters, and then obtain the confidence of the existence of cracks in each equally divided image for the gradient direction of the pixel points in each equally divided image corresponding to the suspected cluster. The greater the confidence, the more likely it is that cracks exist, so that the cracks on the grinding wheel surface are more accurately judged based on the confidence, so as to improve the interference of other factors in the traditional method of detecting cracks on the grinding wheel surface, improve the robustness of the detection of cracks on the grinding wheel surface, and thus improve the efficiency of the grinding wheel production quality inspection process. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 This is a flow chart of a method for detecting grinding wheel defects based on machine vision provided in Example 1 of the present invention;
[0035] Figure 2 It is a schematic diagram of a grinding wheel provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to be used to explain the present disclosure, but should not be understood as limiting the present disclosure.
[0037] It should be noted that the terms "first," "second," and the like in the specification of the present disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0038] In order to illustrate the technical solution of the present invention, specific embodiments are provided below.
[0039] See also Figure 1 , is a flow chart of a method for detecting grinding wheel defects based on machine vision provided by the first embodiment of the present invention, such as Figure 1 As shown, the method may include:
[0040] Step S101, capture an image of the surface of a grinding wheel produced on a quality inspection line to obtain a grinding wheel surface image, grayscale the grinding wheel surface image to obtain a corresponding grayscale image, obtain the circumscribed circle of the grinding wheel in the grayscale image, and divide the circumscribed circle into a preset number of equally divided images according to the center of the circumscribed circle.
[0041] For the already produced Figure 2 The grinding wheel shown is placed on the transmission belt on the quality inspection line, and then the image of the grinding wheel surface placed on the transmission belt is collected by a high-definition camera arranged above the transmission belt to obtain the grinding wheel surface image.
[0042] During the production process of the grinding wheel, the cracks on its surface are usually long and thin lines, and most of them are radial cracks (that is, their distribution direction is usually along the radius of the grinding wheel). Due to the long and thin characteristics of the cracks, the area they occupy when they appear is very small compared to the area of the grinding wheel surface. Therefore, it is necessary to quickly lock and screen the crack areas that may exist on the grinding wheel surface.
[0043] Considering that the shape of the grinding wheel is circular, it has certain characteristics such as central symmetry and axial symmetry. Local analysis can be performed based on the circular features of the grinding wheel to improve the detection accuracy. Therefore, in an embodiment of the present invention, the surface image of the grinding wheel is first grayscaled to obtain a corresponding grayscale image, and then the Hough circle detection (Hough Circle Transform) is used to obtain the circumscribed circle of the grinding wheel and the center of the circumscribed circle in the grayscale image. Hough circle detection (Hough Circle Transform) is an algorithm for detecting circles in images. It is widely used in the fields of computer vision and image processing. The algorithm is a well-known technology and will not be described in detail here. Finally, the circumscribed circle is divided into a preset number of equal parts along the center of the circle according to the radius of the circumscribed circle, that is, equal-division images. One equal-division image corresponds to a local area on the surface of the grinding wheel. The preset number here is 12 (empirical value).
[0044] Step S102 : for any equally divided image, obtain the local density value of the any equally divided image based on the spectrum data difference between the any equally divided image and other equally divided images, and sort the local density values of each of the equally divided images in ascending order to obtain a target local density value sequence.
[0045] When cracks appear on the surface of the grinding wheel, the cracks may appear in some of the equally divided images. Since the texture distribution and direction between normal grinding wheel equal parts are similar, the corresponding spectral data between these normal equal parts are also relatively close. However, when a crack exists in a certain equal part, its corresponding spectral data will be different from the spectral data between normal equal parts. Therefore, based on the spectral data differences between each equal part image, the spectral difference index between any two equal part images is analyzed.
[0046] Specifically, with the center of the circumscribed circle as the rotation center, each equally divided image is rotated to the same preset direction (for example, horizontally to the right). Afterwards, a Fourier transform is performed on each equally divided image to obtain a spectrum corresponding to each equally divided image. The use of Fourier transform to obtain a spectrum of an image is prior art and will not be described in detail here. Since the horizontal and vertical spectral data in the spectrum are comparable, taking any equally divided image as an example, the remaining equally divided images are used as other equally divided images. Based on the difference in the spectrum between any equally divided image and each other equally divided image, the spectrum difference index between any equally divided image and each other equally divided image is analyzed:
[0047] For any other equally divided image, based on the spectrum diagram of the any equally divided image and the spectrum diagram of the any other equally divided image, obtain the square of the mean square error of the spectrum data in the horizontal direction and the square of the mean square error of the spectrum data in the vertical direction, which are respectively recorded as the horizontal error and the vertical error. Based on the horizontal error and the vertical error, obtain the spectrum difference index between the any equally divided image and the any other equally divided image.
[0048] In one embodiment, taking the ath equally divided image and the bth other equally divided image as an example, the spectrum data of the spectrum graphs of the ath equally divided image and the bth other equally divided image are aligned in the horizontal direction, and the mean square error is calculated, which is recorded as the horizontal error. Similarly, the spectrum data of the spectrum graphs of the ath equally divided image and the bth other equally divided image are aligned in the vertical direction, and the mean square error is calculated, which is recorded as the vertical error. Based on the horizontal error and the vertical error, the spectrum difference index between the ath equally divided image and the bth other equally divided image is characterized, and the calculation expression of the corresponding spectrum difference index is:
[0049]
[0050] in, Indicates the spectrum difference index between the a-th equally divided image and the b-th other equally divided image, Represents the spectrum data of the spectrum graph of the a-th equally divided image in the horizontal direction, Represents the spectrum data of the spectrum graph of the bth other equally divided image in the horizontal direction, x represents the horizontal direction, y represents the vertical direction, Represents the spectrum data of the spectrum graph of the a-th equally divided image in the vertical direction, Represents the spectrum data of the spectrum graph of the bth other equally divided image in the vertical direction, Represents the mean square error in the horizontal direction, that is, the horizontal error, Represents the mean square error in the vertical direction, that is, the vertical error, represents the mean square error.
[0051] It should be noted that and It is used to represent the sum of the square of the mean square error in the horizontal direction and the square of the mean square error in the vertical direction. The larger the sum, the greater the difference in the spectrum between the a-th equally divided image and the b-th other equally divided image. The probability of a crack in one of them is high, and the corresponding spectrum difference index is larger.
[0052] Similarly, the spectrum difference index between any equally divided image and every other equally divided image can be obtained. If the spectrum difference index between any equally divided image and all other equally divided images is larger, it means that there is a high probability of cracks, etc. in any equally divided image. Therefore, by analyzing the overall spectrum difference between any equally divided image and the equally divided images within its local range, the local density value of any equally divided image is obtained to characterize the entire local spectrum difference of any equally divided image. The larger the local density value, the smaller the corresponding overall local spectrum difference. Based on the spectrum difference index between any equally divided image and every other equally divided image, the local density value of any equally divided image is obtained, including:
[0053] Performing mean processing on the spectrum difference index of any equally divided image and each other equally divided image to obtain an average spectrum difference index, performing normalization processing on the average spectrum difference index to obtain a corresponding normalized value, and obtaining the local density value of any equally divided image according to the difference between a constant 1 and the normalized value.
[0054] In one embodiment, the calculation expression of the local density value of the a-th equally divided image is:
[0055]
[0056] in, Represents the local density value of the a-th equally divided image, 1 represents a constant, norm() represents the normalization function, and m represents the number of equally divided images. Indicates the spectral difference index between the a-th equally divided image and the b-th other equally divided image.
[0057] It should be noted that The smaller the value is, the smaller the local spectrum difference of the a-th equally divided image is, the more the a-th equally divided image and its periodic equally divided image belong to the same category, and the corresponding local density value is larger.
[0058] Similarly, the local density value of each equally divided image is obtained, and the local density values of all equally divided images are arranged in ascending order to obtain a target local density value sequence.
[0059] Step S103, clustering the target local density value sequence with the maximum value and the minimum value in the target local density value sequence as initial cluster centers to obtain two clusters, and detecting whether there are cracks in the grinding wheel surface based on the difference between the two clusters. If suspected cracks are detected in the grinding wheel surface, a suspected abnormal cluster is obtained from all clusters.
[0060] The target local density value sequence is used to characterize the local spectrum difference of each equally divided image. If the local spectrum differences of all equally divided images are similar, it means that the equally divided images are similar, belong to the same category, there is no major anomaly, and the probability of cracks on the corresponding grinding wheel surface is very small. Therefore, in an embodiment of the present invention, a clustering algorithm is used to cluster the target local density value sequence, and the maximum and minimum values in the target local density value sequence are used as initial clustering centers. K-means clustering is performed on the target local density value sequence to obtain two clusters, one cluster corresponding to the equally divided images of a class with the highest similarity. Then, the addition results of the local density values contained in each of the clusters are obtained respectively, and the cluster corresponding to the minimum addition result is marked as the first cluster, and the cluster corresponding to the maximum addition result is marked as the second cluster.
[0061] If the difference characteristics of the two clusters are large, it means that the possibility of cracks on the grinding wheel surface is greater. Conversely, if the difference characteristics of the two clusters are small, it means that the texture characteristics between the equally divided areas on the grinding wheel surface are similar, and the probability of cracks is very small. Therefore, according to the local density values in the two clusters, a judgment index for judging whether there are cracks on the grinding wheel surface can be obtained. Specifically: the average value of all local density values in the first cluster is obtained, recorded as the first average value, the average value of all local density values in the second cluster is obtained, recorded as the second average value, and the absolute value of the difference between each two local density values in the second cluster is calculated to obtain the accumulated value of the absolute value of the difference;
[0062] The absolute value of the difference between the first average value and the second average value is calculated and recorded as the average difference value, and the crack judgment index is obtained according to the ratio between the average difference value and the accumulated value of the absolute values of the differences.
[0063] In one embodiment, the calculation expression of the crack judgment index is:
[0064]
[0065] Among them, Y represents the crack judgment index, represents the first average value, represents the second mean, represents the average difference value, Represents the cumulative value of the absolute value of the difference between every two local density values in the second cluster, c1 represents the first cluster, and c2 represents the second cluster.
[0066] It should be noted that Used to characterize the normal error between two normal equal parts, so the ratio is used To analyze the proportion of the difference between the two clusters in the normal error, the larger the proportion, the greater the error. The greater the difference between the two clusters, the more likely there is a crack on the grinding wheel surface, and the larger the corresponding crack judgment index.
[0067] Furthermore, the crack judgment index threshold is set to 3. If the crack judgment index is greater than the crack judgment index threshold, it is determined that there are suspected cracks in the grinding wheel surface or the abnormality is caused by the inconsistency of the grit distribution uniformity with the normal grinding wheel surface, and further crack detection of the grinding wheel is required.
[0068] When it is determined that there are suspected cracks in the grinding wheel surface, it means that the feature differences between the two clusters are large. Considering that the local density value in the first cluster is small, it is believed that the probability of cracks existing in the equally divided images in the first cluster is high, and there are no cracks in the equally divided images in the second cluster. Therefore, the first cluster is used as a suspected abnormal cluster for subsequent precise detection of cracks.
[0069] Step S104, according to the gradient direction of the pixel points in the equally divided image corresponding to each local density value in the suspected abnormal cluster, respectively obtain the confidence that there is a crack in each equally divided image corresponding to the suspected abnormal cluster, and detect the crack defect in the grinding wheel surface according to the confidence that there is a crack in each equally divided image corresponding to the suspected abnormal cluster.
[0070] Since the second cluster is a non-suspected abnormal cluster, that is, there is no crack in its corresponding equally divided image, the equally divided image corresponding to the cluster center of the non-suspected abnormal cluster is marked as the reference image, and according to the above-mentioned rotation method for obtaining the spectrum diagram, the reference image and the equally divided image corresponding to each local density value in the suspected abnormal cluster are rotated to the same preset direction (horizontally to the right), and the Sobel operator is used to obtain the gradient direction of each pixel point in each equally divided image corresponding to the reference image and the suspected abnormal cluster, respectively. Among them, the Sobel operator belongs to the existing technology and will not be described in detail here.
[0071] Taking the gradient direction of each pixel in the reference image as a reference, texture pixels of each equally divided image corresponding to the suspected abnormal cluster are excluded, that is, pixels with the same gradient direction as the pixels in the reference image. Therefore, for any equally divided image corresponding to the suspected abnormal cluster, pixels with different gradient directions from the pixels in the reference image are marked to obtain marked pixels. The range of the gradient direction angle difference of 2 degrees is used as a preset gradient direction interval, corresponding to 180 gradient direction intervals. Then, according to the preset gradient direction interval, the gradient directions of all marked pixels are counted to obtain a gradient direction histogram, wherein the horizontal axis of the gradient direction histogram is the gradient direction interval, and the vertical axis is the number of marked pixels.
[0072] Since cracks are usually long and thin lines, the gradient direction of the corresponding pixel points has a relatively regular directionality. However, the gravel on the surface of the grinding wheel has a random distribution, and the gradient direction of the corresponding pixel points has a random characteristic. Therefore, when there is a crack in any equally divided image, the number of marked pixels corresponding to a certain gradient direction interval in the corresponding gradient direction histogram is relatively high. Therefore, the confidence level of the existence of cracks in any equally divided image can be obtained based on the gradient direction of the pixel points in any equally divided image. The specific acquisition method is:
[0073] The maximum ordinate value in the gradient direction histogram is obtained, recorded as the maximum amplitude, the average of all ordinate values in the gradient direction histogram except the maximum amplitude is obtained, recorded as the average amplitude, and the ratio of the maximum amplitude to the average amplitude is normalized to obtain the confidence level of the presence of cracks in any of the equally divided images.
[0074] In one embodiment, the confidence level of the presence of cracks in any equally divided image is calculated as follows:
[0075]
[0076] in, It indicates the confidence that there is a crack in the rth equally divided image corresponding to the suspected abnormal cluster, norm() represents the normalization function, and max() represents the maximum value function. Represents the maximum ordinate value in the gradient direction histogram of the rth equally divided image, that is, the maximum peak value, Represents the average value of all ordinate values except the maximum ordinate value in the gradient direction histogram of the r-th equally divided image.
[0077] It should be noted that It is used to characterize the ratio between the peak value in the gradient direction histogram of the r-th equally divided image and the mean value of all amplitudes except the peak value. The larger the ratio, the larger the peak value, and the greater the confidence level of the existence of cracks in the corresponding r-th equally divided image.
[0078] Similarly, the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster is obtained, and then the crack defect in the grinding wheel surface is detected according to the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster. The specific detection method is: obtaining a preset confidence threshold value, if the confidence level corresponding to any equally divided image in the suspected abnormal cluster is greater than the confidence threshold value, it is confirmed that there is a crack defect on the grinding wheel surface.
[0079] In one embodiment, the confidence threshold is 0.45. When the confidence corresponding to at least one equally divided image in the suspected abnormal cluster is greater than 0.45, it is confirmed that there is a crack defect on the grinding wheel surface, and then the degree of the crack defect in the corresponding equally divided image is obtained according to the confidence of the crack, which characterizes the degree of the crack defect on the grinding wheel surface. The greater the confidence, the higher the degree of the crack defect. Specifically, the confidence can be used as the degree of the crack defect on the grinding wheel surface. When there are multiple equally divided images with cracks, the cumulative value of the confidence is calculated as the degree of the crack defect on the grinding wheel surface. Then, the grinding wheel that may have cracks is screened out by mechanical gripping devices on the quality inspection line, so as to perform a more accurate quality inspection on the presence of cracks on the grinding wheel surface. On the contrary, when the confidence corresponding to the equally divided images in the suspected abnormal cluster are all less than or equal to 0.45, it is considered that there is no crack on the grinding wheel surface, and the above-mentioned suspected crack exists due to the inconsistent uniformity of grit distribution on the surface of the normal grinding wheel.
[0080] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A grinding wheel defect detection method based on machine vision, characterized in that: The method comprises: Capturing an image of the surface of a grinding wheel produced on a quality inspection line to obtain a grinding wheel surface image, gray-scaling the grinding wheel surface image to obtain a corresponding grayscale image, obtaining a circumscribed circle of the grinding wheel in the grayscale image, and dividing the circumscribed circle into a preset number of equally divided images based on the center of the circumscribed circle; For any equally divided image, obtaining a local density value of the any equally divided image based on the difference in spectrum data between the any equally divided image and other equally divided images, and sorting the local density values of each of the equally divided images in ascending order to obtain a target local density value sequence; The target local density value sequence is clustered using the maximum and minimum values in the target local density value sequence as initial cluster centers to obtain two clusters, and based on the difference between the two clusters, whether there are cracks in the grinding wheel surface is detected; if suspected cracks are detected in the grinding wheel surface, a suspected abnormal cluster is obtained from all clusters; According to the gradient direction of the pixel points in the equally divided image corresponding to each local density value in the suspected abnormal cluster, respectively obtain the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster, and detect the crack defect in the grinding wheel surface according to the confidence level of the existence of cracks in each equally divided image corresponding to the suspected abnormal cluster; Detecting whether there are cracks on the surface of the grinding wheel according to the difference between the two clusters includes: respectively obtaining the sum of the local density values contained in each of the clusters, marking the cluster corresponding to the minimum sum as the first cluster, and marking the cluster corresponding to the maximum sum as the second cluster; Obtaining an average value of all local density values in the first cluster, recorded as a first average value; obtaining an average value of all local density values in the second cluster, recorded as a second average value; calculating the absolute value of the difference between every two local density values in the second cluster, and obtaining an accumulated value of the absolute values of the differences; Calculating an absolute value of a difference between the first average value and the second average value, recording the difference as an average difference value, and obtaining a crack judgment index according to a ratio between the average difference value and a cumulative value of the absolute values of the differences; A preset crack judgment index threshold is obtained, and if the crack judgment index is greater than the crack judgment index threshold, it is determined that a crack is suspected to exist in the grinding wheel surface.
2. The method for detecting grinding wheel defects based on machine vision according to claim 1, wherein: Obtaining a local density value of any equally divided image according to a difference in spectrum data between any equally divided image and other equally divided images includes: After rotating each of the equally divided images to the same preset direction, obtaining a frequency spectrum corresponding to each of the equally divided images; For any other equally divided image, based on the spectrogram of the any equally divided image and the spectrogram of the any other equally divided image, obtain the square of the mean square error of the spectrum data in the horizontal direction and the square of the mean square error of the spectrum data in the vertical direction, respectively denoted as the horizontal error and the vertical error; and based on the horizontal error and the vertical error, obtain a spectrum difference index between the any equally divided image and the any other equally divided image; A local density value of any equally divided image is obtained according to a frequency spectrum difference index between any equally divided image and each other equally divided image.
3. The method for detecting grinding wheel defects based on machine vision according to claim 2, wherein: Obtaining a local density value of any equally divided image according to a frequency spectrum difference index between any equally divided image and each other equally divided image includes: Performing mean processing on the spectrum difference index of any equally divided image and each other equally divided image to obtain an average spectrum difference index, performing normalization processing on the average spectrum difference index to obtain a corresponding normalized value, and obtaining the local density value of any equally divided image according to the difference between a constant 1 and the normalized value.
4. The method for detecting grinding wheel defects based on machine vision according to claim 1, wherein: The method of obtaining suspected abnormal clusters from all clusters includes: The first cluster is regarded as a suspected abnormal cluster.
5. The method for detecting grinding wheel defects based on machine vision according to claim 1, wherein: The step of obtaining the confidence level of crack existence in each equally divided image corresponding to the suspected abnormal cluster according to the gradient direction of the pixel points in the equally divided image corresponding to each local density value in the suspected abnormal cluster comprises: Mark the equally divided images corresponding to the cluster centers of non-suspected abnormal clusters as reference images. After rotating the reference image and the equally divided images corresponding to each local density value in the suspected abnormal cluster to the same preset direction, respectively obtaining the gradient direction of each pixel point in each equally divided image corresponding to the reference image and the suspected abnormal cluster; For any equally divided image corresponding to the suspected abnormal cluster, mark the pixels in the equally divided image that have a gradient direction different from that of the pixels in the reference image to obtain marked pixels, and perform statistics on the gradient directions of all marked pixels according to a preset gradient direction interval to obtain a gradient direction histogram, wherein the horizontal axis of the gradient direction histogram is the gradient direction interval and the vertical axis is the number of marked pixels; The maximum ordinate value in the gradient direction histogram is obtained, recorded as the maximum amplitude, the average of all ordinate values in the gradient direction histogram except the maximum amplitude is obtained, recorded as the average amplitude, and the ratio of the maximum amplitude to the average amplitude is normalized to obtain the confidence level of the presence of cracks in any of the equally divided images.
6. The method for detecting grinding wheel defects based on machine vision according to claim 5, characterized in that: The detecting of crack defects in the grinding wheel surface according to the confidence level of the presence of cracks in each equally divided image corresponding to the suspected abnormal cluster comprises: A preset confidence threshold is obtained. If the confidence corresponding to any equally divided image in the suspected abnormal cluster is greater than the confidence threshold, it is confirmed that a crack defect exists on the surface of the grinding wheel.
Citation Information
Patent Citations
Civil air defense channel blocking method and system
CN118196082A