Diamond agglomeration detection method and device on surface of diamond wire and electronic equipment

By preprocessing the diamond line image and sliding window analysis, the diamond pixel density and sand density are comprehensively judged, and the problem of low detection efficiency and accuracy of diamond agglomeration detection efficiency and accuracy of diamond surface in the prior art is solved, achieving more efficient and accurate detection results.

CN119762407AActive Publication Date: 2025-04-04QINGDAO GAOCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311277763.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-04-04
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

In the prior art, the efficiency and accuracy of diamond agglomeration detection on the surface of diamond wires are relatively low.

Method used

By preprocessing the diamond line image to be detected, the pixel density sum of each column of pixels under M vertical sliding windows is obtained, and the sand density sum of each row of pixels under N horizontal sliding windows is obtained. The diamond pixel density and sand density meet the preset threshold value is comprehensively judged to determine whether the diamond line image is a diamond agglomeration image.

Benefits of technology

The accuracy and efficiency of diamond agglomeration detection on the surface of diamond lines is improved, the dependence of manual detection is reduced, and the generation of abnormal images is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762407A_ABST
    Figure CN119762407A_ABST
Patent Text Reader

Abstract

The invention provides a diamond wire surface diamond agglomeration detection method and device, electronic equipment and a storage medium, and relates to the field of diamond wires. The diamond agglomeration detection method on the surface of the diamond wire comprises the following steps: preprocessing a to-be-detected diamond wire image to obtain a preprocessed image, and obtaining the diamond pixel density of the preprocessed image; obtaining the diamond sand amount density of the preprocessed image; and determining whether the diamond wire image is a diamond agglomeration image according to the diamond pixel density and the diamond sand amount density. Compared with the prior art, the diamond wire surface diamond agglomeration detection method and device, the electronic equipment and the storage medium provided by the embodiment of the invention have the advantages that the diamond agglomeration detection efficiency and detection accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of diamond wires, and in particular, to a method, device, electronic device and computer-readable storage medium for detecting diamond agglomeration on the surface of a diamond wire. Background Art

[0002] Diamond wire saw, also known as diamond wire, refers to a processing tool that uses electroplating, brazing or resin bonding to fix diamond abrasives on metal wires, and uses the hardness characteristics of diamond to process silicon wafers, sapphires or ceramics. At present, diamond wire saws are mostly manufactured using electroplating technology. The electroplating process uses metal wire as the matrix and diamond powder as the abrasive. The diamond powder is deposited on the surface of the metal wire through the electroplating diamond wire saw tooling to produce a diamond wire production method for diamond wire saws.

[0003] During the production process of diamond wire, it is necessary to detect whether the diamond attached to it is agglomerated. The so-called agglomeration phenomenon is that the distribution of diamond powder attached to the diamond wire is too concentrated. However, the detection efficiency and accuracy of diamond agglomeration on the surface of diamond wire in the prior art are low. Summary of the invention

[0004] The purpose of the present application is to provide a method, device, electronic device and computer-readable storage medium for detecting diamond agglomeration on the surface of a diamond wire, which can improve the detection efficiency and detection accuracy of diamond agglomeration on the surface of a diamond wire.

[0005] In a first aspect, an embodiment of the present application provides a method for detecting diamond agglomeration on a diamond wire surface, comprising: preprocessing a diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of diamond wire pixels, and a plurality of diamond pixels; for at least part of the column pixels in the preprocessed image, obtaining the sum of the pixel densities of each column pixel under M vertical sliding windows, wherein M is an integer greater than 1; obtaining a target pixel density from the sum of the pixel densities corresponding to all the column pixels obtained, and using the target pixel density as the diamond pixel density of the preprocessed image, wherein the target pixel density The pixel density and average value of the pixel density and the sand density corresponding to all the column pixels are not less than the pixel density and the sand density corresponding to all the column pixels; for at least part of the row pixels in the preprocessed image, the sand density and the sand density of each row of pixels under N horizontal sliding windows are obtained, wherein N is an integer greater than 1; the target sand density is obtained from the sand density and the sand density corresponding to all the row pixels, and the target sand density is used as the diamond sand density of the preprocessed image, wherein the target sand density is not less than the sand density average value of the sand density and the sand density corresponding to all the row pixels; according to the diamond pixel density and the diamond sand density, it is determined whether the diamond wire image is a diamond agglomeration image.

[0006] Compared with the prior art, in the diamond agglomeration detection method on the surface of a diamond wire provided in the embodiment of the present application, the pixel density and the density of each column of pixels under M vertical sliding windows are obtained through at least part of the column pixels, and the diamond pixel density corresponding to the diamond wire image is determined according to the pixel density and the density, and the sand density and the density of each row of pixels under N horizontal sliding windows are obtained through at least part of the row pixels, and the diamond sand density corresponding to the diamond wire image is determined according to the sand density and the density, and finally, whether the diamond wire image is a diamond agglomeration image is determined according to the diamond pixel density and the diamond sand density, and whether there is a phenomenon of diamond wire agglomeration in the diamond wire image is determined by comprehensively considering the diamond pixel density and the diamond sand density, and through the comprehensive judgment of the diamond pixel density and the diamond sand density of the diamond in the diamond wire image, it can be more accurately judged whether there is a phenomenon of diamond wire agglomeration in the diamond wire image, thereby improving the accuracy of the detection result; in addition, compared with the prior art in which diamond agglomeration is detected manually, the detection of diamond agglomeration is directly realized by performing image processing and analysis on the diamond wire image in the embodiment of the present application, and the detection efficiency of diamond agglomeration is also improved.

[0007] In an optional embodiment, obtaining the sum of pixel densities of each column of pixels under M vertical sliding windows includes: for the i-th column of pixels in the preprocessed image, obtaining M pixel densities of the i-th column of pixels under the M vertical sliding windows, and taking the sum of the M pixel densities corresponding to the i-th column of pixels as the sum of pixel densities of the i-th column of pixels.

[0008] In an optional embodiment, the method of obtaining the M pixel densities of the pixels in the i-th column under the M vertical sliding windows includes: for each vertical sliding window in the i-th column of pixels, if i is less than half the window width of the vertical sliding window, the number of image columns in the vertical sliding window is expanded by mirror flipping, and the pixel density of the pixels in the i-th column under the vertical sliding window is obtained according to the image of the expanded vertical sliding window; if i is not less than half the window width of the vertical sliding window, the pixel density of the pixels in the i-th column under the vertical sliding window is obtained according to the image under the vertical sliding window. By mirror flipping the diamond wire image, it is possible to avoid the situation where the diamond wire image cannot fill the first sliding window when sampling at both ends of the diamond wire image, thereby causing the first diamond wire sub-image obtained by sampling to be abnormal, thereby reducing the generation of abnormal images and improving the accuracy of the final detection result.

[0009] In an optional embodiment, obtaining the target pixel density from the acquired sum of pixel densities corresponding to all columns of pixels includes: obtaining the maximum pixel density sum from the acquired sum of pixel densities corresponding to all columns of pixels, and using the maximum pixel density sum as the target pixel density.

[0010] In an optional embodiment, obtaining the sum of sand densities of each row of pixels in N horizontal sliding windows includes: for the kth row of pixels in the preprocessed image, obtaining N sand densities of the kth row of pixels in the N horizontal sliding windows, and taking the sum of the N sand densities corresponding to the kth row of pixels as the sum of sand densities of the kth row of pixels.

[0011] In an optional embodiment, the obtaining of the N sand densities of the k-th row of pixels in the N horizontal sliding windows includes: for each horizontal sliding window in the k-th row of pixels, if k is less than half the window width of the horizontal sliding window, then the number of image rows in the horizontal sliding window is expanded by mirror flipping, and the sand density of the k-th row of pixels under the horizontal sliding window is obtained according to the image of the expanded horizontal sliding window; if k is not less than half the window width of the horizontal sliding window, then the sand density of the k-th row of pixels under the horizontal sliding window is obtained according to the image under the horizontal sliding window. By mirror flipping the diamond wire image, it can be avoided that when sampling at both ends of the diamond wire image, the diamond wire image cannot fill the first sliding window, thereby causing the first diamond wire sub-image obtained by sampling to be abnormal, thereby reducing the generation of abnormal images and improving the accuracy of the final detection result.

[0012] In an optional embodiment, the method of obtaining the target sand density from the obtained sand density sum corresponding to all row pixels includes: obtaining the maximum sand density sum from the obtained sand density sum corresponding to all row pixels, and using the maximum sand density sum as the target sand density.

[0013] In an optional embodiment, determining whether the diamond wire image is a diamond agglomeration image based on the diamond pixel density and the diamond sand amount density includes: judging whether the diamond pixel density is not greater than a preset pixel density threshold, and judging that the diamond sand amount density is not greater than a preset sand amount density threshold; when judging that the diamond pixel density is greater than the preset pixel density threshold, or judging that the diamond sand amount density is greater than the preset sand amount density threshold, then determining that the diamond wire image is the diamond agglomeration image; otherwise, determining that the diamond wire image is a non-diamond agglomeration image.

[0014] In an optional embodiment, the diamond wire image to be detected is preprocessed to obtain a preprocessed image, including: converting the diamond wire image into a grayscale image; clustering the pixel points in the grayscale image through three preset clustering centers to obtain a ternary image, and using the ternary image as the preprocessed image.

[0015] In a second aspect, an embodiment of the present application provides a device for detecting diamond agglomeration on a diamond wire surface, comprising: an image acquisition module, the image acquisition module being used to acquire an image of a diamond wire to be detected;

[0016] A preprocessing module, the preprocessing module is used to preprocess the diamond wire image to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of diamond wire pixels and a plurality of diamond pixels; a pixel density acquisition module, the pixel density acquisition module is used to obtain the sum of pixel densities of each column of pixels under M vertical sliding windows for at least part of the column pixels in the preprocessed image, wherein M is an integer greater than 1; obtain a target pixel density from the obtained sum of pixel densities corresponding to all column pixels, and use the target pixel density as the diamond pixel density of the preprocessed image, wherein the target pixel density is not less than the sum of pixel densities corresponding to all column pixels. The invention relates to a diamond wire image of a plurality of diamond agglomerates, wherein the diamond wire image is a plurality of diamond agglomerates, and the diamond wire image is a plurality of diamond agglomerates. The invention relates to a diamond wire image of a plurality of diamond agglomerates, wherein the diamond wire image is a plurality of diamond agglomerates, and the diamond wire image is ...

[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the diamond agglomeration detection method on the surface of a diamond wire as described above.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the aforementioned method for detecting diamond agglomeration on the surface of a diamond wire. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic flow chart of a method for detecting diamond agglomeration on a diamond wire surface provided in Example 1 of the present application;

[0021] Figure 2 A schematic diagram of a process for preprocessing a diamond wire image in a method for detecting diamond agglomeration on a diamond wire surface provided in Example 1 of the present application;

[0022] Figure 3 A schematic diagram of the structure of a device for detecting diamond agglomeration on a diamond wire surface provided in Example 2 of the present application;

[0023] Figure 4 A schematic diagram of the structure of a device for detecting diamond agglomeration on a diamond wire surface provided by another embodiment of the present application;

[0024] Figure 5 This is a schematic diagram of the structure of the electronic device provided in Example 3 of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0026] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0027] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0028] In the description of the present application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, or are the orientation or position relationship in which the product of the application is usually placed when used. This is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.

[0029] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0030] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0031] Embodiment 1 of the present application provides a method for detecting diamond agglomeration on the surface of a diamond wire. Figure 1 As shown, including:

[0032] Step S101: Acquire a diamond wire image.

[0033] In some embodiments of the present application, the image of the diamond wire roll to be tested can be captured in real time by a camera module, and each image captured in real time can be used as a diamond wire image; or after the camera module has captured all the images of the diamond wire roll to be tested, they can be stored in a server, and then one or more captured images can be obtained from the server as diamond wire images.

[0034] Among them, the camera module can be a camera, an industrial camera, a video camera and other equipment, which can be flexibly configured according to actual conditions, and this manual does not impose specific restrictions.

[0035] Step S102: pre-processing the diamond wire image to obtain a pre-processed image.

[0036] In this step, the preprocessed image can be a ternary image, that is, the diamond wire image is converted into a ternary image. The ternary image is to map the common 256 grayscale levels (or higher grayscale levels) into an image including 3 different grayscale levels. In this application, the three different grayscale levels correspond to a plurality of background pixels, a plurality of diamond pixels, and a plurality of busbar pixels. Taking the diamond wire image as a color image as an example, the specific steps of the preprocessing process are as follows: Figure 2 As shown, including:

[0037] Step S201: converting the diamond wire image into a grayscale image.

[0038] In this step, converting the colored diamond wire image into a grayscale image can specifically be converting the three-channel RGBA pixel value of each pixel in the colored diamond wire image into a single-channel grayscale value. For example, the formula Gray=R*0.299+G*0.587+B*0.114 can be used for conversion, wherein Gray is the grayscale value of the pixel after conversion, R is the color intensity value of the colored pixel in the red channel, G is the color intensity value of the colored pixel in the green channel, and B is the color intensity value of the colored pixel in the blue channel.

[0039] Step S202: clustering the pixels in the grayscale image using three preset cluster centers to obtain a ternary image.

[0040] In this step, the three preset cluster centers can be randomly selected and set values ​​that are spaced a certain size from each other. The spacing size can be a constant value, which can be flexibly set according to different practical application scenarios such as the shooting method of the diamond wire image, the shooting environment, and the type of diamond wire. For example, for a shooting environment with low brightness, a lower spacing size can be set, and for a type of diamond wire with high diamond transparency, a lower spacing size can be set.

[0041] In some embodiments of the present application, the three randomly selected set values ​​may be, for example, 50, 100, and 150. This set value is more consistent with the grayscale values ​​of background pixels, diamond pixels, and busbar pixels in actual applications. Clustering operations using this set value can better separate diamond pixels in a single-channel grayscale image, improve the accuracy of diamond pixel separation, and thus improve the accuracy of the final diamond wire sand amount detection result.

[0042] In different embodiments of the present application, different clustering algorithms can be used to perform clustering operations on the grayscale values ​​of multiple pixels. For example, clustering algorithms such as kmeans clustering algorithm, Mean-Shift clustering algorithm, and composite clustering algorithm can be used to perform clustering operations on the grayscale values ​​of multiple pixels. Taking the kmeans clustering algorithm as an example, the absolute difference between the grayscale value of each pixel and three set values ​​can be calculated respectively. The cluster center with the smallest absolute difference is the cluster center of the pixel. It is judged whether the clustering algorithm has converged (for example, it can be judged whether the sum of the absolute differences between all pixels belonging to the same cluster center and the cluster center is greater than a certain set threshold. If it is greater than the set threshold, the clustering algorithm has not converged. On the contrary, if it is less than or equal to the set threshold, the clustering algorithm has converged. Alternatively, it can also be judged whether the number of operations reaches the threshold number, etc.), if the clustering algorithm has converged Convergence, then the clustering result with the largest grayscale value at this time can be used as the diamond pixel, the clustering result with the smallest grayscale value can be used as the background pixel, and the clustering result with the grayscale value in the middle can be used as the busbar pixel; on the contrary, if the clustering algorithm does not converge, the cluster center can be recalculated according to the pixel grayscale values ​​of the pixels belonging to the same cluster center, for example, the mean of the pixel grayscale values ​​of all pixels whose cluster center is any set value can be used as the new cluster center of the diamond pixel, and the absolute difference between the pixel grayscale value of each pixel and the new cluster center is calculated again until the clustering algorithm converges. In the present application, three different grayscale levels correspond to multiple background pixels, multiple diamond pixels, and multiple busbar pixels, respectively. Classifying the background pixels, busbar pixels, and diamond pixels of the diamond line in the ternary image can make the accuracy of the determined diamond pixels higher and improve the overall detection accuracy of the sand volume detection.

[0043] Step S103: for at least part of the columns of pixels in the preprocessed image, obtain the sum of the pixel densities of each column of pixels in M ​​vertical sliding windows.

[0044] In this step, taking the i-th column of pixels in the preprocessed image as an example, i can be taken from 1 to R in sequence, where R is the total number of pixel columns in the preprocessed image, or it can be taken from 1 to R at fixed intervals, or it can be randomly taken from 1 to R, which can be set according to actual needs. For the i-th column of pixels, M pixel densities of the i-th column of pixels under M vertical sliding windows can be obtained, and the sum of the M pixel densities corresponding to the i-th column of pixels is taken as the sum of the pixel densities of the i-th column of pixels. That is, the i-th column of pixels corresponds to M vertical sliding windows, and the vertical central axis of each sliding window overlaps with the i-th column of pixels. At this time, each sliding window can be a sub-image sampled from the preprocessed image, and each sub-image corresponds to a pixel density. The M vertical sliding windows correspond to M pixel densities, and the sum of the M pixel densities is the sum of the pixel densities under the M vertical sliding windows corresponding to the i-th column of pixels.

[0045] For each sub-image sampled by the vertical sliding window, the pixel density can be calculated as the ratio of the number of diamond pixels in the sub-image to the number of all pixels in the sub-image. That is, the number of diamond pixels and the number of all pixels in the sub-image are obtained, and then the ratio of the number of diamond pixels to the number of all pixels is calculated to be the pixel density of each sub-image.

[0046] The window height of the vertical sliding window may be the number of pixel rows of the preprocessed image, and the window width may range from 10 to 60 pixels. By setting the window width within this range, it is possible to avoid the number of pixels in the first diamond wire sub-image being too small or too large, thereby reducing the accuracy of the calculation result, thereby improving the accuracy of the final detection result.

[0047] In addition, in some embodiments of the present application, for each vertical sliding window in the i-th column of pixels, if i is less than half the window width of the vertical sliding window, before using the sliding window to sample the sub-image from the pre-processed image, the number of image columns in the vertical sliding window can be expanded by mirror flipping, and then the sub-image can be sampled; if i is not less than half the window width of the vertical sliding window, the sub-image can be sampled directly. By mirror flipping the pre-processed image, it can be avoided that when sampling at both ends of the pre-processed image, the pre-processed image cannot fill the vertical sliding window, thereby causing the sampled sub-image to be abnormal, reducing the generation of abnormal images, and improving the accuracy of the final detection result. For example, for the sampling pixel column is the pixel column of each column, there is no pixel point on one side. At this time, the sliding window is used to sample the sub-image, and there is no pixel point on one side, so only a partial image can be intercepted. Before using the sliding window to sample the sub-image, the pre-processed image can be flipped, and one side of the pixel column of each column is supplemented, and then the sliding window is used to sample the sub-image.

[0048] The image flipping of the preprocessed image is to mirror-flip the preprocessed image with the edge pixel columns on both sides of the preprocessed image as the symmetry axis, so as to supplement the preprocessed image on both sides of the preprocessed image.

[0049] Further, in some embodiments of the present application, the preprocessed image may be partially mirror-flipped at both ends of the preprocessed image according to the width of the vertical sliding window. Performing partial mirror-flipping on the preprocessed image may reduce the amount of calculation in the mirror-flipping process and improve detection efficiency. The partially mirror-flipped preprocessed image may be, for example, a partial diamond wire image having a width equal to the width of the vertical sliding window.

[0050] Step S104: Obtain a target pixel density from the acquired sum of pixel densities corresponding to all column pixels, and use the target pixel density as the diamond pixel density of the preprocessed image.

[0051] In this step, the target pixel density is not less than the average value of the sum of the pixel densities corresponding to all column pixels.

[0052] Furthermore, in some embodiments of the present application, the maximum pixel density sum can be obtained from the obtained pixel density sums corresponding to all column pixels, and the maximum pixel density sum can be used as the target pixel density.

[0053] It can be understood that the aforementioned obtaining of the maximum pixel density sum from the obtained pixel densities corresponding to all column pixels and taking the maximum pixel density sum as the target pixel density is merely an example in some embodiments of the present application. In some other embodiments of the present application, the pixel density sum and the average value of the pixel density sum corresponding to all column pixels may also be taken as the target pixel density.

[0054] Taking the diamond wire image with a width of 659 pixels as an example, the serial numbers of each pixel column in the diamond wire image are 1 to 659, and the image pixel height is recorded as H. For example, at the 100th column, when the sliding window width is 11, take the 95th to 105th columns (all rows), and the image in the range is the sub-image corresponding to the 100th column. First calculate the number of diamond pixels cn in this range, and the diamond pixel density at this size is cn / (11*H). Similarly, when the sliding window width is 21, take the image in the range of the 90th to 110th columns (all rows), and the diamond pixel density at this size is cn / (21*H). After calculating the diamond pixel density of all sizes at this position, sum all the obtained densities and record them as the pixel density and R100 corresponding to the 100th pixel column. The calculation method for other pixel columns is the same. After obtaining the pixel density and R of all pixel columns, return the largest one as the diamond pixel density.

[0055] Step S105: for at least part of the row pixels in the preprocessed image, obtain the sum of the sand density of each row pixel under N horizontal sliding windows.

[0056] In this step, taking the kth row of pixels in the preprocessed image as an example, k can be taken from 1 to Q in sequence, Q is the total number of pixel rows in the preprocessed image, or it can be taken from 1 to Q at fixed intervals, or it can be randomly taken from 1 to Q, which can be set according to actual needs. For the kth row of pixels, the N sand density of the kth row of pixels under N horizontal sliding windows can be obtained, and the sum of the N sand density corresponding to the kth row of pixels is taken as the sum of the sand density of the kth row of pixels. That is, the kth row of pixels corresponds to N horizontal sliding windows, and the horizontal central axis of each sliding window overlaps with the kth row of pixels. At this time, each sliding window can be a sub-image sampled from the preprocessed image, and each sub-image corresponds to a sand density. N horizontal sliding windows correspond to N sand densities, and the sum of the N sand densities is the sum of the sand density under the N horizontal sliding windows corresponding to the kth row of pixels.

[0057] Wherein, obtaining the sand density of the sub-image may include:

[0058] S1: Acquire multiple diamond connected domains formed by diamond pixel points in a sub-image, where the multiple diamond connected domains are spaced apart from each other.

[0059] In this step, a connected domain analysis may be performed on the diamond wire image to obtain marked connected domains corresponding to a plurality of diamond pixel points as diamond connected domains, and finally obtain a plurality of mutually spaced diamond connected domains.

[0060] In addition, in some embodiments of the present application, the connected domain analysis may include a two-pass scanning method (Two-Pass) and a seed-filling method (Seed-Filling), etc., which are not specifically limited in this specification.

[0061] Among them, for each sub-image sampled by the horizontal sliding window, the sand density can be calculated as the ratio of the amount of diamond sand in the sub-image to the total number of pixels in the sub-image. That is, the amount of diamond sand in the sub-image and the total number of pixels in the sub-image are obtained, and the ratio of the amount of diamond sand to the total number of pixels is calculated as the sand density of the sub-image.

[0062] S2: According to the multiple diamond connected domains in the sub-image, the amount of diamond grit corresponding to the sub-image is obtained.

[0063] Specifically, the number of diamonds corresponding to each diamond connected domain can be obtained respectively, and the sum of the number of diamonds corresponding to all diamond connected domains is the amount of diamond grit corresponding to the sub-image.

[0064] The window width of the horizontal sliding window can be the number of pixel columns of the preprocessed image, and the window height can be in the range of 5 to 10 pixels. Setting the window width within this range can avoid the number of diamonds in the sub-image being too small or too large, which may lead to a decrease in the accuracy of the calculation result, thereby improving the accuracy of the final detection result.

[0065] In addition, in some embodiments of the present application, for each horizontal sliding window in the kth row of pixels, if k is less than half the window height of the horizontal sliding window, before using the sliding window to sample the sub-image from the pre-processed image, the number of image rows in the horizontal sliding window can be expanded by mirror flipping, and then the sub-image can be sampled; if k is not less than half the window height of the horizontal sliding window, the sub-image can be sampled directly. By mirror flipping the pre-processed image, it can be avoided that when sampling at both ends of the pre-processed image, the pre-processed image cannot fill the horizontal sliding window, thereby causing the sampled sub-image to be abnormal, reducing the generation of abnormal images and improving the accuracy of the final detection result. For example, for the sampling pixel row of each row of pixels, there is no pixel point on one side. At this time, the sliding window is used to sample the sub-image, and there is no pixel point on one side, so only a partial image can be intercepted. Before using the sliding window to sample the sub-image, the pre-processed image can be flipped, and one side of each row of pixels can be supplemented, and then the sliding window can be used to sample the sub-image.

[0066] The image flipping of the preprocessed image is to mirror-flip the preprocessed image with the edge pixel rows on both sides of the preprocessed image as the symmetry axis, so as to supplement the preprocessed image on both sides of the preprocessed image.

[0067] Further, in some embodiments of the present application, the preprocessed image can be partially mirror-flipped at both ends of the preprocessed image according to the height of the horizontal sliding window. Partially mirror-flipping the preprocessed image can reduce the amount of calculation in the mirror-flipping process and improve the detection efficiency. The partially mirror-flipped preprocessed image can, for example, be a partial diamond wire image whose height is the height of the horizontal sliding window.

[0068] Step S106: Obtain a target sand density from the sum of the sand densities corresponding to all row pixels, and use the target sand density as the diamond sand density of the preprocessed image.

[0069] In this step, the target sand density is not less than the average sand density and sand volume corresponding to all row pixels.

[0070] Furthermore, in some embodiments of the present application, the maximum sand density sum can be obtained from the sand density sums corresponding to all row pixels obtained, and the maximum sand density sum can be used as the target sand density.

[0071] It can be understood that the aforementioned obtaining of the maximum sand density sum from the sand density sum corresponding to all row pixels and taking the maximum sand density sum as the target sand density is merely an example in some embodiments of the present application. In some other embodiments of the present application, the average value of the sand density sum of the sand density sum corresponding to all row pixels may also be taken as the target sand density.

[0072] Step S107: determining whether the diamond wire image is a diamond agglomeration image according to the diamond pixel density and the diamond grit density.

[0073] In this step, it can be determined whether the target pixel density is not greater than the preset pixel density threshold, and whether the target sand density is not greater than the preset sand density threshold; when it is determined that the target pixel density is greater than the preset pixel density threshold, or when it is determined that the target sand density is greater than the preset sand density threshold, the diamond wire image is determined to be a diamond agglomeration image; otherwise, the diamond wire image is determined to be a non-diamond agglomeration image.

[0074] Compared with the prior art, in the diamond agglomeration detection method on the surface of diamond wire provided in the first embodiment of the present application, the pixel density and the density of each column of pixels under M vertical sliding windows are obtained through at least part of the column pixels, and the diamond pixel density corresponding to the diamond wire image is determined according to the pixel density and the density, and the sand density and the density of each row of pixels under N horizontal sliding windows are obtained through at least part of the row pixels, and the diamond sand density corresponding to the diamond wire image is determined according to the sand density and the density, and finally, whether the diamond wire image is a diamond agglomeration image is determined according to the diamond pixel density and the diamond sand density, and whether there is a phenomenon of diamond wire agglomeration in the diamond wire image is determined by comprehensively considering the diamond pixel density and the diamond sand density, and through the comprehensive judgment of the diamond pixel density and the diamond sand density of the diamond in the diamond wire image, it can be more accurately judged whether there is a phenomenon of diamond wire agglomeration in the diamond wire image, thereby improving the accuracy of the detection result; in addition, compared with the prior art in which diamond agglomeration is detected manually, the detection of diamond agglomeration is directly realized by performing image processing and analysis on the diamond wire image in the embodiment of the present application, and the detection efficiency of diamond agglomeration is also improved.

[0075] Embodiment 2 of the present application relates to a device for detecting diamond agglomeration on the surface of a diamond wire, such as Figure 3As shown, it includes: an image acquisition module 301, the image acquisition module 301 is used to acquire the diamond wire image to be detected; a preprocessing module 302, the preprocessing module 302 is used to preprocess the diamond wire image to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of diamond wire pixels and a plurality of diamond pixels; a pixel density acquisition module 303, the pixel density acquisition module 303 is used to obtain the sum of the pixel densities of each column of pixels under M vertical sliding windows for at least part of the column pixels in the preprocessed image, wherein M is an integer greater than 1; obtain the target pixel density from the sum of the pixel densities corresponding to all the column pixels obtained, and use the target pixel density as the diamond pixel density of the preprocessed image, wherein , the target pixel density is not less than the pixel density and average value of the sum of the pixel densities corresponding to all column pixels; a sand density acquisition module 304, the sand density acquisition module 304 is used to obtain the sand density and the sand density of each row of pixels under N horizontal sliding windows for at least part of the pixels in the preprocessed image, wherein N is an integer greater than 1; the target sand density is obtained from the sand density and the sand density corresponding to all row pixels, and the target sand density is used as the diamond sand density of the preprocessed image, wherein the target sand density is not less than the sand density average value of the sum of the sand density corresponding to all row pixels; a judgment module 305, the judgment module 305 is used to determine whether the diamond wire image is a diamond agglomeration image according to the diamond pixel density and the diamond sand density.

[0076] Compared with the prior art, in the diamond agglomeration detection device for the diamond wire surface provided in the first embodiment of the present application, the pixel density acquisition module 303 acquires the pixel density sum of each column pixel under M vertical sliding windows through at least part of the column pixels, and determines the diamond pixel density corresponding to the diamond wire image according to the pixel density sum, the sand density acquisition module 304 acquires the sand density sum of each row pixel under N horizontal sliding windows through at least part of the row pixels, and determines the diamond sand density corresponding to the diamond wire image according to the sand density sum, and finally the judgment module 305 determines whether the diamond wire image is For a diamond agglomeration image, the judgment module 305 comprehensively considers the diamond pixel density and the diamond sand density to determine whether there is a phenomenon of diamond wire agglomeration in the diamond wire image. Through the comprehensive judgment of the diamond pixel density and the diamond sand density of the diamond in the diamond wire image, it is possible to more accurately judge whether there is a phenomenon of diamond wire agglomeration in the diamond wire image, thereby improving the accuracy of the detection result. In addition, compared with the manual detection of diamond agglomeration in the prior art, the detection of diamond agglomeration is directly realized by performing image processing and analysis on the diamond wire image in the embodiment of the present application, and its detection efficiency of diamond agglomeration is also improved.

[0077] Further, in some embodiments of the present application, Figure 4As shown, an image flipping module 306 may also be included. The image flipping module 306 is used to expand the number of image columns in the vertical sliding window by mirror flipping when i is less than half the window width of the vertical sliding window. The pixel density acquisition module 303 acquires the pixel density of the i-th column of pixels under the vertical sliding window based on the image of the expanded vertical sliding window.

[0078] In some embodiments of the present application, the image flipping module 306 is further configured to expand the number of image rows in the horizontal sliding window by mirror flipping when k is less than half the window width of the horizontal sliding window.

[0079] In some embodiments of the present application, the pixel density acquisition module 303 is also used to obtain M pixel densities of the i-th column pixels in M ​​vertical sliding windows for the i-th column pixels in the preprocessed image, and take the sum of the M pixel densities corresponding to the i-th column pixels as the sum of the pixel densities of the i-th column pixels.

[0080] In some embodiments of the present application, the pixel density acquisition module 303 is further used to obtain the maximum pixel density sum from the obtained pixel density sums corresponding to all column pixels, and use the maximum pixel density sum as the target pixel density.

[0081] In some embodiments of the present application, the sand density acquisition module 304 is also used to obtain N sand densities of the k-th row of pixels in N horizontal sliding windows for the k-th row of pixels in the preprocessed image, and take the sum of the N sand densities corresponding to the k-th row of pixels as the sum of the sand densities of the k-th row of pixels.

[0082] In some embodiments of the present application, the sand density acquisition module 304 is further used to obtain the maximum sand density sum from the sand density sums corresponding to all acquired row pixels, and use the maximum sand density sum as the target sand density.

[0083] In some embodiments of the present application, the judgment module 305 is also used to judge whether the diamond pixel density is not greater than a preset pixel density threshold, and to judge whether the diamond sand density is not greater than a preset sand density threshold; when it is judged that the diamond pixel density is greater than the preset pixel density threshold, or when it is judged that the diamond sand density is greater than the preset sand density threshold, the diamond wire image is determined to be a diamond agglomeration image; otherwise, the diamond wire image is determined to be a non-diamond agglomeration image.

[0084] In some embodiments of the present application, the preprocessing module 302 is also used to convert the diamond wire image into a grayscale image; cluster the pixels in the grayscale image through three preset clustering centers to obtain a ternary image, and use the ternary image as the preprocessed image.

[0085] Embodiment 3 of the present application relates to an electronic device, such as Figure 5As shown, it includes: at least one processor 401; and a memory 402 that is communicatively connected to the at least one processor 401; wherein the memory 402 stores instructions that can be executed by the at least one processor 401, and the instructions are executed by the at least one processor 401, so that the at least one processor 401 can execute the diamond agglomeration detection method on the diamond wire surface in the above-mentioned embodiments.

[0086] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0087] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0088] Embodiment 4 of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiment is implemented.

[0089] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0090] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for detecting diamond agglomeration on the surface of a diamond wire, characterized in that: include: Preprocessing the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixel points, a plurality of diamond wire pixel points, and a plurality of diamond pixel points; For at least part of the columns of pixels in the preprocessed image, obtain the sum of the pixel densities of each column of pixels under M vertical sliding windows, where M is an integer greater than 1; Obtaining a target pixel density from the obtained sum of pixel densities corresponding to all columns of pixels, and using the target pixel density as the diamond pixel density of the preprocessed image, wherein the target pixel density is not less than an average value of the sum of pixel densities corresponding to all columns of pixels; For at least part of the row pixels in the preprocessed image, obtain the sum of the sand density of each row pixel under N horizontal sliding windows, where N is an integer greater than 1; Obtaining a target sand density from the sand density and corresponding to all the row pixels, and using the target sand density as the diamond sand density of the preprocessed image, wherein the target sand density is not less than the average sand density of the sand density and corresponding to all the row pixels; Whether the diamond wire image is a diamond agglomeration image is determined according to the diamond pixel density and the diamond grit density.

2. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 1, characterized in that: The obtaining of the sum of pixel densities of each column of pixels under M vertical sliding windows includes: For the i-th column of pixels in the preprocessed image, obtain M pixel densities of the i-th column of pixels under the M vertical sliding windows, and take the sum of the M pixel densities corresponding to the i-th column of pixels as the sum of pixel densities of the i-th column of pixels.

3. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 2, characterized in that: The obtaining M pixel densities of the i-th column of pixels in the M vertical sliding windows includes: For each vertical sliding window in the i-th column of pixels, if i is less than half the window width of the vertical sliding window, the number of image columns in the vertical sliding window is expanded by mirror flipping, and the pixel density of the i-th column of pixels under the vertical sliding window is obtained according to the image of the expanded vertical sliding window; if i is not less than half the window width of the vertical sliding window, the pixel density of the i-th column of pixels under the vertical sliding window is obtained according to the image under the vertical sliding window.

4. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 1, characterized in that: The step of obtaining the target pixel density from the sum of the pixel densities corresponding to all the column pixels obtained includes: The maximum pixel density sum is obtained from the obtained pixel density sums corresponding to all column pixels, and the maximum pixel density sum is used as the target pixel density.

5. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 1, characterized in that: The method of obtaining the sand density sum of each row of pixels under N horizontal sliding windows includes: For the k-th row of pixels in the preprocessed image, obtain N sand density of the k-th row of pixels in the N horizontal sliding windows, and take the sum of the N sand density corresponding to the k-th row of pixels as the sum of the sand density of the k-th row of pixels.

6. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 5, characterized in that: The obtaining of N sand density of the k-th row of pixels in the N horizontal sliding windows includes: For each horizontal sliding window in the k-th row of pixels, if k is less than half the window width of the horizontal sliding window, the number of image rows in the horizontal sliding window is expanded by mirror flipping, and the sand density of the k-th row of pixels under the horizontal sliding window is obtained according to the image of the expanded horizontal sliding window; if k is not less than half the window width of the horizontal sliding window, the sand density of the k-th row of pixels under the horizontal sliding window is obtained according to the image under the horizontal sliding window.

7. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 5, characterized in that: The step of obtaining the target sand density from the sand density corresponding to all the row pixels includes: The maximum sand density sum is obtained from the sand density sums corresponding to all row pixels, and the maximum sand density sum is used as the target sand density.

8. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 1, characterized in that: The determining, according to the diamond pixel density and the diamond grit density, whether the diamond wire image is a diamond agglomeration image comprises: Determine whether the diamond pixel density is not greater than a preset pixel density threshold, and determine whether the diamond sand density is not greater than a preset sand density threshold; When it is determined that the diamond pixel density is greater than the preset pixel density threshold, or when it is determined that the diamond sand density is greater than the preset sand density threshold, the diamond wire image is determined to be the diamond agglomeration image; otherwise, the diamond wire image is determined to be a non-diamond agglomeration image.

9. The method for detecting diamond agglomeration on the surface of a diamond wire according to claim 1, characterized in that: The step of preprocessing the diamond wire image to be detected to obtain a preprocessed image includes: Converting the diamond wire image into a grayscale image; The pixels in the grayscale image are clustered using three preset cluster centers to obtain a ternary image, and the ternary image is used as the preprocessed image.

10. A device for detecting diamond agglomeration on the surface of a diamond wire, characterized in that: include: An image acquisition module, wherein the image acquisition module is used to acquire an image of a diamond wire to be detected; A preprocessing module, the preprocessing module is used to preprocess the diamond wire image to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of diamond wire pixels and a plurality of diamond pixels; A pixel density acquisition module, the pixel density acquisition module is used to acquire the sum of pixel densities of each column of pixels under M vertical sliding windows for at least part of the columns of pixels in the preprocessed image, wherein M is an integer greater than 1; acquire a target pixel density from the acquired sum of pixel densities corresponding to all columns of pixels, and use the target pixel density as the diamond pixel density of the preprocessed image, wherein the target pixel density is not less than the average value of the sum of pixel densities corresponding to all columns of pixels; A sand density acquisition module, the sand density acquisition module is used to obtain the sand density sum of each row of pixels under N horizontal sliding windows for at least part of the row pixels in the preprocessed image, wherein N is an integer greater than 1; obtain a target sand density from the sand density sum corresponding to all the acquired row pixels, and use the target sand density as the diamond sand density of the preprocessed image, wherein the target sand density is not less than the average sand density of the sand density sum corresponding to all the row pixels; A judgment module is used to determine whether the diamond wire image is a diamond agglomeration image according to the diamond pixel density and the diamond grit density.

11. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for detecting diamond agglomeration on the surface of a diamond wire as described in any one of claims 1 to 9.

12. A computer-readable storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the method for detecting diamond agglomeration on the surface of a diamond wire as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for detecting density and distribution of diamond wire abrasive particles

    CN102890039A

  • Diamond wire surface carborundum particle quality detection method based on machine vision

    CN113063705A