Diamond wire sand amount detection method and device, electronic equipment and storage medium
By preprocessing and connecting domain analysis of the diamond line image, and combining the single pixel quantity to split the connection domain, the problem of low sand detection efficiency and accuracy of diamond line in the prior art is solved, and more efficient and accurate sand detection is achieved.
Patent Information
- Application Number
- CN202311284939.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, the efficiency and accuracy of the detection of the sand quantity of diamond wire is relatively low.
By preprocessing the diamond line image, a trivalued image is obtained, a connection domain analysis is performed, a large connection domain subset is selected, and each connection domain in the large connection domain subset is split using the single pixel amount corresponding to a single diamond, thereby determining the amount of sand of the diamond line.
The accuracy and efficiency of the detection of the amount of sand in the diamond line can be improved, and the number of diamond particles attached to the diamond line can be more accurately determined.
Smart Images

Figure CN119784663A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of diamond wires, and more specifically, to a diamond wire sand amount detection method, device, electronic device, and computer-readable storage medium. 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 particles as the abrasive. The diamond particles are 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, the amount of diamond grit attached to it needs to be detected. The so-called diamond grit refers to the number of diamond particles attached to the diamond wire. However, the detection efficiency and accuracy of the grit amount of diamond wire in the prior art are low. Summary of the invention
[0004] The purpose of the present application is to provide a diamond wire sand amount detection method, device, electronic device and computer-readable storage medium, which can improve the sand amount detection efficiency and detection accuracy of diamond wire.
[0005] In a first aspect, the present application provides a diamond wire sand amount detection method, comprising: preprocessing an acquired diamond wire image to obtain a preprocessed ternary image, wherein the ternary image includes multiple background pixels, multiple diamond pixels and multiple busbar pixels; performing connected domain analysis on the ternary image to obtain a connected domain set corresponding to the multiple diamond pixels, wherein the connected domain set includes multiple connected domains; selecting a large connected domain subset from the connected domain set according to a set pixel quantity, wherein the number of pixels contained in each connected domain in the large connected domain subset is greater than the set pixel quantity; using the single pixel quantity corresponding to a single diamond, splitting each connected domain in the large connected domain subset to obtain the number of split connected domains corresponding to the large connected domain subset; determining the sand amount corresponding to the diamond wire image according to the remaining connected domain quantity and the split connected domain quantity, wherein the remaining connected domain quantity is the total amount of all connected domains in the connected domain set except the large connected domain subset.
[0006] Compared with the prior art, in the diamond wire sand amount detection method provided in the embodiment of the present application, the diamonds attached to the busbar form a diamond pixel point gathering area in the diamond wire image, that is, a connected domain. Since the diamonds attached to the busbar may partially overlap, the partially overlapping diamonds also form a separate connected domain on the diamond image. However, since the number of diamonds forming each connected domain is different, the number of diamond pixel points corresponding to each connected domain is also different. According to the set pixel amount, a large connected domain subset is selected from the connected domain set to obtain a connected domain formed by multiple diamonds. The remaining connected domain is the connected domain formed by a single diamond. The connected domain is connected by the set pixel amount. The connected domains of multiple diamonds and the connected domains corresponding to a single diamond are separated. For the large connected domain subset formed by the connected domains corresponding to multiple diamonds, each connected domain in the large connected domain subset is split using the single pixel quantity corresponding to a single diamond to obtain the number of split connected domains corresponding to the large connected subset. The number of diamonds corresponding to all the connected domains in the large connected domain subset can be determined more accurately, thereby improving the accuracy of sand amount detection of the diamond wire. In addition, compared with the prior art in which the sand amount is detected and identified manually, the sand amount of the diamond wire is directly obtained by performing image processing and analysis on the diamond wire image in the embodiment of the present application, and the detection efficiency of the sand amount of the diamond wire is also improved.
[0007] In an optional embodiment, the method of using the number of single pixels corresponding to a single diamond to split each connected domain in the large connected domain subset to obtain the number of split connected domains corresponding to the large connected domain subset includes: for each connected domain in the large connected domain subset, determining the number of splits corresponding to the connected domain according to the number of pixels occupied by the connected domain and the number of single pixels; and determining the number of split connected domains according to the sum of the number of splits of all connected domains in the large connected domain subset. Determining the number of diamonds corresponding to each connected domain according to the number of pixels in each connected domain can more accurately obtain the number of diamonds corresponding to each connected domain, and finally determining the amount of sand in the diamond wire according to the number of diamonds corresponding to all connected domains in the large connected domain subset can also be more accurate.
[0008] In an optional implementation, for each connected domain in the large connected domain subset, the number of splits corresponding to the connected domain is determined based on the number of pixels occupied by the connected domain and the number of single pixels, including: for each connected domain in the large connected domain subset, obtaining the ratio of the number of pixels occupied by the connected domain to the number of single pixels, and determining the number of splits corresponding to the connected domain based on the ratio corresponding to the connected domain.
[0009] In an optional embodiment, before using the single pixel quantity corresponding to a single diamond to split each connected domain in the large connected domain subset, the method also includes: obtaining the average number of pixels corresponding to all connected domains in the connected domain set as a first pixel quantity; and determining the single pixel quantity based on the first pixel quantity.
[0010] In an optional embodiment, before using the single pixel quantity corresponding to a single diamond to split each connected domain in the large connected domain subset, the method further includes: obtaining a specified connected domain subset whose pixel quantity is within a set pixel range in the connected domain set; obtaining the average pixel quantity corresponding to all connected domains in the specified connected domain subset as a second pixel quantity; and determining the single pixel quantity based on the second pixel quantity. Using the average pixel quantity of the specified connected domain subset within the set pixel range as the second pixel quantity can make the second pixel quantity more compatible with the diamond wire image, so that each connected domain in the large connected domain subset can be split more accurately.
[0011] In an optional implementation, the set pixel range is 5 pixels to 40 pixels.
[0012] In an optional embodiment, the preprocessing of the acquired diamond wire image to obtain the preprocessed ternary image includes: converting the diamond wire image into a grayscale image; clustering the pixel points in the grayscale image through three preset clustering centers to obtain the ternary image.
[0013] In a second aspect, the present application provides a diamond wire sand amount detection device, an image acquisition module, the image acquisition module is used to acquire a diamond wire image; an image preprocessing module, the image preprocessing module is used to preprocess the acquired diamond wire image to obtain a preprocessed ternary image, wherein the ternary image includes a plurality of background pixels, a plurality of diamond pixels and a plurality of busbar pixels; a connected domain analysis module, the connected domain analysis module is used to perform a connected domain analysis on the ternary image to obtain a connected domain set corresponding to the plurality of diamond pixels, wherein the connected domain set includes a plurality of connected domains; a connected domain classification module, the connected domain classification module is used to classify the diamond wire image according to the connected domain. A set pixel quantity is provided, and a large connected domain subset is selected from the connected domain set, wherein the pixel quantity contained in each connected domain in the large connected domain subset is greater than the set pixel quantity; a connected domain splitting module is provided, wherein the connected domain splitting module is used to split each connected domain in the large connected domain subset using the single pixel quantity corresponding to a single diamond, and obtain the number of split connected domains corresponding to the large connected domain subset; a data statistics module is provided, wherein the data statistics module is used to determine the amount of sand corresponding to the diamond wire image according to the number of remaining connected domains and the number of split connected domains, wherein the number of remaining connected domains is the total amount of all connected domains in the connected domain set except the large connected domain subset.
[0014] In a third aspect, 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 wire sand amount detection method as described in any one of the aforementioned embodiments.
[0015] In a fourth aspect, 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 diamond wire sand amount detection method described in any one of the aforementioned embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] Figure 1 A schematic diagram of the flow chart of the diamond wire sand amount detection method provided in Example 1 of the present application;
[0018] Figure 2A schematic diagram of the image preprocessing process in a diamond wire sand amount detection method provided in an embodiment of the present application;
[0019] Figure 3 A schematic diagram of a diamond image in a diamond wire grit amount detection method provided by an embodiment of the present application;
[0020] Figure 4 A schematic diagram of a process for determining the amount of a single pixel in a diamond wire grit amount detection method provided in an embodiment of the present application;
[0021] Figure 5 A schematic diagram of a process for determining the amount of a single pixel in a diamond wire grit amount detection method provided in another embodiment of the present application;
[0022] Figure 6 A schematic diagram of the structure of a diamond wire sand quantity detection device provided in Example 2 of the present application;
[0023] Figure 7 This is a schematic diagram of the structure of the electronic device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0024] 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.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] Embodiment 1 of the present application provides a method for detecting the amount of diamond wire sand. Figure 1 As shown, including:
[0031] Step S101: Acquire a diamond wire image.
[0032] 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.
[0033] 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.
[0034] Step S102: pre-processing the diamond wire image to obtain a pre-processed image.
[0035] 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:
[0036] Step S201: converting the diamond wire image into a grayscale image.
[0037] 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.
[0038] Step S202: clustering the pixels in the grayscale image using three preset cluster centers to obtain a ternary image.
[0039] 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.
[0040] 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.
[0041] 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. The background pixels, busbar pixels, and diamond pixels of the diamond line are separated in the ternary image, which can make the accuracy of the determined diamond pixels higher and improve the overall detection accuracy of the sand volume detection.
[0042] Step S103: Performing connected domain analysis on the ternary image to obtain a connected domain set corresponding to a plurality of diamond pixel points.
[0043] In this step, the connected domain analysis can be performed on the ternary image to obtain a connected domain set corresponding to multiple diamond pixels; wherein the connected domain set contains multiple connected domains. Finally, the following is obtained: Figure 3 The multiple connected domains shown include a connected domain A and a connected domain A1.
[0044] 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.
[0046] Step S104: selecting a large connected domain subset from the connected domain set according to a set pixel quantity.
[0047] In this step, the number of pixels contained in each connected domain in the large connected domain subset is greater than the set number of pixels, that is, the number of pixels of each connected domain in the connected domain set is compared with the set number of pixels, and the connected domains with a number of pixels greater than the set number of pixels are selected. The set formed by all the connected domains with a number of pixels greater than the set number of pixels is the large connected domain subset.
[0048] In different embodiments of the present application, the set pixel amount can be flexibly set according to different actual conditions such as different types of diamond wires and different types of diamonds. The value range of the set pixel amount is 35 to 45. Specifically, the set pixel amount can be set to 40, 42, 45, etc.
[0049] Step S105: using the single pixel quantity corresponding to a single diamond, split each connected domain in the large connected domain subset to obtain the number of split connected domains corresponding to the large connected domain subset.
[0050] In this step, for each connected domain in the large connected domain subset, the number of splits corresponding to the connected domain can be determined according to the number of pixels occupied by the connected domain and the number of single pixels. Specifically, the ratio of the number of pixels occupied by the connected domain and the number of single pixels can be obtained, and the number of splits corresponding to the connected domain can be determined according to the ratio corresponding to the connected domain. For example, the ratio can be directly used as the number of splits, or the ratio can be rounded off and further processed as the number of splits. For example, for a connected domain with 276 pixels, taking the number of single pixels as 40 as an example, the ratio of the two is 276:40=6.9, then according to the ratio 6.9 in different embodiments, the number of splits corresponding to the connected domain is 6 or 7. Then, according to the sum of the number of splits of all connected domains in the large connected domain subset, the number of split connected domains is determined. For example, a large connected domain subset includes 5 connected domains, and the number of splits corresponding to each connected domain obtained according to the above method is 7, 2, 3, 4, and 8 respectively, then the number of split connected domains corresponding to the large connected domain subset is 7+2+3+4+8=24. It can be understood that the aforementioned large connected domain subset including 5 connected domains is only an example in the embodiment of the present application. In actual application, the number of connected domains included in a large connected domain subset may be hundreds or even thousands.
[0051] In some embodiments of the present application, before executing step S104, different methods may be used to obtain the single pixel quantity, such as Figure 4 As shown, the method for obtaining the amount of a single pixel may include:
[0052] Step S301: obtaining the average number of pixels corresponding to all connected domains in the connected domain set as the first pixel quantity.
[0053] In this step, the number of pixels corresponding to each connected domain in the connected domain set may be obtained respectively, and then the average of the number of pixels corresponding to all connected domains may be calculated to obtain the average number of pixels as the first pixel quantity.
[0054] Step S302: Determine a single pixel quantity according to the first pixel quantity.
[0055] In this step, for example, the first pixel quantity can be used as the single pixel quantity, or the set multiple value of the first pixel quantity, the difference with a set constant, the sum of the first pixel quantity and a set constant can be used as the single pixel quantity, etc., which can be used according to actual needs.
[0056] It can be understood that the above is only an example of a method for obtaining the amount of a single pixel in some embodiments of the present application. In some other embodiments of the present application, the method can also be as follows: Figure 5 As shown, including:
[0057] Step S401: obtaining a specified connected domain subset in which the number of pixels in the connected domain set is within a set pixel range.
[0058] In this step, a connected domain whose number of pixels is within a set pixel range may be obtained as a designated connected domain, and a set formed by all designated connected domains is a designated connected domain subset.
[0059] The set pixel range can be, for example, 5 pixels to 40 pixels. A connected domain with a number less than or equal to 5 pixels is usually a connected domain formed by error data. Selecting a connected domain with a number of pixels greater than 5 pixels can reduce the impact of errors on the detection results of the number of diamonds and improve the accuracy of the sand detection results. A connected domain with a number greater than 40 pixels is usually a connected domain formed by multiple diamonds. Selecting a connected domain with a number of pixels less than 40 pixels can reduce the impact of the connected domain formed by multiple diamonds on the number of single pixels.
[0060] Step S402: obtaining an average number of pixels corresponding to all connected domains in the specified connected domain subset as a second pixel quantity.
[0061] In this step, the number of pixels corresponding to each connected domain in the specified connected domain subset may be obtained respectively, and then the average of the number of pixels corresponding to all connected domains in the specified connected domain subset may be calculated to obtain the average number of pixels as the second pixel quantity.
[0062] Step S403: Determine the single pixel quantity according to the second pixel quantity.
[0063] In this step, for example, the second pixel quantity can be used as the single pixel quantity, or the set multiple value of the second pixel quantity, the difference with the set constant, the sum of the second pixel quantity and the set constant can be used as the single pixel quantity, etc., which can be used according to actual needs.
[0064] In another embodiment, when determining the single pixel quantity, the mean number of diamond pixels of all connected domains corresponding to the diamond in the historical diamond wire image can be obtained for each of the N historical diamond wire images, where N is an integer greater than 1; after obtaining the mean number of diamond pixels for each historical diamond wire image, the mean number of N diamond pixels corresponding to the N historical diamond wire images can be obtained, and then the mean number of N diamond pixels can be averaged again, and the obtained mean can be used as the single pixel quantity, or the product of the obtained mean and the set weight can be used as the single pixel quantity, or the difference or sum of the obtained mean and the set constant can be used as the single pixel quantity, etc.
[0065] Step S106: Determine the amount of sand corresponding to the diamond wire image according to the number of remaining connected domains and the number of split connected domains.
[0066] In this step, the remaining connected domain is the connected domain formed by a single diamond, and the number of remaining connected domains is the number of single diamonds; the number of split connected domains is the number of diamonds corresponding to the connected domain formed by multiple diamonds. The sum of the number of remaining connected domains and the number of split connected domains can be used as the amount of sand corresponding to the diamond wire image.
[0067] Compared with the prior art, in the diamond wire sand amount detection method provided in the first embodiment of the present application, the diamonds attached to the busbar form a diamond pixel point gathering area in the diamond wire image, that is, a connected domain. Since the diamonds attached to the busbar may partially overlap, the partially overlapping diamonds also form a separate connected domain on the diamond image. However, since the number of diamonds forming each connected domain is different, the number of diamond pixel points corresponding to each connected domain is also different. According to the set pixel amount, a large connected domain subset is selected from the connected domain set to obtain a connected domain formed by multiple diamonds. The remaining connected domain is the connected domain formed by a single diamond. Using the set pixel amount The connected domains corresponding to multiple diamonds and the connected domains corresponding to a single diamond are separated. For the large connected domain subset formed by the connected domains corresponding to multiple diamonds, each connected domain in the large connected domain subset is split using the single pixel quantity corresponding to a single diamond to obtain the number of split connected domains corresponding to the large connected subset. The number of diamonds corresponding to all the connected domains in the large connected domain subset can be determined more accurately, thereby improving the accuracy of sand amount detection of the diamond wire. In addition, compared with the prior art in which the sand amount is detected and identified manually, the sand amount of the diamond wire is directly obtained by performing image processing and analysis on the diamond wire image in the embodiment of the present application, and the detection efficiency of the sand amount of the diamond wire is also improved.
[0068] Embodiment 2 of the present application relates to a diamond wire sand quantity detection device, such as Figure 6As shown, it includes: an image acquisition module 501, the image acquisition module 501 is used to acquire a diamond wire image; an image preprocessing module 502, the image preprocessing module 502 is used to preprocess the acquired diamond wire image to obtain a preprocessed ternary image, wherein the ternary image includes a plurality of background pixels, a plurality of diamond pixels and a plurality of busbar pixels; a connected domain analysis module 503, the connected domain analysis module 503 is used to perform a connected domain analysis on the ternary image to obtain a connected domain set corresponding to a plurality of diamond pixels, wherein the connected domain set includes a plurality of connected domains; a connected domain classification module 504, the connected domain classification module 504 is used to According to the set pixel quantity, a large connected domain subset is selected from the connected domain set, wherein the number of pixels contained in each connected domain in the large connected domain subset is greater than the set pixel quantity; a connected domain splitting module 505, the connected domain splitting module 505 is used to split each connected domain in the large connected domain subset using the single pixel quantity corresponding to a single diamond, and obtain the number of split connected domains corresponding to the large connected domain subset; a data statistics module 506, the data statistics module 506 is used to determine the amount of sand corresponding to the diamond wire image according to the number of remaining connected domains and the number of split connected domains, wherein the number of remaining connected domains is the total amount of all connected domains in the connected domain set except the large connected domain subset.
[0069] Compared with the prior art, in the diamond wire sand amount detection device provided in the second embodiment of the present application, the diamonds attached to the busbar form a diamond pixel point gathering area in the diamond wire image, that is, a connected domain. Since there may be partial overlap between the diamonds attached to the busbar, the partially overlapping diamonds also form a separate connected domain on the diamond image. However, since the number of diamonds forming each connected domain is different, the number of diamond pixel points corresponding to each connected domain is also different. The connected domain classification module 504 selects a large connected domain subset from the connected domain set according to the set pixel amount to obtain a connected domain formed by multiple diamonds, and the remaining connected domain is the connected domain formed by a single diamond. The connected domain classification module 504 uses the set pixel amount to select a large connected domain subset from the connected domain set to obtain a connected domain formed by multiple diamonds. The remaining connected domain is the connected domain formed by a single diamond. The connected domains corresponding to multiple diamonds and the connected domains corresponding to a single diamond are separated. For the large connected domain subset formed by the connected domains corresponding to multiple diamonds, the connected domain splitting module 505 uses the single pixel quantity corresponding to a single diamond to split each connected domain in the large connected domain subset to obtain the number of split connected domains corresponding to the large connected subset. The data statistics module 506 can more accurately determine the number of diamonds corresponding to all the connected domains in the large connected domain subset, thereby improving the accuracy of sand amount detection of the diamond wire. In addition, compared with the prior art in which the sand amount is detected and identified manually, the sand amount of the diamond wire is directly obtained by performing image processing and analysis on the diamond wire image in the embodiment of the present application, and the detection efficiency of the sand amount of the diamond wire is also improved.
[0070] Furthermore, in some embodiments of the present application, the connected domain splitting module 505 is specifically used to: for each connected domain in the large connected domain subset, determine the corresponding number of splits of the connected domain according to the number of pixels occupied by the connected domain and the number of single pixels; determine the number of split connected domains according to the sum of the number of splits of all connected domains in the large connected domain subset.
[0071] In some embodiments of the present application, the connected domain splitting module 505 is specifically used to: for each connected domain in the large connected domain subset, obtain the ratio of the number of pixels occupied by the connected domain to the number of single pixels, and determine the corresponding number of splits of the connected domain according to the ratio corresponding to the connected domain.
[0072] In some embodiments of the present application, the diamond wire sand amount detection device further includes:
[0073] The single pixel quantity determination module is used to: before using the single pixel quantity corresponding to a single diamond to split each connected domain in the large connected domain subset, obtain the average number of pixels corresponding to all connected domains in the connected domain set as the first pixel quantity; determine the single pixel quantity based on the first pixel quantity.
[0074] In some embodiments of the present application, the single pixel quantity determination module is specifically used to: before using the single pixel quantity corresponding to a single diamond to split each connected domain in the large connected domain subset, obtain a specified connected domain subset whose number of pixels is within a set pixel range in the connected domain set; obtain the average number of pixels corresponding to all connected domains in the specified connected domain subset as a second pixel quantity; and determine the single pixel quantity based on the second pixel quantity.
[0075] In some embodiments of the present application, the pixel range is set to 5 pixels to 40 pixels.
[0076] In some embodiments of the present application, the image preprocessing module 502 is specifically 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.
[0077] Embodiment 3 of the present application relates to an electronic device, such as Figure 7 As shown, it includes: at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601, so that the at least one processor 601 can execute the diamond wire sand amount detection method in the above-mentioned embodiments.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed in the present application should be covered within the protection scope of the present application.
Claims
1. A method for detecting the amount of diamond wire sand, characterized in that: include: Preprocessing the acquired diamond wire image to obtain a preprocessed ternary image, wherein the ternary image includes a plurality of background pixel points, a plurality of diamond pixel points, and a plurality of busbar pixel points; Performing a connected domain analysis on the ternary image to obtain a connected domain set corresponding to the plurality of diamond pixel points, wherein the connected domain set includes a plurality of connected domains; According to the set pixel quantity, a large connected domain subset is selected from the connected domain set, wherein the pixel quantity contained in each connected domain in the large connected domain subset is greater than the set pixel quantity; Using the number of single pixels corresponding to a single diamond, split each connected domain in the large connected domain subset to obtain the number of split connected domains corresponding to the large connected domain subset; The amount of sand corresponding to the diamond wire image is determined according to the number of remaining connected domains and the number of split connected domains, wherein the number of remaining connected domains is the total amount of all connected domains in the connected domain set except the large connected domain subset.
2. The diamond wire grit amount detection method according to claim 1, characterized in that: The method of using the number of single pixels corresponding to a single diamond to split each connected domain in the large connected domain subset to obtain the number of split connected domains corresponding to the large connected domain subset includes: For each connected domain in the large connected domain subset, determine the number of splits corresponding to the connected domain according to the number of pixels occupied by the connected domain and the number of single pixels; The number of split connected domains is determined according to the sum of the number of splits of all connected domains in the large connected domain subset.
3. The diamond wire grit amount detection method according to claim 2, characterized in that: The step of determining the number of splits corresponding to each connected domain in the large connected domain subset according to the number of pixels occupied by the connected domain and the number of single pixels includes: For each connected domain in the large connected domain subset, a ratio of the number of pixels occupied by the connected domain to the number of single pixels is obtained, and the number of splits corresponding to the connected domain is determined according to the ratio corresponding to the connected domain.
4. The diamond wire grit amount detection method according to claim 1, characterized in that: Before splitting each connected domain in the large connected domain subset using the single pixel quantity corresponding to a single diamond, the method further includes: Obtaining an average number of pixels corresponding to all connected domains in the connected domain set as a first pixel quantity; The single pixel quantity is determined according to the first pixel quantity.
5. The diamond wire grit amount detection method according to claim 1, characterized in that: Before splitting each connected domain in the large connected domain subset using the single pixel quantity corresponding to a single diamond, the method further includes: Acquire a specified connected domain subset in which the number of pixels in the connected domain set is within a set pixel range; Obtaining an average number of pixels corresponding to all connected domains in the specified connected domain subset as a second pixel quantity; The single pixel quantity is determined according to the second pixel quantity.
6. The diamond wire grit amount detection method according to claim 5, characterized in that: The set pixel range is 5 pixels to 40 pixels.
7. The method for detecting the amount of diamond wire sand according to any one of claims 1 to 6, characterized in that: The step of preprocessing the acquired diamond wire image to obtain a preprocessed ternary image includes: Converting the diamond wire image into a grayscale image; The pixel points in the grayscale image are clustered using three preset cluster centers to obtain the ternary image.
8. A diamond wire sand amount detection device, characterized in that: include: An image acquisition module, wherein the image acquisition module is used to acquire a diamond wire image; An image preprocessing module, wherein the image preprocessing module is used to preprocess the acquired diamond wire image to obtain a preprocessed ternary image, wherein the ternary image includes a plurality of background pixel points, a plurality of diamond pixel points, and a plurality of busbar pixel points; A connected domain analysis module, wherein the connected domain analysis module is used to perform a connected domain analysis on the ternary image to obtain a connected domain set corresponding to the plurality of diamond pixel points, wherein the connected domain set includes a plurality of connected domains; A connected domain classification module, wherein the connected domain classification module is used to select a large connected domain subset from the connected domain set according to a set pixel quantity, wherein the pixel quantity contained in each connected domain in the large connected domain subset is greater than the set pixel quantity; A connected domain splitting module, wherein the connected domain splitting module is used to split each connected domain in the large connected domain subset using the single pixel quantity corresponding to a single diamond, and obtain the number of split connected domains corresponding to the large connected domain subset; A data statistics module is used to determine the amount of sand corresponding to the diamond wire image according to the number of remaining connected domains and the number of split connected domains, wherein the number of remaining connected domains is the total amount of all connected domains in the connected domain set except the large connected domain subset.
9. 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 diamond wire sand amount detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the diamond wire grit amount detection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and storage medium
CN112967191A
Diamond wire surface carborundum particle quality detection method based on machine vision
CN113063705A
Defect detection method and device, electronic equipment and computer readable storage medium
CN113379680A
Method for counting number of pellets based on connected component detection
CN113870268A