Detection method for sand amount distribution condition of diamond wire, electronic equipment and storage medium
By preprocessing and connecting domain analysis of the diamond line image, calculating the horizontal and vertical variances, and automatically judging the distribution status of sand volume, the existing diamond line quality detection method relies on artificial quality inspection, and achieving efficient and objective automatic quality inspection.
Patent Information
- Application Number
- CN202311277532.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-04-04
AI Technical Summary
The existing diamond line quality inspection methods rely on manual quality inspection, which has a large workload, poor timeliness, and strong subjectivity, making it difficult to obtain objective quality inspection results.
By preprocessing the diamond line image, conducting connection domain analysis, calculating the horizontal and vertical variances, and automatically determining the sand distribution state, realizing automatic quality inspection of diamond line.
Automatic quality inspection of diamond wire is realized, the timeliness of quality inspection is improved, the subjectivity of artificial quality inspection is avoided, and objective quality inspection results are obtained.
Smart Images

Figure CN119762406A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of diamond wire quality detection, and in particular to a method for detecting the sand distribution of a diamond wire, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the field of diamond wire quality inspection, many manufacturers have not formed the same standard. Most companies use manual quality inspection and quality inspection machines for quality inspection, and the quality inspection content may include breaking force detection, diameter measurement, etc. Manual quality inspection requires the use of industrial cameras to take pictures of the diamond wires on the diamond wire production line, and then check the photos. However, 1 meter of diamond wire may require hundreds of photos for quality inspection, and a roll of diamond wire is as long as 200 kilometers. The quality inspection process requires a large number of photos, and the workload of manual quality inspection is extremely large. In this case, manual quality inspection cannot give quality inspection results in a short time, and the timeliness is poor. In addition, manual quality inspection relies on experience and is too subjective, and it is impossible to give objective quality inspection results. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method for detecting the sand distribution of diamond wire, an electronic device, and a storage medium, which are used to realize automated quality inspection of diamond wire, improve the timeliness of quality inspection, and avoid the problem that manual quality inspection is unable to obtain objective quality inspection results due to its strong subjectivity.
[0004] On the one hand, the present application provides a method for detecting the sand distribution of a diamond wire, comprising:
[0005] Preprocessing the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of busbar pixels and a plurality of diamond pixels;
[0006] Performing a connected domain analysis on the preprocessed image to obtain N connected domains corresponding to the plurality of diamond pixels, wherein N is an integer greater than 1;
[0007] Sorting the horizontal coordinates of the N center points of the N connected domains, obtaining a difference list consisting of the differences between every two adjacent horizontal coordinates after the sorting, and obtaining the variance of the difference list as the horizontal variance;
[0008] According to the N connected domains, a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image is obtained, and a variance of the diamond pixel array is obtained as a longitudinal variance;
[0009] The sand amount distribution state of the diamond wire image is determined according to the lateral variance and the longitudinal variance.
[0010] In one embodiment, determining the sand amount distribution state of the diamond wire image according to the lateral variance and the longitudinal variance includes:
[0011] Determine whether the horizontal variance is greater than a set horizontal variance, and obtain a horizontal determination result;
[0012] Determine whether the longitudinal variance is greater than a set longitudinal variance, and obtain a longitudinal determination result;
[0013] The sand amount distribution state of the diamond wire image is determined according to the transverse judgment result and the longitudinal judgment result.
[0014] In one embodiment, determining the sand amount distribution state of the diamond wire image according to the transverse judgment result and the longitudinal judgment result includes:
[0015] If the lateral judgment result indicates that the lateral variance is greater than the set lateral variance, and the longitudinal judgment result indicates that the longitudinal variance is greater than the set longitudinal variance, it is determined that the amount of sand in the diamond wire image is in an unevenly distributed state; otherwise, it is determined that the amount of sand in the diamond wire image is in a uniformly distributed state.
[0016] In one embodiment, the step of sorting the horizontal coordinates of the N center points of the N connected domains to obtain a difference list consisting of the difference between every two adjacent horizontal coordinates after the sorting includes:
[0017] Obtaining the center point of each connected domain in the N connected domains to obtain the N center points;
[0018] Sorting the N horizontal coordinates of the N center points in a preset order to obtain a horizontal coordinate sorting list;
[0019] The difference between all two adjacent horizontal coordinates in the horizontal coordinate sorting list is obtained, and the difference between all two adjacent horizontal coordinates is used as the difference list.
[0020] In one embodiment, obtaining a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image according to the N connected domains includes:
[0021] According to the locations of the N connected domains, the number of pixels occupied by diamonds in each column of the preprocessed image is added to obtain the number of diamond pixels in all columns, and the number of diamond pixels in all columns is combined into the diamond pixel array.
[0022] In one embodiment, the step of obtaining the setting lateral variance includes:
[0023] Obtaining sample lateral variances of a plurality of uniformly distributed sample diamond wire images;
[0024] The set horizontal variance is determined based on a plurality of sample horizontal variances.
[0025] In one embodiment, the step of obtaining the setting longitudinal variance includes:
[0026] Obtaining sample longitudinal variances of a plurality of uniformly distributed sample diamond wire images;
[0027] The set longitudinal variance is determined based on a plurality of sample longitudinal variances.
[0028] In one embodiment, the step of preprocessing the diamond wire image to be detected to obtain a preprocessed image includes:
[0029] Converting the diamond wire image into a target grayscale image;
[0030] The pixels in the grayscale image are clustered by using three preset initial clustering centers, and a ternary image is generated based on the clustering result, and the ternary image is used as the preprocessed image.
[0031] On the other hand, the present application provides a device for detecting the sand distribution of a diamond wire, comprising:
[0032] A preprocessing module, used for preprocessing the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of busbar pixels and a plurality of diamond pixels;
[0033] An analysis module, configured to perform a connected domain analysis on the preprocessed image to obtain N connected domains corresponding to the plurality of diamond pixels, wherein N is an integer greater than 1;
[0034] A first acquisition module is used to sort the horizontal coordinates of the N center points of the N connected domains, obtain a difference list consisting of the difference between every two adjacent horizontal coordinates after sorting, and obtain the variance of the difference list as the horizontal variance;
[0035] A second acquisition module is used to acquire a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image according to the N connected domains, and acquire the variance of the diamond pixel array as the longitudinal variance;
[0036] A determination module is used to determine the sand amount distribution state of the diamond wire image according to the lateral variance and the longitudinal variance.
[0037] On the other hand, the present application provides an electronic device, the electronic device comprising:
[0038] processor;
[0039] a memory for storing processor-executable instructions;
[0040] Wherein, the processor is configured to execute the above-mentioned method for detecting the sand distribution of the diamond wire.
[0041] In addition, the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to complete the above-mentioned method for detecting the sand distribution of the diamond wire.
[0042] The present application scheme converts the diamond wire image into the corresponding pre-processed image, and then detects N connected domains representing the area where the diamond is located. After sorting the horizontal coordinates of the N center points of the N connected domains, the difference between adjacent horizontal coordinates is calculated, and the horizontal variance of multiple differences is calculated, so that the uniformity of the diamond in the horizontal coordinate direction can be indicated based on the horizontal variance; the data of the corresponding pixels of each column of diamonds in the pre-processed image are counted, and the longitudinal variance of the number of diamond pixels obtained by statistics is calculated, and the uniformity of the diamond in the vertical coordinate direction can be indicated based on the longitudinal variance; with the help of the horizontal variance indicating the uniformity in the horizontal coordinate direction and the longitudinal variance indicating the uniformity in the vertical coordinate direction, the overall sand distribution of the diamond on the diamond wire image can be effectively determined to obtain the detection result. This process is completed automatically by electronic equipment without human intervention, avoiding the problem of low timeliness caused by untimely response, and avoiding the problem of lack of objectivity of quality inspection results due to reliance on subjective experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.
[0044] Figure 1 A schematic flow chart of a method for detecting the sand distribution of a diamond wire provided in one embodiment of the present application;
[0045] Figure 2 An embodiment of the present application provides Figure 1 Detailed flow chart of step 130;
[0046] Figure 3 A schematic diagram of a diamond wire image provided by an embodiment of the present application;
[0047] Figure 4 A block diagram of a device for detecting the sand distribution of a diamond wire provided in one embodiment of the present application;
[0048] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0050] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0051] See also Figure 1 , is a flow chart of a method for detecting the sand distribution of a diamond wire according to an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps 110 to 150.
[0052] Step 110: preprocessing the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of busbar pixels, and a plurality of diamond pixels.
[0053] During the production process of the diamond wire to be tested, the industrial camera on the production line takes multiple diamond wire images for the diamond wire to be tested, which are used to detect the sand distribution. Here, the diamond wire to be tested refers to the diamond wire that needs to be tested for sand distribution. Each diamond wire image can represent the sand distribution of a section of the diamond wire to be tested. Electronic devices corresponding to the industrial camera (such as: host, server, etc.) can obtain diamond wire images from the industrial camera, and then detect the sand distribution of the diamond wire to be tested based on the diamond wire image.
[0054] The electronic device may select each diamond wire image of the diamond wire to be tested for detecting the sand amount distribution, or the electronic device may randomly select several diamond wire images for detecting the sand amount distribution, or the electronic device may select one of every several diamond wire images for detecting the sand amount distribution.
[0055] The electronic device can preprocess the diamond wire image to obtain a preprocessed image. During the preprocessing process, the diamond corresponding pixels (diamond pixels), the busbar corresponding pixels (busbar pixels), and the background corresponding pixels (background pixels) on the diamond wire image can be distinguished, thereby obtaining a preprocessed image including multiple background pixels, multiple busbar pixels, and multiple diamond pixels.
[0056] Step 120: Perform connected domain analysis on the preprocessed image to obtain N connected domains corresponding to a plurality of diamond pixels, where N is an integer greater than 1.
[0057] After obtaining the preprocessed image corresponding to the diamond wire image, the preprocessed image can be subjected to connected domain detection to obtain multiple connected domains. In the preprocessed image, the background cannot constitute a connected domain, so each connected domain can be considered as a diamond, and the multiple connected domains obtained by the connected domain analysis can be used as N connected domains corresponding to the diamond pixels.
[0058] Step 130: sorting the horizontal coordinates of the N center points of the N connected domains, obtaining a difference list consisting of the difference values between every two adjacent horizontal coordinates after sorting, and obtaining the variance of the difference list as the horizontal variance.
[0059] In one embodiment, see Figure 2 , provided in one embodiment of the present application Figure 1 The detailed flow chart of step 130 is as follows: Figure 2 As shown, the method may include the following steps 131 to 133.
[0060] Step 131: Obtain the center point of each connected domain in the N connected domains to obtain N center points.
[0061] For each connected domain, the center point of the connected domain can be determined, and the coordinates of the center point can be obtained. The coordinates are the pixel coordinates of the image coordinate system established on the preprocessed image, including the horizontal coordinate and the vertical coordinate. After detecting N center points, it can be considered that the center points of N diamonds in the preprocessed image are obtained.
[0062] Step 132: sort the N horizontal coordinates of the N center points according to a preset order to obtain a horizontal coordinate sorting list.
[0063] Here, the preset order may be an order from large to small, or the preset order may be an order from small to large.
[0064] After sorting the N horizontal coordinates in a descending order or a descending order, the sorted N horizontal coordinates can be used as a horizontal coordinate sorting list.
[0065] Step 133: Obtain the difference between all two adjacent horizontal coordinates in the horizontal coordinate sorting list, and use the difference between all two adjacent horizontal coordinates as the difference list.
[0066] The electronic device may sequentially calculate the difference between two adjacent horizontal coordinates in the horizontal coordinate sorting list, thereby obtaining a plurality of differences, and construct a difference list with the plurality of differences.
[0067] After obtaining the difference list, the electronic device can calculate the variance of multiple differences in the difference list as the lateral variance. The lateral variance can characterize the uniformity of the diamond in the horizontal axis direction; the larger the lateral variance, the more uneven the diamond distribution in the horizontal axis direction, and vice versa, the smaller the lateral variance, the more uniform the diamond distribution in the horizontal axis direction.
[0068] Step 140: According to the N connected domains, a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image is obtained, and the variance of the diamond pixel array is obtained as the longitudinal variance.
[0069] Based on the N connected domains, the electronic device can determine the diamond pixels in each column of the preprocessed image that belong to the N connected domains. The electronic device can add the number of pixels occupied by diamonds in each column of the preprocessed image according to the locations of the N connected domains to obtain the number of diamond pixels in all columns, and form the number of diamond pixels in all columns into a diamond pixel array.
[0070] The electronic device can calculate the variance of the number of multiple diamond pixels in the diamond pixel array as the longitudinal variance. The longitudinal variance can characterize the degree of fluctuation of the diamond corresponding pixel in the longitudinal direction, in other words, characterize the uniformity of the diamond in the longitudinal direction. The larger the longitudinal variance, the more uneven the diamond distribution in the longitudinal direction. Conversely, the smaller the longitudinal variance, the more uniform the diamond distribution in the longitudinal direction.
[0071] Step 150: Determine the sand amount distribution state of the diamond wire image according to the lateral variance and the longitudinal variance.
[0072] After obtaining the transverse variance and the longitudinal variance, the sand amount distribution corresponding to the diamond wire image can be evaluated based on the transverse variance and the longitudinal variance, thereby obtaining a detection result of the sand amount distribution. The detection result can be uniform distribution or uneven distribution.
[0073] Through the above measures, after the diamond wire image is converted into the corresponding preprocessed image, N connected domains representing the area where the diamond is located can be detected from it. After sorting the horizontal coordinates of the N center points of the N connected domains, the difference between adjacent horizontal coordinates is calculated, and the horizontal variance of multiple differences is calculated, so that the uniformity of the diamond in the horizontal coordinate direction can be indicated based on the horizontal variance; the data of the corresponding pixels of each column of diamonds in the preprocessed image are counted, and the longitudinal variance of the number of diamond pixels obtained by statistics is calculated, and the uniformity of the diamond in the vertical coordinate direction can be indicated based on the longitudinal variance; with the help of the horizontal variance indicating the uniformity in the horizontal coordinate direction and the longitudinal variance indicating the uniformity in the vertical coordinate direction, the overall sand distribution of the diamond on the diamond wire image can be effectively determined to obtain the detection result. This process is completed automatically by electronic equipment without human intervention, avoiding the problem of low timeliness caused by untimely response, and avoiding the problem of lack of objectivity of quality inspection results due to reliance on subjective experience.
[0074] In one embodiment, when determining the detection result of the sand amount distribution according to the lateral variance and the longitudinal variance, the electronic device can determine whether the lateral variance is greater than the set lateral variance to obtain a lateral determination result. Here, the lateral variance is set to be used as a dividing line between uneven distribution and uniform distribution in the horizontal coordinate direction. The lateral variance can be configured based on experience. For example, the first set variance can be 0.22, 0.26, 0.34, etc.
[0075] The electronic device can determine whether the longitudinal variance is greater than the set longitudinal variance to obtain a longitudinal determination result. Here, the longitudinal variance is set as a dividing line between uneven distribution and uniform distribution in the longitudinal coordinate direction. The longitudinal variance can be configured based on experience. For example, the longitudinal variance can be set to 0.28, 0.36, etc.
[0076] After obtaining the transverse judgment result and the longitudinal judgment result, the electronic device may determine the sand amount distribution state of the diamond wire image according to the transverse judgment result and the longitudinal judgment result.
[0077] Through this measure, by setting the lateral variance and the longitudinal variance as reference, it is possible to detect whether the diamonds are evenly distributed in the horizontal and vertical directions of the diamond wire image, and then accurately obtain the sand distribution state based on the lateral and vertical judgment results.
[0078] In one embodiment, when the sand amount distribution state is determined by the lateral judgment result and the longitudinal judgment result, if the lateral judgment result indicates that the lateral variance is greater than the set lateral variance, and the longitudinal judgment result indicates that the longitudinal variance is greater than the set longitudinal variance, it means that the distribution of diamonds in both the horizontal and vertical directions is not uniform enough. At this time, it can be determined that the sand amount of the diamond wire image is in an unevenly distributed state.
[0079] If the lateral judgment result indicates that the lateral variance is not greater than the set lateral variance, and if the longitudinal judgment result indicates that the longitudinal variance is not greater than the set longitudinal variance, it can be explained that the distribution of diamonds in the horizontal and vertical directions is relatively uniform. At this time, it can be determined that the amount of sand in the diamond wire image is in a uniformly distributed state.
[0080] If the lateral judgment result indicates that the lateral variance is not greater than the set lateral variance, and if the longitudinal judgment result indicates that the longitudinal variance is greater than the set longitudinal variance, it can be explained that although the diamond distribution in the ordinate direction is not uniform enough, the diamond distribution in the abscissa direction is relatively uniform. At this time, it can be determined that the sand amount in the diamond wire image is in a uniformly distributed state.
[0081] If the lateral judgment result indicates that the lateral variance is greater than the set lateral variance, and if the longitudinal judgment result indicates that the longitudinal variance is not greater than the set longitudinal variance, it can be explained that although the diamond distribution in the horizontal axis direction is not uniform, the diamond distribution in the vertical axis direction is relatively uniform. At this time, it can be determined that the sand amount in the diamond wire image is in a uniformly distributed state.
[0082] Through the above measures, when the diamonds are evenly distributed in at least one of the horizontal and vertical directions of the diamond wire image, the detection result of the sand amount distribution can be determined to be evenly distributed. When the diamonds are unevenly distributed in both the horizontal and vertical directions, the detection result of the sand amount distribution can be determined to be unevenly distributed.
[0083] In one embodiment, the electronic device may generate a set lateral variance and a set longitudinal variance based on a plurality of uniformly distributed sample diamond wire images. Here, the sample diamond wire image is a sample image collected by a diamond wire with uniform diamond distribution.
[0084] The electronic device can obtain sample lateral variances of multiple uniformly distributed sample diamond wire images. Here, the sample lateral variance is the lateral variance calculated for the sample diamond wire image. The calculation process is described above and will not be repeated here. Based on multiple sample lateral variances, a set lateral variance can be converted.
[0085] In one embodiment, when determining the set horizontal variance based on multiple sample horizontal variances, the electronic device may calculate the average of the multiple sample horizontal variances as the set horizontal variance. Alternatively, the electronic device may select the maximum value from the multiple sample horizontal variances as the set horizontal variance.
[0086] The electronic device can obtain sample longitudinal variances of multiple uniformly distributed sample diamond wire images. Here, the sample longitudinal variance is the longitudinal variance calculated for the sample diamond wire image. The calculation process is referred to the above related description and will not be repeated here. Based on multiple sample longitudinal variances, the set longitudinal variance can be converted.
[0087] In one embodiment, when determining the set longitudinal variance based on multiple sample longitudinal variances, the electronic device may calculate the average of the multiple sample longitudinal variances as the set longitudinal variance. Alternatively, the electronic device may select the maximum value from the multiple sample longitudinal variances as the set longitudinal variance.
[0088] Through the above measures, since the diamonds in the sample diamond wire image are evenly distributed, the sample lateral variance of multiple sample diamond wire images is converted into a set lateral variance, and the sample longitudinal variance is converted into a set longitudinal variance, which can serve as a suitable reference for determining the sand distribution in the horizontal and vertical directions.
[0089] In one embodiment, during the process of preprocessing the diamond wire image to obtain the preprocessed image, the electronic device may convert the diamond wire image into a corresponding target grayscale image.
[0090] The diamond wire image is a three-channel image with the color channel order of BGR (Blue Green Red). The detection of the sand distribution state only requires a single-channel image. In order to reduce the amount of calculation and facilitate subsequent processing, the diamond wire image is converted into a single-channel grayscale image as the target grayscale image. For example, the three-channel RGB pixel value of each pixel in the colored diamond wire image can be converted 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, where Gray is the grayscale value of the pixel after conversion, R is the color intensity value of the color pixel in the red channel, G is the color intensity value of the color pixel in the green channel, and B is the color intensity value of the color pixel in the blue channel.
[0091] See also Figure 3 , is a schematic diagram of a diamond wire image provided by an embodiment of the present application, such as Figure 3 As shown in the figure, the black part of the diamond wire image is the background; the gray part is the edge of the busbar, and the busbar is between the two busbar edges; the brightest part is the diamond on the busbar. The busbar and diamond together constitute the diamond wire.
[0092] The electronic device can cluster pixels in the target grayscale image through three preset initial clustering centers, and generate a ternary image based on the clustering result as a preprocessed image.
[0093] According to the first initial cluster center corresponding to the background, the second initial cluster center corresponding to the busbar, and the third initial cluster center corresponding to the diamond, the pixel values of multiple pixels in the target grayscale image are clustered using the K-means clustering algorithm. During the clustering process, the cluster center will change. After the clustering is completed, three clusters can be obtained. Each cluster includes multiple pixels. After obtaining the three clusters, the electronic device can classify the pixels in each cluster, obtain the category information of the pixels in each cluster, and can mark the corresponding category information for each pixel.
[0094] In the target grayscale image, the brightness of the pixel corresponding to diamond is the largest and the pixel value is the largest. Therefore, the result cluster center of the cluster where the pixel value corresponding to diamond is located is the largest. Here, the result cluster center is the actual cluster center of each cluster after clustering is completed. The electronic device can select the maximum value from the result cluster centers of the three clusters, and determine the category information of each pixel in the cluster corresponding to the selected maximum value as a diamond pixel.
[0095] In the target grayscale image, the number of background pixels is the largest, and the electronic device can select a cluster with the largest number of pixels from the three clusters, and determine the category information of each pixel in the cluster as a background pixel. After determining the diamond pixels and the background pixels, the pixels in the remaining cluster can be determined as busbar pixels.
[0096] Furthermore, the result clustering center of each cluster can be used as the pixel value of the pixel in the cluster, so as to convert the target grayscale image into a ternary image, and then the ternary image can be used as a preprocessed image.
[0097] In the present application, three different gray levels correspond to multiple background pixels, multiple diamond pixels, and multiple busbar pixels. Separating the background pixels, busbar pixels, and diamond pixels of the diamond wire in the ternary image can make the determined diamond pixels more accurate and improve the detection accuracy of the sand distribution detection.
[0098] Through the above measures, after the diamond wire image is converted into a target grayscale image, the pixels in the target grayscale image can be first divided by clustering, and then the pixels can be classified according to the brightness characteristics and quantity characteristics to obtain diamond pixels, background pixels and busbar pixels, and then corresponding pixel values are set for the diamond pixels, background pixels and busbar pixels respectively, so as to generate a preprocessed image corresponding to the diamond wire image.
[0099] In one embodiment, corresponding detection results are generated for multiple diamond wire images of the diamond wire to be tested. After obtaining the multiple detection results, the electronic device can generate an overall evaluation result of the sand distribution of the diamond wire to be tested based on the multiple detection results.
[0100] Exemplarily, the electronic device can count the number of unevenly distributed test results among multiple test results, and then divide the number by the total number of test results to obtain the proportion of uneven distribution. The electronic device can multiply the proportion by one hundred to obtain an evaluation score, and use the evaluation score as the overall evaluation result. Among them, the higher the evaluation score, the more uneven the distribution of diamond sand on the overall diamond wire to be tested; conversely, the lower the evaluation score, the more uniform the distribution of diamond sand on the overall diamond wire to be tested.
[0101] Through the above measures, based on the detection results characterizing the sand amount distribution of each section of the diamond wire to be tested, an overall evaluation result characterizing the overall sand amount distribution of the diamond wire to be tested is obtained by fusion.
[0102] Figure 4 is a block diagram of a device for detecting the sand distribution of a diamond wire according to an embodiment of the present invention. Figure 4 As shown, the device may include:
[0103] A preprocessing module 410 is used to preprocess the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of busbar pixels and a plurality of diamond pixels;
[0104] An analysis module 420 is used to perform a connected domain analysis on the preprocessed image to obtain N connected domains corresponding to the plurality of diamond pixels, where N is an integer greater than 1;
[0105] A first acquisition module 430 is used to sort the horizontal coordinates of the N center points of the N connected domains, obtain a difference list consisting of the difference between every two adjacent horizontal coordinates after sorting, and obtain the variance of the difference list as the horizontal variance;
[0106] A second acquisition module 440 is used to acquire a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image according to the N connected domains, and acquire the variance of the diamond pixel array as the longitudinal variance;
[0107] The determination module 450 is used to determine the sand amount distribution state of the diamond wire image according to the lateral variance and the longitudinal variance.
[0108] In one embodiment, the determination module 450 is further configured to:
[0109] Determine whether the horizontal variance is greater than a set horizontal variance, and obtain a horizontal determination result;
[0110] Determine whether the longitudinal variance is greater than a set longitudinal variance, and obtain a longitudinal determination result;
[0111] The sand amount distribution state of the diamond wire image is determined according to the transverse judgment result and the longitudinal judgment result.
[0112] In one embodiment, the determination module 450 is further configured to:
[0113] If the lateral judgment result indicates that the lateral variance is greater than the set lateral variance, and the longitudinal judgment result indicates that the longitudinal variance is greater than the set longitudinal variance, it is determined that the amount of sand in the diamond wire image is in an unevenly distributed state; otherwise, it is determined that the amount of sand in the diamond wire image is in a uniformly distributed state.
[0114] In one embodiment, the first acquisition module 430 is further configured to:
[0115] Obtaining the center point of each connected domain in the N connected domains to obtain the N center points;
[0116] Sorting the N horizontal coordinates of the N center points in a preset order to obtain a horizontal coordinate sorting list;
[0117] The difference between all two adjacent horizontal coordinates in the horizontal coordinate sorting list is obtained, and the difference between all two adjacent horizontal coordinates is used as the difference list.
[0118] In one embodiment, the second acquisition module 440 is further configured to:
[0119] According to the locations of the N connected domains, the number of pixels occupied by diamonds in each column of the preprocessed image is added to obtain the number of diamond pixels in all columns, and the number of diamond pixels in all columns is combined into the diamond pixel array.
[0120] In one embodiment, the determination module 450 is further configured to:
[0121] Obtaining sample lateral variances of a plurality of uniformly distributed sample diamond wire images;
[0122] The set horizontal variance is determined based on a plurality of sample horizontal variances.
[0123] In one embodiment, the determination module 450 is further configured to:
[0124] Obtaining sample longitudinal variances of a plurality of uniformly distributed sample diamond wire images;
[0125] The set longitudinal variance is determined based on a plurality of sample longitudinal variances.
[0126] In one embodiment, the preprocessing module 410 is further configured to:
[0127] Converting the diamond wire image into a target grayscale image;
[0128] The pixels in the grayscale image are clustered by using three preset initial clustering centers, and a ternary image is generated based on the clustering result, and the ternary image is used as the preprocessed image.
[0129] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method for detecting the sand distribution of the diamond wire, and will not be repeated here.
[0130] like Figure 5 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 5 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the above embodiment. In one embodiment, the electronic device 1 can be a host, a server, a server cluster, etc., for executing the method for detecting the sand distribution of the diamond wire.
[0131] The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0132] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the method for detecting the sand distribution of the diamond wire provided in the present application.
[0133] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0135] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments 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.
Claims
1. A method for detecting the sand distribution 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 pixels, a plurality of busbar pixels and a plurality of diamond pixels; Performing a connected domain analysis on the preprocessed image to obtain N connected domains corresponding to the plurality of diamond pixels, wherein N is an integer greater than 1; Sorting the horizontal coordinates of the N center points of the N connected domains, obtaining a difference list consisting of the differences between every two adjacent horizontal coordinates after the sorting, and obtaining the variance of the difference list as the horizontal variance; According to the N connected domains, a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image is obtained, and a variance of the diamond pixel array is obtained as a longitudinal variance; The sand amount distribution state of the diamond wire image is determined according to the lateral variance and the longitudinal variance.
2. The method according to claim 1, characterized in that: Determining the sand amount distribution state of the diamond wire image according to the lateral variance and the longitudinal variance includes: Determine whether the horizontal variance is greater than a set horizontal variance, and obtain a horizontal determination result; Determine whether the longitudinal variance is greater than a set longitudinal variance, and obtain a longitudinal determination result; The sand amount distribution state of the diamond wire image is determined according to the transverse judgment result and the longitudinal judgment result.
3. The method according to claim 2, characterized in that Determining the sand amount distribution state of the diamond wire image according to the horizontal judgment result and the vertical judgment result includes: If the lateral judgment result indicates that the lateral variance is greater than the set lateral variance, and the longitudinal judgment result indicates that the longitudinal variance is greater than the set longitudinal variance, it is determined that the amount of sand in the diamond wire image is in an unevenly distributed state; otherwise, it is determined that the amount of sand in the diamond wire image is in a uniformly distributed state.
4. The method according to claim 1, characterized in that: The step of sorting the horizontal coordinates of the N center points of the N connected domains and obtaining a difference list consisting of the difference between every two adjacent horizontal coordinates after sorting includes: Obtaining the center point of each connected domain in the N connected domains to obtain the N center points; Sorting the N horizontal coordinates of the N center points in a preset order to obtain a horizontal coordinate sorting list; The difference between all two adjacent horizontal coordinates in the horizontal coordinate sorting list is obtained, and the difference between all two adjacent horizontal coordinates is used as the difference list.
5. The method according to claim 1, characterized in that The step of obtaining a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image according to the N connected domains includes: According to the locations of the N connected domains, the number of pixels occupied by diamonds in each column of the preprocessed image is added to obtain the number of diamond pixels in all columns, and the number of diamond pixels in all columns is combined into the diamond pixel array.
6. The method according to claim 2, characterized in that The step of obtaining the setting horizontal variance includes: Obtaining sample lateral variances of a plurality of uniformly distributed sample diamond wire images; The set horizontal variance is determined based on a plurality of sample horizontal variances.
7. The method according to claim 2, characterized in that The step of obtaining the longitudinal variance includes: Obtaining sample longitudinal variances of a plurality of uniformly distributed sample diamond wire images; The set longitudinal variance is determined based on a plurality of sample longitudinal variances.
8. The method 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 target grayscale image; The pixels in the grayscale image are clustered by using three preset initial clustering centers, and a ternary image is generated based on the clustering result, and the ternary image is used as the preprocessed image.
9. A device for detecting the sand distribution of a diamond wire, characterized in that: include: A preprocessing module, used for preprocessing the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels, a plurality of busbar pixels and a plurality of diamond pixels; An analysis module, configured to perform a connected domain analysis on the preprocessed image to obtain N connected domains corresponding to the plurality of diamond pixels, wherein N is an integer greater than 1; A first acquisition module is used to sort the horizontal coordinates of the N center points of the N connected domains, obtain a difference list consisting of the difference between every two adjacent horizontal coordinates after sorting, and obtain the variance of the difference list as the horizontal variance; A second acquisition module is used to acquire a diamond pixel array consisting of the number of diamond pixels in each column of the preprocessed image according to the N connected domains, and acquire the variance of the diamond pixel array as the longitudinal variance; A determination module is used to determine the sand amount distribution state of the diamond wire image according to the lateral variance and the longitudinal variance.
10. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to execute the method for detecting the sand distribution of the diamond wire as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the method for detecting the sand distribution of the diamond wire according to any one of claims 1 to 8.
Citation Information
Patent Citations
Silicon carbide line particle counting method, storage equipment and terminal equipment
CN107767361A
Diamond fretsaw surface abrasive particle distribution uniformity evaluation method
CN112801973A
Abrasive layer mixed material quality monitoring method for diamond grinding wheel production
CN115239736A
Steel plate cutting quality detection method for high-end manufacturing
CN116645367A