Method, device, electronic device and storage medium for detecting positive and negative surfaces of diamond wire

By preprocessing and midline recognition of the diamond line image, calculating the Yin-Yang surface parameters, the problem of the existing technology being unable to detect the Yin-Yang surface of the diamond line is solved, and accurate detection of the Yin-Yang surface of the diamond line is achieved.

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

Patent Information

Application Number
CN202311281015.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

Technical Problem

The prior art cannot effectively detect the yin and yang surface of the diamond line, resulting in its performance being affected.

Method used

By preprocessing the diamond line image to be detected, the center line of the diamond line is identified, and the upper and lower diamond parameters are obtained based on the center line, and the Yin and Yang surface parameters are calculated to determine whether the image is a Yin and Yang surface image.

Benefits of technology

Accurate detection of the yin and yang surface of the diamond line is achieved, and the accuracy and reliability of the detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762522A_ABST
    Figure CN119762522A_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for detecting the positive and negative sides of a diamond wire, the method comprising: preprocessing a diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels and a plurality of diamond pixels; identifying the center line of the diamond wire in the diamond wire image; obtaining upper diamond parameters and lower diamond parameters according to the center line; wherein the upper diamond parameters are diamond parameters of the diamond wire located above the center line, and the lower diamond parameters are diamond parameters of the diamond wire located below the center line; obtaining positive and negative side parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters; determining whether the diamond wire image is a positive and negative side image according to the positive and negative side parameters. The present application can realize positive and negative side detection of a diamond wire.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of product detection, and in particular, to a method, device, electronic device and storage medium for detecting positive and negative surfaces of a diamond wire. Background Art

[0002] Diamond wire has the advantages of high processing efficiency and cutting seams, and is widely used in the slicing processing of hard and brittle materials such as single crystal silicon, sapphire, single crystal silicon carbide, and ceramics.

[0003] When the diamond wire is sand-plated, the amount of sand on the upper and lower parts of the diamond wire may be uneven due to the machine or the amount of sand, resulting in a positive and negative surface, which will affect the performance of the diamond wire. Currently, there is no solution for detecting the positive and negative surfaces of the diamond wire. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for detecting the positive and negative sides of a diamond wire, so as to realize the detection of the positive and negative sides of a diamond wire.

[0005] An embodiment of the present application provides a method for detecting the positive and negative sides of a diamond wire, comprising: preprocessing a diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels and a plurality of diamond pixels; identifying a center line of the diamond wire in the diamond wire image; obtaining an upper diamond parameter and a lower diamond parameter according to the center line; wherein the upper diamond parameter is a diamond parameter of the diamond wire located above the center line, and the lower diamond parameter is a diamond parameter of the diamond wire located below the center line; obtaining positive and negative side parameters of the diamond wire image according to the upper diamond parameter and the lower diamond parameter; and determining whether the diamond wire image is a positive and negative side image according to the positive and negative side parameters.

[0006] In the above implementation process, by obtaining the diamond wire image to be detected and determining the center line of the diamond wire in the image, the center line is used as a dividing line to obtain the upper diamond parameters above the center line and the lower diamond parameters below the center line, and then based on the upper diamond parameters and the lower diamond parameters, the positive and negative side parameters that reflect the difference in sand volume on both sides of the center line of the diamond wire can be calculated, and then based on the positive and negative side parameters, it can be determined whether the diamond wire image is a positive and negative side image, thereby realizing the positive and negative side detection of the diamond wire.

[0007] Further, obtaining upper diamond parameters and lower diamond parameters according to the center line includes: obtaining the number of upper diamonds corresponding to diamond pixel points in the upper image; wherein the number of upper diamonds is used as the upper diamond parameter, and the upper image is an image located above the center line in the diamond wire image; obtaining the number of lower diamonds corresponding to diamond pixel points in the lower image; wherein the number of lower diamonds is used as the lower diamond parameter, and the lower image is an image located below the center line in the diamond wire image.

[0008] It can be understood that the difference between the number of diamonds in the upper image and the number of diamonds in the lower image can more intuitively reflect the positive and negative side conditions in the diamond wire image. In the above implementation, by using the number of upper diamonds corresponding to the diamond pixel points in the upper image as the upper diamond parameter and the number of lower diamonds corresponding to the diamond pixel points in the lower image as the lower diamond parameter, a more objective positive and negative side parameter can be obtained, which can make the detection more accurate.

[0009] Further, the obtaining of positive and negative surface parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters includes: obtaining a diamond quantity ratio of the upper diamond quantity to the lower diamond quantity; and obtaining the positive and negative surface parameters according to the diamond quantity ratio.

[0010] The diamond number ratio can effectively reflect the difference in sand volume on both sides of the center line of the diamond wire. The greater the deviation between the diamond number ratio and 1, the greater the difference in sand volume on both sides of the center line. In the above implementation, by using the diamond number ratio as the positive and negative side parameter, the detection can be made more accurate.

[0011] Further, the obtaining of the number of upper diamonds corresponding to the diamond pixel points in the upper image includes: obtaining an upper connected domain set corresponding to the diamond pixel points in the upper image; wherein the upper connected domain set includes multiple connected domains; selecting a first large connected domain subset from the upper connected domain set according to a set pixel quantity; wherein the number of pixels contained in each connected domain in the first 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 first large connected domain subset to obtain a first split connected domain quantity corresponding to the first large connected subset; determining the number of upper diamonds according to the remaining connected domain quantity and the first split connected domain quantity; wherein the remaining connected domain quantity is the total number of all connected domains in the upper connected domain set except the first large connected domain subset.

[0012] In the above implementation, the number of pixels in the connected domain can reflect the area of ​​each connected domain. Considering that there may be bonding between diamonds in the image, for the case where multiple diamonds are bonded together, these multiple diamonds correspond to one connected domain. In addition, the number of single pixels corresponding to a single diamond is smaller than that of multiple diamonds bonded together. Therefore, according to the set pixel number, it can be judged whether each connected domain in the upper connected domain set is a connected domain corresponding to multiple diamonds bonded together (i.e., a connected domain in the first largest connected domain subset), and the connected domain in the first largest connected domain subset is split using the number of single pixels corresponding to a single diamond. The first split connected domain after splitting can be considered as a connected domain with only a single diamond, so that the accuracy of the upper diamond number determined according to the number of remaining connected domains in the upper connected domain set except the first largest connected domain subset and the number of first split connected domains is higher, making the detection result of the positive and negative surfaces more reliable.

[0013] Further, the obtaining of the number of lower diamonds corresponding to the diamond pixel points in the lower portion of the image includes: obtaining a lower connected domain set corresponding to the diamond pixel points in the lower portion of the image; wherein the lower connected domain set includes multiple connected domains; selecting a second largest connected domain subset from the lower connected domain set according to a set pixel quantity; wherein the number of pixels contained in each connected domain in the second largest connected domain subset is greater than the set pixel quantity; using the number of single pixels corresponding to a single diamond, splitting each connected domain in the second largest connected domain subset to obtain the number of second split connected domains corresponding to the second largest connected subset; determining the number of lower diamonds according to the number of remaining connected domains and the number of the second split connected domains; wherein the number of remaining connected domains is the total number of all connected domains in the lower connected domain set except the second largest connected domain subset.

[0014] In the above implementation, it is possible to determine whether each connected domain in the lower connected domain set is a connected domain corresponding to multiple diamonds glued together (i.e., a connected domain in the second largest connected domain subset) according to the set pixel quantity, and to split the connected domain in the second largest connected domain subset using the single pixel quantity corresponding to a single diamond. The second split connected domain after the split can be considered as a connected domain with only a single diamond, so that the number of lower diamonds determined based on the number of remaining connected domains in the lower connected domain set except the second largest connected domain subset and the number of second split connected domains is more accurate, making the detection result of the positive and negative surfaces more reliable.

[0015] Furthermore, the step of obtaining the single pixel quantity includes: obtaining an average number of pixels corresponding to all connected domains in the upper connected domain set and the lower connected domain set as a first pixel quantity; and determining the single pixel quantity based on the first pixel quantity.

[0016] In the above implementation, considering that in actual applications, most of the diamonds on the diamond wire are clearly separated, that is, most of the connected domains in the diamond wire image correspond to the areas where a single diamond is located. Therefore, the single pixel quantity is determined by the average number of pixels of all connected domains in the diamond wire image. When the single pixel quantity is used to split the connected domain, a more reliable splitting result can be obtained.

[0017] Furthermore, the step of obtaining the single pixel quantity includes: obtaining a specified connected domain subset whose pixel numbers in the upper connected domain set and the lower connected domain set are within a set pixel range; obtaining an average pixel number 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.

[0018] In the above implementation, the single pixel quantity is determined by using the average number of pixels corresponding to all connected domains in the specified connected domain subset whose pixel numbers are within the set pixel range, thereby eliminating the interference of connected domains corresponding to diamonds that are obviously too small or connected domains corresponding to multiple diamonds on the estimation of the number of pixels of the connected domain of a single diamond, thereby further improving the reliability of the splitting result after the connected domain is split using the single pixel quantity.

[0019] Further, the obtaining of upper diamond parameters and lower diamond parameters according to the center line includes: obtaining an upper diamond pixel area corresponding to a diamond pixel point in an upper portion of the image; wherein the upper diamond pixel area is used as the upper diamond parameter, and the upper portion of the image is an image located above the center line in the diamond wire image; obtaining a lower diamond pixel area corresponding to a diamond pixel point in a lower portion of the image; wherein the lower diamond pixel area is used as the lower diamond parameter, and the lower portion of the image is an image located below the center line in the diamond wire image.

[0020] It can be understood that the difference between the diamond areas in the upper image and the lower image can also more intuitively reflect the positive and negative side conditions in the diamond wire image. In the above implementation, by using the upper diamond pixel area corresponding to the diamond pixel point in the upper image as the upper diamond parameter, and using the lower diamond pixel area corresponding to the diamond pixel point in the lower image as the lower diamond parameter, a more objective positive and negative side parameter can be obtained, which can make the detection more accurate.

[0021] Further, acquiring the positive and negative surface parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters includes: acquiring a diamond area ratio of the upper diamond pixel area to the lower diamond pixel area; and acquiring the positive and negative surface parameters according to the diamond area ratio.

[0022] The diamond area ratio can effectively reflect the difference in the amount of sand on both sides of the center line of the diamond wire. The greater the deviation between the diamond number ratio and 1, the greater the difference in the amount of sand on both sides of the center line. In the above implementation, by using the lower diamond area ratio as the positive and negative side parameter, the detection can be made more accurate.

[0023] Furthermore, the diamond wire image to be detected is preprocessed to obtain a preprocessed image, including: converting the diamond wire image into a grayscale image; clustering the pixels in the grayscale image through three preset clustering centers to obtain a ternary image; wherein the ternary image includes a plurality of background pixels, a plurality of diamond pixels and a plurality of busbar pixels; converting the ternary image into a binary image; wherein the binary image is used as the preprocessed image.

[0024] It can be understood that the diamond wire image mainly includes three parts: diamond, busbar, and background. In the production line, the background is usually relatively simple (usually a production line), so there will be large differences in color between the diamond, busbar, and background. Therefore, in the grayscale image, the diamond, busbar, and background each have a different grayscale value range. Based on this, by clustering the grayscale image with three preset cluster centers, the background pixels, diamond pixels, and busbar pixels in the diamond wire image can be easily and accurately identified, and then binarization processing can be performed to obtain a binary image that distinguishes diamond pixels from other pixels except diamond pixels. Since diamond pixels and other pixels except diamond pixels are distinguished in the binary image, the center line can be easily determined based on the binary image, reducing the difficulty of determining the center line.

[0025] Further, the identifying of the center line of the diamond wire in the diamond wire image includes: for the upper part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the first two adjacent rows is greater than a set threshold, taking the next row of the first two adjacent rows as the upper boundary of the diamond wire; for the lower part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the second two adjacent rows is greater than the set threshold, taking the upper row of the second two adjacent rows as the lower boundary of the diamond wire; and determining the center line according to the upper boundary and the lower boundary.

[0026] In the above implementation, since diamond pixels and other pixels except diamond pixels are distinguished in the binary image, there is a large difference in pixel values ​​between diamond pixels and other pixels except diamond pixels (usually the pixel values ​​of the two will differ by 255). Therefore, when the difference between the sum of pixels of two adjacent rows is greater than the set threshold, it can be considered that one of the two adjacent rows has diamond pixels, while the other row does not have diamond pixels. Since the diamond line is located in the middle of the diamond line image, for the upper image, the next row of the two adjacent rows can be used as the upper boundary of the diamond line, and for the lower image, the previous row of the two adjacent rows can be used as the lower boundary of the diamond line, so as to quickly determine the two sides of the diamond line, and then accurately determine the center line of the diamond line in the diamond line image.

[0027] Furthermore, after determining whether the diamond wire image is a positive-negative side image, the method also includes: if the diamond wire roll to be tested corresponds to N diamond wire images, then obtaining N detection results of whether the N diamond wire images are positive-negative side images, wherein N is an integer greater than 1; based on the N detection results, determining the proportion of positive-negative side images in the N diamond wire images; based on the proportion of the number, determining whether the diamond wire roll to be tested meets the qualification conditions.

[0028] It is understandable that in actual production activities, it is often necessary to test a whole diamond wire roll, and a diamond wire roll often has multiple diamond wire images, and the presence of positive and negative surfaces in a small number of positions in the whole diamond wire roll is usually acceptable. In the above implementation, by obtaining the test results of N diamond wire images corresponding to the diamond wire roll to be tested, and then based on these N test results, the proportion of positive and negative surface images to all diamond wire images can be determined, so that based on the proportion of the number, it is possible to more objectively evaluate whether the diamond wire roll to be tested is qualified.

[0029] The embodiment of the present application also provides a positive and negative side detection device for a diamond wire, comprising: a preprocessing module, used to preprocess a diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixels and a plurality of diamond pixels; an identification module, used to identify the center line of the diamond wire in the diamond wire image; a parameter calculation module, used to obtain an upper diamond parameter and a lower diamond parameter according to the center line, and to obtain positive and negative side parameters of the diamond wire image according to the upper diamond parameter and the lower diamond parameter; wherein the upper diamond parameter is a diamond parameter of the diamond wire located above the center line, and the lower diamond parameter is a diamond parameter of the diamond wire located below the center line; a determination module, used to determine whether the diamond wire image is a positive and negative side image according to the positive and negative side parameters.

[0030] An embodiment of the present application further provides an electronic device, comprising: a processor and a memory; the processor is used to execute one or more programs stored in the memory to implement any of the above-mentioned methods for detecting the positive and negative surfaces of a diamond wire.

[0031] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores one or more programs. The one or more programs can be executed by one or more processors to implement any of the above-mentioned methods for detecting the positive and negative surfaces of diamond wires. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application 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.

[0033] Figure 1 A schematic flow chart of a method for detecting positive and negative surfaces of a diamond wire provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of an image preprocessing process provided in an embodiment of the present application;

[0035] Figure 3 A binarized diamond wire image provided in an embodiment of the present application;

[0036] Figure 4 A method provided in the embodiment of the present application Figure 3 A schematic diagram of the two boundaries of the diamond wire is identified on the basis;

[0037] Figure 5 A schematic diagram of the structure of a positive and negative surface detection device for a diamond wire provided in an embodiment of the present application;

[0038] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] 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.

[0040] In order to solve the problem that there is no solution for detecting the positive and negative sides of diamond wires, and the quality detection requirements of diamond wires cannot be met, a method for detecting the positive and negative sides of diamond wires is provided in the embodiments of the present application. Figure 1 As shown, Figure 1A schematic flow chart of a method for detecting positive and negative surfaces of a diamond wire provided in an embodiment of the present application includes:

[0041] S101: Preprocessing the diamond wire image to be detected to obtain a preprocessed image.

[0042] In the embodiment of the present application, during the production process of the diamond wire or after the production of the diamond wire is completed, an image of the diamond wire to be inspected can be captured by a camera or other photographic equipment to obtain an image of the diamond wire to be inspected, but this is not a limitation.

[0043] In the embodiment of the present application, the pre-processed image includes a plurality of background pixels and a plurality of diamond pixels. Of course, the pre-processed image may also include a plurality of busbar pixels, which is not specifically limited in the present application.

[0044] It can be understood that the diamond wire image mainly includes three parts: diamond, mother wire (i.e., wire for attaching diamond), and background. In most cases, the three parts of diamond, mother wire, and background will have large differences in color. Therefore, in a feasible implementation of the embodiment of the present application, Figure 2 As shown, step S101 may include:

[0045] S201: Convert the diamond wire image into a grayscale image.

[0046] Exemplarily, the values ​​of the three channels BGR (blue, green and red) of the diamond wire image can be read, and then the BGR values ​​are converted into a single value by, but not limited to, histogram equalization, averaging, etc., to obtain a 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 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.

[0047] S202: Clustering the pixels in the grayscale image using three preset cluster centers to obtain a ternary image.

[0048] The ternary image includes a plurality of background pixels, a plurality of diamond pixels and a plurality of busbar pixels. In one embodiment, the ternary image may be used as a pre-processed image.

[0049] In the embodiment of the present application, clustering may be performed using, but not limited to, a kmeans (k-means) clustering algorithm.

[0050] It can be understood that by clustering the pixels in the grayscale image through three cluster centers, multiple cluster regions can be obtained, each cluster region is composed of the same type of pixels, and there are three types of pixels: background pixels, diamond pixels and busbar pixels, corresponding to the three cluster centers respectively.

[0051] The three initial cluster centers include a first initial cluster center corresponding to the background, a second initial cluster center corresponding to the busbar, and a third initial cluster center corresponding to the diamond. Based on the three initial cluster centers, the pixel values ​​of multiple pixels in the grayscale image are clustered using the K-means clustering algorithm. During the clustering process, if the clustering algorithm has converged, 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; conversely, if the clustering algorithm has not converged, the cluster center can be recalculated based on the grayscale values ​​of the pixels belonging to the same cluster center until the clustering algorithm converges, and three clusters can be obtained, each of which includes multiple pixels.

[0052] In this 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 accuracy of the determined diamond pixel points higher and improve the overall detection accuracy of the sand volume detection.

[0053] After clustering is completed, a corresponding ternary image is generated for the grayscale image based on the clustering result. The electronic device can unify the pixel values ​​of each cluster of pixels. In other words, the pixels in the same cluster have the same pixel value, and the pixels of the three clusters have three pixel values ​​in the image, thereby converting the grayscale image into a ternary image. Here, the pixel value set for the pixels of each cluster can be the actual cluster center of the cluster after clustering is completed.

[0054] In the embodiment of the present application, after obtaining the grayscale image and before clustering, a morphological processing method (such as an erosion and dilation algorithm) can be used to eliminate at least part of the noise points in the grayscale image to make the boundaries between diamonds clearer.

[0055] S203: Convert the ternary image into a binary image.

[0056] Among them, the binary image is used as the preprocessed image.

[0057] In some embodiments, after obtaining the ternary image, the pixels in the ternary image can be classified to obtain the category information of the pixels corresponding to the three pixel values. In the grayscale image, the diamond pixel has the highest brightness and the highest pixel value, so the category information of the pixel to which the maximum pixel value among the three pixel values ​​belongs can be determined as the diamond pixel. At this time, the pixels corresponding to the remaining two pixel values ​​can be determined to be background pixels and busbar pixels, and these two types of pixels are classified as non-diamond pixels.

[0058] In some embodiments, the pixel values ​​of non-diamond pixels can be set to zero, or the pixel values ​​of non-diamond pixels can be set to the pixel values ​​of background pixels or busbar pixels; similarly, the pixel values ​​of diamond pixels can be set to specified positive integers or remain unchanged, thereby converting the ternary image into a binary image, and the binary image is used as a preprocessed image.

[0059] Through the above measures, after the diamond wire image is converted into a grayscale image, the pixels of the grayscale image are clustered based on the initial cluster center, so that the grayscale image is converted into a ternary image according to the clustering result, and the ternary image distinguishes diamond pixels, background pixels and busbar pixels. Further, according to the brightness characteristics of the diamond pixels in the image, the diamond pixels and non-diamond pixels in the ternary image can be accurately distinguished, so that different pixel values ​​can be set for the diamond pixels and the non-diamond pixels, so that the ternary image is converted into a binary image, completing the preprocessing process of the diamond wire image.

[0060] S102: Identify the center line of the diamond wire in the diamond wire image.

[0061] In an embodiment of the present application, in order to determine the center line of the diamond wire in the diamond wire image, for the upper part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the first two adjacent rows is greater than a set threshold, the next row of the first two adjacent rows is used as the upper boundary of the diamond wire; for the lower part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the second two adjacent rows is greater than the set threshold, the upper row of the second two adjacent rows is used as the lower boundary of the diamond wire; finally, the center line is determined based on the upper boundary and the lower boundary.

[0062] In the embodiment of the present application, the image located above the midline in the diamond line image is called an upper portion image, and the image located below the midline in the diamond line image is called a lower portion image.

[0063] In the embodiment of the present application, the difference between the sum of the pixels of the first two adjacent rows is equal to A n -A n+1 The absolute value of n is the sum of the pixel values ​​of all pixels in the previous row of the first two adjacent rows, A n+1is the sum of the pixel values ​​of all pixels in the next row of the first two adjacent rows. The difference between the sum of the pixels in the second two adjacent rows is equal to A m -A m-1 The absolute value of m is the sum of the pixel values ​​of all pixels in the next row of the second adjacent two rows, A m-1 is the sum of the pixel values ​​of all pixels in the previous row of the second two adjacent rows.

[0064] Exemplarily, after obtaining the binary image, the sum of the pixel values ​​of each row and the difference between the sum of the pixel values ​​of the row and the sum of the pixel values ​​of the next row can be determined row by row starting from the upper edge of the binary image; if the difference in the sum of the pixel values ​​is greater than a set threshold, the next row is determined to be the upper boundary of the diamond line.

[0065] In addition, starting from the lower edge of the binary image, the sum of the pixel values ​​of each row and the difference between the sum of the pixel values ​​of the row and the sum of the pixel values ​​of the row above the row in the image are determined row by row upward; if the difference in the sum of the pixel values ​​is greater than the set threshold, the previous row is determined to be the lower boundary of the diamond line.

[0066] by Figure 3 Taking the binarized diamond wire image shown in the figure as an example, we can get the following Figure 4 The upper and lower boundaries of the diamond line shown ( Figure 4 The two white lines in the figure).

[0067] After obtaining the upper and lower boundaries of the diamond wire, the center line between the upper boundary and the lower boundary can be determined, and the center line is the midline of the diamond wire in the diamond wire image. The center line between the upper boundary and the lower boundary refers to a straight line with equal distances to the upper boundary and the lower boundary.

[0068] In the embodiment of the present application, the aforementioned ternary image may also be used as a pre-processed image.

[0069] At this time, a feasible implementation method is: starting from the upper edge of the ternary image, it can be determined row by row whether there is a diamond pixel in each row, and the pixel row where the diamond pixel first appears is used as the upper boundary of the diamond line. Similarly, starting from the lower edge of the ternary image, it can be determined row by row whether there is a diamond pixel in each row, and the pixel row where the diamond pixel first appears is used as the lower boundary of the diamond line. Finally, the midline is determined based on the upper boundary and the lower boundary.

[0070] Another feasible implementation method is: from top to bottom, determine in turn whether the sum of the pixel values ​​of each row in the ternary image is greater than the preset diamond line boundary setting value, and use the row of pixels whose total pixel values ​​are greater than the diamond line boundary setting value for the first time as the upper boundary; and from bottom to top, determine in turn whether the sum of the pixels of each row in the ternary image is greater than the diamond line boundary setting value, and use the row of pixels whose total pixel values ​​are greater than the diamond line boundary setting value for the first time as the lower boundary.

[0071] S103: Obtain upper diamond parameters and lower diamond parameters according to the center line.

[0072] Among them, the upper diamond parameters are the diamond parameters when the diamond wire is located above the midline, and the lower diamond parameters are the diamond parameters when the diamond wire is located below the midline.

[0073] S104: Acquire positive and negative side parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters.

[0074] S105: Determine whether the diamond wire image is a positive-negative surface image according to the positive-negative surface parameters.

[0075] In the embodiment of the present application, the positive and negative surface parameters refer to parameters that can reflect the difference in sand volume on both sides of the center line of the diamond wire.

[0076] Exemplarily, in the embodiment of the present application, the positive and negative surface parameters may include at least one of a diamond number ratio, a diamond number difference, a diamond area ratio, and a diamond area difference.

[0077] It can be understood that the diamond number ratio can effectively reflect the difference in sand volume on both sides of the center line of the diamond wire. The greater the deviation between the diamond number ratio and 1, the greater the difference in sand volume on both sides of the center line.

[0078] It can be understood that the difference in the number of diamonds can intuitively reflect the difference in the amount of sand on both sides of the center line of the diamond wire. The larger the absolute value of the difference in the number of diamonds, the greater the difference in the amount of sand on both sides of the center line.

[0079] It can be understood that the area occupied by a single diamond (i.e., the number of pixels) will not differ too much. Therefore, based on the ratio of the total number of pixels of the connected domains on both sides of the center line (i.e., the diamond area ratio), the difference in the amount of sand on both sides of the center line of the diamond wire can be more intuitively obtained. The greater the deviation between the diamond area ratio and 1, the greater the difference in the amount of sand on both sides of the center line. In the embodiment of the present application, the connected domain refers to the area formed by the aggregation of diamond pixels in the diamond wire image or pre-processed image. For example Figure 3 and Figure 4 The white areas in the figure are connected domains.

[0080] It can be understood that, as mentioned above, the area occupied by a single diamond (i.e., the number of pixels) will not differ too much, so the diamond area difference can intuitively reflect the difference in sand volume on both sides of the center line of the diamond wire. The larger the absolute value of the diamond area difference, the greater the difference in sand volume on both sides of the center line.

[0081] Therefore, the positive and negative surface parameters include at least one of the diamond number ratio, diamond number difference, diamond area ratio, and diamond area difference, which can more intuitively determine the difference in sand volume on both sides of the center line of the diamond wire in the diamond wire image, thereby more objectively determining whether there is a positive and negative surface in the diamond wire image.

[0082] In some embodiments of the present application, the upper diamond parameter may include an upper diamond number, and the lower diamond parameter may include a lower diamond number, so that based on the upper diamond number and the lower diamond number, a diamond number ratio and / or a diamond number difference may be obtained.

[0083] In the embodiment of the present application, the number of upper diamonds corresponding to the diamond pixel points in the upper image can be obtained, and the number of lower diamonds corresponding to the diamond pixel points in the lower image can be obtained, thereby obtaining upper diamond parameters and lower diamond parameters.

[0084] In order to obtain the upper diamond quantity and the lower diamond quantity, in a feasible embodiment:

[0085] An upper connected domain set corresponding to the diamond pixel point in the upper image can be obtained; wherein the upper connected domain set includes a plurality of connected domains.

[0086] Then, according to the set pixel quantity, a first large connected domain subset is selected from the upper connected domain set, wherein the pixel quantity of each connected domain in the first large connected domain subset is greater than the set pixel quantity.

[0087] Then, each connected domain in the first largest connected domain subset is split using the single pixel quantity corresponding to a single diamond to obtain the number of first split connected domains corresponding to the first largest connected subset.

[0088] Finally, the upper number of diamonds is determined according to the number of remaining connected domains and the number of first split connected domains (for example, the sum of the number of remaining connected domains and the number of first split connected domains can be determined as the upper number of diamonds). The number of remaining connected domains is the total number of all connected domains in the upper connected domain set except the first largest connected domain subset.

[0089] Similarly, the lower connected domain set corresponding to the diamond pixel point in the lower partial image may be obtained first; wherein the lower connected domain set includes a plurality of connected domains.

[0090] Then, according to the set pixel quantity, a second largest connected domain subset is selected from the lower connected domain set, wherein the pixel quantity of each connected domain in the second largest connected domain subset is greater than the set pixel quantity.

[0091] Then, each connected domain in the second largest connected domain subset is split using the single pixel quantity corresponding to a single diamond to obtain the number of second split connected domains corresponding to the second largest connected subset.

[0092] Finally, the number of lower diamonds is determined according to the number of remaining connected domains and the number of second split connected domains (for example, the sum of the number of remaining connected domains and the number of second split connected domains can be determined as the number of lower diamonds). The number of remaining connected domains is the total number of all connected domains in the lower connected domain set except the second largest connected domain subset.

[0093] In order to obtain the upper diamond quantity and the lower diamond quantity, in another feasible embodiment:

[0094] A total connected domain set of the diamond wire image can be obtained; wherein the total connected domain set includes all connected domains in the diamond wire image.

[0095] Then, according to the set pixel quantity, a third largest connected domain subset is selected from the total connected domain set, wherein the pixel quantity of each connected domain in the third largest connected domain subset is greater than the set pixel quantity;

[0096] Then, each connected domain in the third largest connected domain subset is split using the single pixel quantity corresponding to a single diamond, and the number of third split connected domains corresponding to the third largest connected subset is obtained.

[0097] Finally, the upper diamond number is determined according to the number of the third split connected domains above the midline and the number of the first remaining connected domains, and the lower diamond number is determined according to the number of the third split connected domains below the midline and the number of the second remaining connected domains (for example, the sum of the number of the third split connected domains above the midline and the number of the first remaining connected domains can be determined as the upper diamond number, and the sum of the number of the third split connected domains below the midline and the number of the second remaining connected domains can be determined as the lower diamond number). The first remaining connected domain number is the total number of connected domains above the midline in all connected domains except the third largest connected domain subset in the total connected domain set; the second remaining connected domain number is the total number of connected domains below the midline in all connected domains except the third largest connected domain subset in the total connected domain set.

[0098] For the connected domain that crosses the center line at the same time, optionally, it can be divided into two small connected domains belonging to different sides of the center line based on the center line, and then the number of upper diamonds and the number of lower diamonds are determined in the above manner; or, the connected domain that crosses the center line at the same time can be not used to determine the number of upper diamonds and the number of lower diamonds; or, it can be determined whether the area above the center line or the area below the center line accounts for a larger proportion in the connected domain that crosses the center line at the same time, and the connected domain is recorded as the side with a larger area proportion.

[0099] It can be understood that in the above two feasible embodiments, since the area occupied by a single diamond (i.e., the number of pixels) will not differ too much, the aforementioned set pixel amount can be set according to the number of pixels usually occupied by a single diamond. If the number of pixels of a connected domain is less than or equal to the set pixel amount, it can be considered that the connected domain corresponds to a single diamond. If the number of pixels of a connected domain is greater than the set pixel amount, it can be considered that the connected domain corresponds to multiple diamonds, and the connected domain needs to be split. Exemplarily, the set pixel amount can be set to 40 pixels, but it is not limited to this.

[0100] When each connected domain in the large connected domain subset is split using the single pixel quantity corresponding to a single diamond, the number of splits corresponding to the connected domain can be determined based on the number of pixels occupied by the connected domain and the single pixel quantity, and then the number of split connected domains can be determined based on the sum of the number of splits of all connected domains in the large connected domain subset.

[0101] For example, assuming that there are two connected domains in the large connected domain subset, the number of pixels is 200 and 400 respectively, and the number of single pixels is 20, then it can be determined that the number of splits of the two connected domains is 10 and 20 respectively, and then the number of split connected domains is determined to be 30.

[0102] In the above two feasible embodiments, the single pixel quantity can be obtained by the following method:

[0103] Method 1: Obtain the average number of pixels corresponding to all connected domains in the diamond wire image as the first pixel quantity; determine the single pixel quantity according to the first pixel quantity.

[0104] Exemplarily, the first pixel quantity may be used as the single pixel quantity, or a preset constant may be added to or subtracted from the first pixel quantity to form the single pixel quantity.

[0105] Method 2: Obtain a specified connected domain subset whose pixel numbers are within a set pixel range in all connected domains of the diamond wire image; obtain the average pixel number corresponding to all connected domains in the specified connected domain subset as the second pixel quantity; and determine the single pixel quantity based on the second pixel quantity.

[0106] The pixel range can be set as needed. For example, the pixel range can be greater than or equal to 5 pixels; or, the pixel range can be less than or equal to 40 pixels; or, the pixel range can be greater than or equal to 5 pixels and less than or equal to 40 pixels, but this is not a limitation.

[0107] Exemplarily, the second pixel quantity may be used as a single pixel quantity.

[0108] In the embodiment of the present application, the erosion and expansion algorithm may also be used to split the connected domain containing more than a set number of pixels to obtain multiple disconnected connected domains.

[0109] In the above embodiment, different scales may be used to perform erosion operations and dilation operations on connected domains containing pixels greater than a set number of pixels, thereby obtaining multiple disconnected connected domains.

[0110] After obtaining multiple disconnected connected domains, it is further possible to determine whether there are still connected domains in the multiple disconnected connected domains whose pixel quantity is greater than the set pixel quantity. If so, continue to split these connected domains.

[0111] In the embodiment of the present application, when the positive and negative surface parameters include the ratio of the number of diamonds, after the upper number of diamonds and the lower number of diamonds are determined, the upper number of diamonds can be divided by the lower number of diamonds, or the lower number of diamonds can be divided by the upper number of diamonds to obtain the ratio of the number of diamonds.

[0112] In the embodiment of the present application, a normal range of the diamond number ratio may be set, and when the diamond number ratio does not fall within the normal range, it may be determined that the diamond wire image is a positive and negative surface image.

[0113] In the embodiment of the present application, when the positive and negative surface parameters include the difference in the number of diamonds, after the upper number of diamonds and the lower number of diamonds are determined, the upper number of diamonds can be subtracted from the lower number of diamonds, or the lower number of diamonds can be subtracted from the upper number of diamonds to obtain the difference in the number of diamonds.

[0114] In the embodiment of the present application, a normal range of the diamond quantity difference may be set, and when the diamond quantity difference does not fall within the normal range, it may be determined that the diamond wire image is a positive and negative surface image.

[0115] In other embodiments of the present application, the upper diamond parameter may include the upper diamond pixel area, and the lower diamond parameter may include the lower diamond pixel area, so that the diamond area ratio and / or diamond area difference may be obtained based on the upper diamond pixel area and the lower diamond pixel area.

[0116] In the embodiment of the present application, the upper diamond pixel area corresponding to the diamond pixel point in the upper image can be obtained, and the lower diamond pixel area corresponding to the diamond pixel point in the lower image can be obtained, so as to obtain the upper diamond parameter and the lower diamond parameter.

[0117] In order to obtain the upper diamond pixel area and the lower diamond pixel area, in this embodiment, the number of pixels in the connected domain in the upper image can be added to obtain the upper diamond pixel area, and the number of pixels in the connected domain in the lower image can be added to obtain the lower diamond pixel area.

[0118] In the embodiment of the present application, when the positive and negative surface parameters include the diamond area ratio, after the upper diamond pixel area and the lower diamond pixel area are determined, the upper diamond area can be divided by the lower diamond area, or the lower diamond area can be divided by the upper diamond area to obtain the diamond area ratio.

[0119] In the embodiment of the present application, a normal range of the diamond area ratio may be set, and when the diamond area ratio does not fall within the normal range, it may be determined that the diamond wire image is a positive and negative surface image.

[0120] In the embodiment of the present application, when the positive and negative surface parameters include the diamond area difference, after the upper diamond area and the lower diamond area are determined, the upper diamond area can be subtracted from the lower diamond area, or the lower diamond area can be subtracted from the upper diamond area to obtain the diamond area difference.

[0121] In the embodiment of the present application, a normal range of diamond area difference may be set, and when the diamond area difference does not fall within the normal range, it may be determined that the diamond wire image is a positive and negative surface image.

[0122] In the embodiment of the present application, if multiple positive and negative surface parameters are used, in an optional implementation manner, the configuration required for the preset parameters may be:

[0123] If any of the positive and negative surface parameters is within the normal range corresponding to the positive and negative surface parameter, it is determined that the diamond line image is not a positive and negative surface image; if each of the positive and negative surface parameters is not within the normal range corresponding to the positive and negative surface parameter, it is determined that the diamond line image is a positive and negative surface image.

[0124] If multiple positive and negative side parameters are used, in another optional implementation, the configuration required for the preset parameters may be:

[0125] If each positive and negative surface parameter is within the normal range corresponding to the positive and negative surface parameter, it is determined that the diamond line image is not a positive and negative surface image; if any positive and negative surface parameter is not within the normal range corresponding to the positive and negative surface parameter, it is determined that the diamond line image is a positive and negative surface image.

[0126] It is understandable that in actual production activities, it is often necessary to test a whole diamond wire roll, and a diamond wire roll often has multiple diamond wire images captured, and the presence of positive and negative surfaces in a small number of positions in the whole diamond wire roll is usually acceptable. Therefore, in order to better evaluate the quality of a diamond wire roll, in a feasible implementation of an embodiment of the present application, the test results of N diamond wire images corresponding to the tested diamond wire roll can be obtained (that is, N test results are obtained, N is an integer greater than 1). Then, based on the N test results, the proportion of positive and negative surface images in the N diamond wire images is determined; based on the proportion of the number, it is determined whether the tested diamond wire roll meets the qualification conditions.

[0127] For example, if the number ratio is greater than a preset ratio threshold, it can be determined that the diamond wire is unqualified. Otherwise, it can be considered that the diamond wire as a whole does not have the problem of positive and negative sides.

[0128] The positive and negative side detection method of the diamond wire provided in the embodiment of the present application obtains the image of the diamond wire to be detected, and determines the center line of the diamond wire in the image, and uses the center line as a dividing line to obtain the upper diamond parameters located above the center line and the lower diamond parameters located below the center line. Then, based on the upper diamond parameters and the lower diamond parameters, the positive and negative side parameters that reflect the difference in sand amount on both sides of the center line of the diamond wire can be calculated, so that based on the positive and negative side parameters, it can be determined whether the diamond wire image is a positive and negative side image, thereby realizing the positive and negative side detection of the diamond wire.

[0129] Based on the same inventive concept, the present application also provides a positive and negative surface detection device 500 for a diamond wire. Figure 5 As shown, Figure 5 Shows the use of Figure 1 The method of the diamond wire positive and negative surface detection device is shown. It should be understood that the specific functions of the device 500 can be referred to the description above. To avoid repetition, the detailed description is appropriately omitted here. The device 500 includes at least one software function module that can be stored in the memory in the form of software or firmware or solidified in the operating system of the device 500. Specifically:

[0130] See also Figure 5 As shown, the device 500 includes: a pre-processing module 501, an identification module 502, a parameter calculation module 503 and a determination module 504. Among them:

[0131] A preprocessing module 501 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 and a plurality of diamond pixels;

[0132] An identification module 502, used for identifying a center line of the diamond wire in the diamond wire image;

[0133] A parameter calculation module 503 is used to obtain upper diamond parameters and lower diamond parameters according to the center line, and obtain positive and negative surface parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters; wherein the upper diamond parameters are diamond parameters of the diamond wire located above the center line, and the lower diamond parameters are diamond parameters of the diamond wire located below the center line;

[0134] The determination module 504 is used to determine whether the diamond wire image is a positive-negative surface image according to the positive-negative surface parameters.

[0135] In a feasible implementation manner of the embodiment of the present application, the parameter calculation module 503 is specifically used to: obtain the number of upper diamonds corresponding to the diamond pixel points in the upper image; wherein the number of upper diamonds is used as the upper diamond parameter, and the upper image is the image located above the center line in the diamond wire image; obtain the number of lower diamonds corresponding to the diamond pixel points in the lower image; wherein the number of lower diamonds is used as the lower diamond parameter, and the lower image is the image located below the center line in the diamond wire image.

[0136] In this feasible implementation manner, the parameter calculation module 503 is specifically used to: obtain the diamond quantity ratio of the upper diamond quantity to the lower diamond quantity; and obtain the positive and negative surface parameters according to the diamond quantity ratio.

[0137] In this feasible implementation manner, the parameter calculation module 503 is specifically used to: obtain the upper connected domain set corresponding to the diamond pixel point in the upper part of the image; wherein the upper connected domain set includes multiple connected domains; according to the set pixel quantity, select the first large connected domain subset from the upper connected domain set; wherein the number of pixels contained in each connected domain in the first large connected domain subset is greater than the set pixel quantity; using the single pixel quantity corresponding to a single diamond, split each connected domain in the first large connected domain subset to obtain the first split connected domain quantity corresponding to the first large connected subset; determine the upper diamond quantity according to the remaining connected domain quantity and the first split connected domain quantity; wherein the remaining connected domain data is the total quantity of all connected domains in the upper connected domain set except the first large connected domain subset.

[0138] In this feasible implementation manner, the parameter calculation module 503 is specifically used to: obtain the lower connected domain set corresponding to the diamond pixel point in the lower part image; wherein the lower connected domain set includes multiple connected domains; according to the set pixel quantity, select the second largest connected domain subset from the lower connected domain set; wherein the number of pixels contained in each connected domain in the second largest connected domain subset is greater than the set pixel quantity; using the single pixel quantity corresponding to a single diamond, split each connected domain in the second largest connected domain subset to obtain the number of second split connected domains corresponding to the second largest connected subset; determine the number of lower diamonds according to the number of remaining connected domains and the number of second split connected domains; wherein the remaining connected domain data is the total number of all connected domains in the lower connected domain set except the second largest connected domain subset.

[0139] In the above feasible implementation manner, the parameter calculation module 503 is further specifically used to: obtain the average number of pixels corresponding to all connected domains in the upper connected domain set and the lower connected domain set as the first pixel quantity; and determine the single pixel quantity according to the first pixel quantity. .

[0140] In the above feasible implementation manner, the parameter calculation module 503 is specifically used to: obtain a specified connected domain subset in which the number of pixels in the upper connected domain set and the lower connected domain set is within a set pixel range; 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.

[0141] In a feasible implementation manner of the embodiment of the present application, the parameter calculation module 503 is specifically used to: obtain the upper diamond pixel area corresponding to the diamond pixel point in the upper image; wherein the upper diamond pixel area is used as the upper diamond parameter, and the upper image is the image located above the center line in the diamond wire image; obtain the lower diamond pixel area corresponding to the diamond pixel point in the lower image; wherein the lower diamond pixel area is used as the lower diamond parameter, and the lower image is the image located below the center line in the diamond wire image.

[0142] In this feasible implementation manner, the parameter calculation module 503 is specifically used to: obtain the diamond area ratio of the upper diamond pixel area and the lower diamond pixel area; and obtain the positive and negative surface parameters according to the diamond area ratio.

[0143] In the embodiment of the present application, the preprocessing module 501 is specifically used to: convert the diamond wire image into a grayscale image; cluster the pixels in the grayscale image through three preset cluster centers to obtain a ternary image; wherein the ternary image includes a plurality of background pixels, a plurality of diamond pixels and a plurality of busbar pixels; convert the ternary image into a binary image; wherein the binary image is used as a preprocessing image. .

[0144] In an embodiment of the present application, the identification module 502 is specifically used to: for the upper part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the first two adjacent rows is greater than a set threshold, use the next row of the first two adjacent rows as the upper boundary of the diamond line; for the lower part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the second two adjacent rows is greater than the set threshold, use the upper row of the second two adjacent rows as the lower boundary of the diamond line; and determine the center line based on the upper boundary and the lower boundary.

[0145] In an embodiment of the present application, the device 500 may further include an overall discrimination module, which is used to obtain N detection results of whether the N diamond wire images are positive and negative side images after determining whether the diamond wire image is a positive and negative side image, if the diamond wire roll to be tested corresponds to N diamond wire images, wherein N is an integer greater than 1; based on the N detection results, determine the proportion of the number of positive and negative side images in the N diamond wire images; based on the proportion of the number, determine whether the diamond wire roll to be tested meets the qualification conditions.

[0146] It should be understood that, for the sake of brevity, some of the contents described in the method embodiments will not be repeated in the device embodiments.

[0147] Based on the same inventive concept, the present application embodiment provides an electronic device, see Figure 6 As shown, it includes a processor 601 and a memory 602. Among them:

[0148] The processor 601 is used to execute one or more programs stored in the memory 602 to implement the above-mentioned method for detecting the positive and negative sides of the diamond wire.

[0149] It is understood that the processor 601 may be a processor core or a processor chip, or other circuits capable of program configuration and operation, and the memory 602 may be a RAM (Random Access Memory), a ROM (Read-Only Memory), a flash memory, etc., but is not limited thereto.

[0150] It is understandable. Figure 6 The structure shown is for illustration only. The electronic device may also include Figure 6 More or fewer components as shown, or with Figure 6 For example, it may also have an internal communication bus for realizing communication between the processor 601 and the memory 602; for another example, it may also have an external communication interface, such as a USB (Universal Serial Bus) interface, a CAN (Controller Area Network) bus interface, etc., connected to an image acquisition device, so as to automatically acquire the image of the diamond wire to be detected; for another example, it may also have an information display component such as a display screen, but this is not a limitation.

[0151] Based on the same inventive concept, this embodiment also provides a computer-readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash disk, an SD (Secure Digital Memory Card) card, an MMC (Multimedia Card) card, etc., in which one or more programs for implementing the above steps are stored, and the one or more programs can be executed by one or more processors to implement the above-mentioned positive and negative surface detection method of the diamond wire. No further details will be given here.

[0152] In the embodiments provided in this application, the various embodiments and implementation methods can be freely combined to obtain new embodiments without conflict.

[0153] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0154] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0155] Furthermore, 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.

[0156] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0157] As used herein, a plurality refers to two or more than two.

[0158] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for detecting positive and negative surfaces of a diamond wire, characterized in that: include: Preprocessing the diamond wire image to be detected to obtain a preprocessed image, wherein the preprocessed image includes a plurality of background pixel points and a plurality of diamond pixel points; Identifying a center line of a diamond wire in the diamond wire image; According to the center line, an upper diamond parameter and a lower diamond parameter are obtained; wherein the upper diamond parameter is a diamond parameter when the diamond wire is located above the center line, and the lower diamond parameter is a diamond parameter when the diamond wire is located below the center line; Acquire positive and negative side parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters; According to the positive and negative surface parameters, it is determined whether the diamond wire image is a positive and negative surface image.

2. The positive and negative surface detection method according to claim 1, characterized in that: The step of obtaining upper diamond parameters and lower diamond parameters according to the center line includes: Obtaining the number of upper diamonds corresponding to the diamond pixel points in the upper image; wherein the number of upper diamonds is used as the upper diamond parameter, and the upper image is the image located above the midline in the diamond line image; The number of lower diamonds corresponding to the diamond pixel points in the lower portion of the image is obtained; wherein the number of lower diamonds is used as the lower diamond parameter, and the lower portion of the image is an image located below the center line in the diamond line image.

3. The positive and negative surface detection method according to claim 2, characterized in that: The step of acquiring the positive and negative side parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters includes: Obtaining a diamond quantity ratio of the upper diamond quantity to the lower diamond quantity; The positive and negative surface parameters are obtained according to the diamond quantity ratio.

4. The positive and negative surface detection method according to claim 2, characterized in that: The obtaining of the number of upper diamonds corresponding to the diamond pixel points in the upper image includes: Acquire an upper connected domain set corresponding to the diamond pixel point in the upper image; wherein the upper connected domain set includes a plurality of connected domains; According to a set pixel quantity, selecting a first large connected domain subset from the upper connected domain set; wherein the number of pixels contained in each connected domain in the first 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 first large connected domain subset to obtain the number of first split connected domains corresponding to the first large connected subset; The upper diamond number is determined according to the number of remaining connected domains and the number of the first split connected domains; wherein the number of remaining connected domains is the total number of all connected domains in the upper connected domain set except the first large connected domain subset.

5. The positive and negative surface detection method according to claim 2, characterized in that: The step of obtaining the number of lower diamonds corresponding to the diamond pixel points in the lower portion of the image includes: Acquire a lower connected domain set corresponding to the diamond pixel point in the lower portion of the image; wherein the lower connected domain set includes a plurality of connected domains; According to the set pixel quantity, selecting a second largest connected domain subset from the lower connected domain set; wherein the number of pixels contained in each connected domain in the second largest 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 second largest connected domain subset to obtain the number of second split connected domains corresponding to the second largest connected subset; The number of lower diamonds is determined according to the number of remaining connected domains and the number of the second split connected domains; wherein the number of remaining connected domains is the total number of all connected domains in the lower connected domain set except the second largest connected domain subset.

6. The positive and negative surface detection method according to claim 4 or 5, characterized in that: The step of obtaining the single pixel quantity includes: Obtaining an average number of pixels corresponding to all connected domains in the upper connected domain set and the lower connected domain set as a first pixel quantity; The single pixel quantity is determined according to the first pixel quantity.

7. The positive and negative surface detection method according to claim 4 or 5, characterized in that: The step of obtaining the single pixel quantity includes: Acquire a specified connected domain subset whose number of pixels in the upper connected domain set and the lower 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.

8. The positive and negative surface detection method according to claim 1, characterized in that: The step of obtaining upper diamond parameters and lower diamond parameters according to the center line includes: Acquire an upper diamond pixel area corresponding to a diamond pixel point in an upper portion of the image; wherein the upper diamond pixel area is used as the upper diamond parameter, and the upper portion of the image is an image located above the midline in the diamond line image; The lower diamond pixel area corresponding to the diamond pixel point in the lower portion of the image is obtained; wherein the lower diamond pixel area is used as the lower diamond parameter, and the lower portion of the image is an image located below the center line in the diamond line image.

9. The positive and negative surface detection method according to claim 8, characterized in that: The step of acquiring the positive and negative side parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters includes: Obtaining a diamond area ratio of the upper diamond pixel area to the lower diamond pixel area; The positive and negative surface parameters are obtained according to the diamond area ratio.

10. The positive and negative surface detection method according to any one of claims 1-5, 8-9, characterized in that: The step of preprocessing the diamond wire image to be detected to obtain a preprocessed image includes: Converting the diamond wire image into a grayscale image; Clustering the pixels in the grayscale image through three preset cluster centers to obtain a ternary image; wherein the ternary image includes a plurality of background pixels, a plurality of diamond pixels and a plurality of busbar pixels; The ternary image is converted into a binary image; wherein the binary image is used as a preprocessed image.

11. The positive and negative surface detection method according to claim 10, characterized in that: The identifying the center line of the diamond wire in the diamond wire image comprises: For the upper part of the binary image, when it is first detected that the difference between the sum of pixels of the first two adjacent rows is greater than a set threshold, the next row of the first two adjacent rows is used as the upper boundary of the diamond line; For the lower part of the image in the binary image, when it is first detected that the difference between the sum of pixels of the second two adjacent rows is greater than the set threshold, the upper row of the second two adjacent rows is used as the lower boundary of the diamond line; The center line is determined based on the upper boundary and the lower boundary.

12. The positive and negative surface detection method according to any one of claims 1-5, 8-9, characterized in that: After determining whether the diamond line image is a positive and negative surface image, the method further includes: If the diamond wire roll to be tested corresponds to N diamond wire images, then obtaining N detection results of whether the N diamond wire images are positive and negative surface images, wherein N is an integer greater than 1; According to the N detection results, determining the proportion of positive and negative side images in the N diamond wire images; According to the quantity ratio, determine whether the diamond wire reel to be tested meets the qualification conditions.

13. A device for detecting positive and negative surfaces 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 pixel points and a plurality of diamond pixel points; A recognition module, used for recognizing the center line of the diamond wire in the diamond wire image; A parameter calculation module, used to obtain upper diamond parameters and lower diamond parameters according to the center line, and obtain positive and negative surface parameters of the diamond wire image according to the upper diamond parameters and the lower diamond parameters; wherein the upper diamond parameters are diamond parameters of the diamond wire located above the center line, and the lower diamond parameters are diamond parameters of the diamond wire located below the center line; A determination module is used to determine whether the diamond wire image is a positive-negative surface image according to the positive-negative surface parameters.

14. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute one or more programs stored in the memory to implement the positive and negative side detection method of the diamond wire according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the positive and negative surface detection method of the diamond wire as described in any one of claims 1-15.