Diamond wire diameter identification method and device, electronic equipment and storage medium
By preprocessing and boundary recognition of diamond line images, the diamond line diameter is automatically calculated, which solves the problems of low detection accuracy and insufficient real-time performance in the prior art, and achieves efficient and accurate diamond line diameter recognition.
Patent Information
- Application Number
- CN202311280465.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-09-28
AI Technical Summary
The prior art has low accuracy when detecting the diameter of the diamond line and cannot be detected in real time during the production process of the diamond line, resulting in low detection efficiency.
By preprocessing the diamond line image of the diamond line to be tested, the upper and lower boundaries of the diamond line are identified, and the pixel values of each row of pixels are calculated to automatically identify the diameter of the diamond line.
It improves the accuracy and efficiency of identification of diamond wire diameter, and can conduct real-time detection when the diamond wire is moved or stationary, which is suitable for real-time quality monitoring during production.
Smart Images

Figure CN119762572A_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 and device for identifying the diameter of a diamond wire, an electronic device, and a computer-readable storage medium. Background Art
[0002] Diamond wire is also called diamond wire. It is a wire formed by fixing diamond abrasive on metal wire by electroplating, brazing or resin bonding. The hardness of diamond can be used to process silicon wafers, sapphire or ceramics. At present, diamond wire is mostly manufactured by electroplating power. The electroplating process uses steel wire as the matrix and diamond powder as the abrasive. Diamond powder is deposited on the surface of steel wire through electroplating diamond wire tooling to produce diamond wire.
[0003] The quality inspection of diamond wire can include diameter, coating thickness, blade rate, blade height, agglomeration, etc. Commonly used inspection equipment includes wire gauges, micrometers, etc. The inspection accuracy is low when the inspection equipment is used to conduct real-time inspection during the movement of the diamond wire. If the inspection is performed when the diamond wire is stationary to improve accuracy, it can only be performed before and after the production of the diamond wire begins, and it cannot be inspected during the production process. The length of each roll of diamond wire is 60 kilometers to 100 kilometers. Inspection at both ends of such a long finished diamond wire will result in low accuracy of the detected diameter and low efficiency of manual inspection. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method and device for identifying the diameter of a diamond wire, an electronic device, and a storage medium, which are used to automatically identify the diameter of the diamond wire at various positions, thereby improving the recognition accuracy and efficiency.
[0005] On the one hand, the present application provides a method for identifying the diameter of a diamond wire, comprising:
[0006] Preprocessing the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image, wherein the preprocessed image includes a plurality of non-diamond pixels and a plurality of diamond pixels;
[0007] According to the sum of pixel values of each row of pixels in the preprocessed image, identifying the upper boundary and the lower boundary of the diamond line in the preprocessed image;
[0008] The diamond wire diameter in the diamond wire image is acquired according to the upper boundary and the lower boundary.
[0009] In one embodiment, the step of identifying the upper boundary and the lower boundary of the diamond line in the preprocessed image according to the sum of the pixel values of each row of pixels in the preprocessed image comprises:
[0010] The first row of pixels and the second row of pixels satisfying the diamond line boundary recognition condition are obtained from the preprocessed image, and the first row of pixels is used as the upper boundary of the diamond line in the preprocessed image, and the second row of pixels is used as the lower boundary of the diamond line in the preprocessed image, wherein the first row of pixels is located above the second row of pixels.
[0011] In one embodiment, acquiring a first row of pixels and a second row of pixels satisfying a diamond line boundary recognition condition from the preprocessed image includes:
[0012] If the diamond line boundary recognition condition includes a diamond line boundary setting value, then from top to bottom, it is determined in turn whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value, and a row of pixels whose pixel values and the sum of the pixels are greater than the diamond line boundary setting value determined for the first time are used as the first row of pixels;
[0013] And in order from bottom to top, determine in turn whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value, and use a row of pixels whose pixel values are first determined to be greater than the diamond line boundary setting value as the second row of pixels.
[0014] In one embodiment, acquiring a first row of pixels and a second row of pixels satisfying a diamond line boundary recognition condition from the preprocessed image includes:
[0015] If the diamond wire boundary recognition condition includes pixel values and changes, the first row of pixels and the second row of pixels are obtained according to the ratio of the change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the pixel values and changes.
[0016] In one embodiment, acquiring the first row of pixels and the second row of pixels according to a ratio of a change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the amount of change of the sum of pixel values includes:
[0017] Detecting the sum of pixel values of each row of pixels in the preprocessed image in order from top to bottom, and when it is first detected that a first change value between the sum of pixel values of first two adjacent rows of pixels is greater than the sum of pixel values, taking the next row of pixels in the first two adjacent rows of pixels as the first row of pixels;
[0018] The pixel value sum of each row of pixels in the preprocessed image is detected in order from bottom to top. When it is first detected that the second change value between the pixel sum of the second two adjacent rows of pixels is greater than the pixel value sum change, the upper row of pixels in the second two adjacent rows of pixels is used as the second row of pixels.
[0019] In one embodiment, the preprocessing of the diamond wire image of the diamond wire coil to be tested to obtain the preprocessed image includes:
[0020] Converting the diamond wire image into a grayscale image;
[0021] Clustering the pixels in the grayscale image using three preset initial 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;
[0022] The ternary image is converted into a binary image, wherein the binary image is used as a preprocessed image.
[0023] In one embodiment, after obtaining the diamond wire diameter in the diamond wire image, the method further includes:
[0024] If the diamond wire roll to be tested includes N diamond wire images, then obtaining N diamond wire diameters corresponding to the N diamond wire images, where N is an integer greater than 1;
[0025] According to the N diamond wire diameters, a diameter dimension evaluation result of the diamond wire roll to be tested is determined.
[0026] On the other hand, the present application provides a device for identifying the diameter of a diamond wire, comprising:
[0027] A preprocessing module, used for preprocessing the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image, wherein the preprocessed image includes a plurality of non-diamond pixels and a plurality of diamond pixels;
[0028] An identification module, used for identifying the upper boundary and the lower boundary of the diamond line in the preprocessed image according to the sum of the pixel values of each row of pixels in the preprocessed image;
[0029] An acquisition module is used to acquire the diamond wire diameter in the diamond wire image according to the upper boundary and the lower boundary.
[0030] Furthermore, the present application provides an electronic device, the electronic device comprising:
[0031] processor;
[0032] a memory for storing processor-executable instructions;
[0033] Wherein, the processor is configured to execute the above-mentioned method for identifying the diameter of the diamond wire.
[0034] 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 diamond wire diameter identification method.
[0035] In the present application scheme, after converting the diamond wire image into a pre-processed image, since the pixel value of each pixel in the pre-processed image can characterize the pixel category (diamond pixel or non-diamond pixel), after calculating the sum of the pixel values of each row of pixels in the pre-processed image, since the larger the sum of the pixel values, the more diamond pixels there are in the row of pixels, the upper and lower boundaries of the diamond wire in the image can be determined based on the sum of the pixel values, and then the distance between the upper and lower boundaries is used as the diameter of the diamond wire. This process is automatically performed by electronic equipment, and the diameter recognition can be completed when the diamond wire roll to be tested is moving or stationary, and each segment of the diamond wire of the entire diamond wire roll to be tested can be accurately identified, with high real-time performance and accuracy, and higher detection efficiency than manual detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] 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.
[0037] Figure 1 A schematic flow chart of a method for identifying the diameter of a diamond wire provided in one embodiment of the present application;
[0038] Figure 2 An embodiment of the present application provides Figure 1 Detailed flow chart of step 110;
[0039] Figure 3 A schematic diagram of a grayscale image provided by an embodiment of the present application;
[0040] Figure 4 A schematic diagram of a diamond wire area in an image provided by an embodiment of the present application;
[0041] Figure 5 A block diagram of a device for identifying the diameter of a diamond wire provided in one embodiment of the present application;
[0042] Figure 6 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0043] 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.
[0044] 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.
[0045] See also Figure 1 , is a flow chart of a method for identifying the diameter of a diamond wire provided in an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps 110 to 130.
[0046] Step 110: preprocessing the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image, wherein the preprocessed image includes a plurality of non-diamond pixels and a plurality of diamond pixels.
[0047] Among them, the diamond wire roll to be tested is a wire roll composed of diamond wires that need to be identified in diameter. When the diameter of the diamond wire roll to be tested is identified, the diamond wire images of each segment of the diamond wire of the diamond wire roll to be tested can be photographed separately. Exemplarily, an industrial camera can be deployed on the production line of the diamond wire roll to be tested. During the production process of the diamond wire roll to be tested, the diamond wire images of each segment of the diamond wire are photographed in real time by the industrial camera for diameter identification. Electronic devices (such as: host, server, etc.) docked with the industrial camera can obtain diamond wire images, so as to identify the diameter of the diamond wire roll to be tested in the diamond wire image with each diamond wire image.
[0048] The diamond wire image is a three-channel image with the color channel order of BGR (Blue Green Red). Diameter recognition can be achieved through a single-channel image, and it is only necessary to distinguish between diamond pixels (pixels at the position where the diamond is located in the image) and non-diamond pixels (pixels at positions other than the position where the diamond is located) in the image. The electronic device can pre-process the diamond wire image currently used for diameter recognition to obtain a pre-processed image. Here, the pre-processed image can be a binary image.
[0049] Step 120: Identify the upper boundary and the lower boundary of the diamond line in the preprocessed image according to the sum of the pixel values of each row of pixels in the preprocessed image.
[0050] Here, the pixel value sum refers to the sum of the pixel values of each row of pixels.
[0051] The electronic device can calculate the sum of pixel values of each row of pixels in the preprocessed image, and then identify the upper boundary and lower boundary of the diamond line in the preprocessed image according to the calculated sum of pixel values. Here, the upper boundary is the boundary of the diamond line on the upper side of the image, and the lower boundary is the boundary of the diamond line on the lower side of the image.
[0052] Step 130: Obtain the diamond wire diameter in the diamond wire image according to the upper boundary and the lower boundary.
[0053] After determining the upper boundary and the lower boundary, the electronic device may determine the distance between the upper boundary and the lower boundary, and use the distance as the diameter of the diamond wire roll to be tested in the target grayscale image (diamond wire image).
[0054] Through the above measures, after the diamond wire image is converted into a preprocessed image, since the pixel value of each pixel in the preprocessed image can represent the pixel category (diamond pixel or non-diamond pixel), after calculating the pixel value and of each row of pixels in the preprocessed image, since the larger the pixel value, the more diamond pixels there are in the row of pixels, the upper and lower boundaries of the diamond wire in the image can be determined based on the pixel value and, then, the distance between the upper and lower boundaries can be used as the diameter of the diamond wire. This process is automatically performed by electronic equipment, and the diameter recognition can be completed when the diamond wire roll to be tested is moving or stationary, and each section of the diamond wire of the entire diamond wire roll to be tested can be accurately identified, with high real-time performance and accuracy, and higher detection efficiency than manual detection.
[0055] In one embodiment, see Figure 2 , provided in one embodiment of the present application Figure 1 The detailed flow chart of step 110 is as follows: Figure 2 As shown, when executing step 110, steps 111 to 113 may be specifically executed.
[0056] Step 111: Convert the diamond wire image into a grayscale image.
[0057] The electronic device can convert the pixel value of each pixel in the diamond wire image, thereby converting the diamond wire image into a grayscale image. For example, the three-channel RGB pixel value of each pixel point in the color 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 point after conversion, R is the color intensity value of the color pixel point in the red channel, G is the color intensity value of the color pixel point in the green channel, and B is the color intensity value of the color pixel point in the blue channel.
[0058] In one embodiment, after converting the diamond wire image into a grayscale image, the noise in the grayscale image can be eliminated by using morphological processing of a closing operation. By this measure, the image can be denoised, thereby clarifying the boundaries between diamonds in the image, reducing the adverse effects of noise on diameter recognition, and facilitating subsequent processing.
[0059] See also Figure 3 , is a schematic diagram of a grayscale image provided by an embodiment of the present application, such as Figure 3 As shown in the figure, the black part in the grayscale image is the background; the gray part is the edge of the busbar, and the busbar is between the two busbar edges; the part with the highest brightness is the diamond on the busbar. The busbar and the diamond together constitute the diamond wire.
[0060] Step 112: clustering the pixels in the grayscale image using three preset initial 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.
[0061] 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, the cluster centers will change. After the clustering is completed, three clusters can be obtained, each of which includes multiple pixels.
[0062] 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 overall detection accuracy of the sand volume detection.
[0063] 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.
[0064] Step 113: Convert the ternary image into a binary image, wherein the binary image is used as a preprocessed image.
[0065] After obtaining the ternary image, the electronic device can classify the pixels in the ternary image 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 largest pixel value. Therefore, 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.
[0066] The electronic device can set the pixel value of the non-diamond pixel to zero, or set the pixel value of the non-diamond pixel to the pixel value of the background pixel or the busbar pixel; similarly, the pixel value of the diamond pixel can be set to a specified positive integer or remain unchanged, thereby converting the ternary image into a binary image, and using the binary image as a preprocessed image.
[0067] 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.
[0068] In one embodiment, after determining the category information of each pixel in the image, the diamond pixels may be expanded. During the clustering process, the pixels at the edge of the diamond may be divided into clusters corresponding to the busbar, that is, the diamond pixels at the edge of the diamond are identified as busbar pixels, which will result in a reduction in the area of the identified diamond. Therefore, by expanding the diamond pixels, the area of the diamond in the image can be restored, so as to correctly detect the diameter of the diamond wire later.
[0069] In one embodiment, when executing step 120, the electronic device may obtain the first row of pixels and the second row of pixels satisfying the diamond line boundary recognition condition from the preprocessed image, and use the first row of pixels as the upper boundary of the diamond line in the preprocessed image, and use the second row of pixels as the lower boundary of the diamond line in the preprocessed image. The first row of pixels is located above the second row of pixels.
[0070] Here, the diamond wire boundary recognition condition is used to recognize the boundary of the diamond wire in the image.
[0071] The electronic device can calculate the sum of pixel values of each row of pixels in the preprocessed image, and check whether the sum of pixel values meets the diamond line boundary recognition condition, thereby determining the first row of pixels and the second row of pixels, and obtaining the upper boundary and the lower boundary of the diamond line image.
[0072] See also Figure 4 , is a schematic diagram of a diamond wire area in an image provided by an embodiment of the present application, such as Figure 4 As shown, the first row of pixels on the upper side of the diamond line is the upper boundary, the second row of pixels on the lower side of the diamond line is the lower boundary, and the area between the upper boundary and the lower boundary is the diamond line area.
[0073] In one embodiment, if the diamond line boundary recognition condition includes a diamond line boundary setting value, the electronic device can determine, from top to bottom, whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value. Here, the diamond line boundary setting value is used to screen the diamond line boundary, representing the minimum sum of the pixel values of a row of pixels in the area where the diamond line is located.
[0074] On the one hand, if in the process of traversing each row of pixels, it is determined that the sum of the pixel values of any row of pixels is not greater than the diamond line boundary setting value, the next row of pixels can be checked. On the other hand, if it is determined that the sum of the pixel values of a row of pixels is greater than the diamond line boundary setting value, the row of pixels whose sum of pixels is greater than the diamond line boundary setting value determined for the first time can be used as the first row of pixels.
[0075] The electronic device can determine whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value in a bottom-up order. On the one hand, if it is determined that the sum of the pixel values of any row of pixels is not greater than the diamond line boundary setting value during the process of traversing each row of pixels, the next row of pixels can be checked. On the other hand, if it is determined that the sum of the pixel values of a row of pixels is greater than the diamond line boundary setting value, the row of pixels whose sum of the pixels determined for the first time is greater than the diamond line boundary setting value can be used as the second row of pixels.
[0076] Through the above measures, since the pixel value of non-diamond pixels in the preprocessed image is zero, and the pixel value of diamond pixels is a specified positive integer, in the process of scanning pixels line by line and summing the pixel values, if the edge of the diamond wire is encountered, the number of diamond pixels in a row of pixels is large and the sum result is relatively large. Therefore, based on the diamond wire boundary setting value, a row of pixels with diamond pixels can be effectively screened out, thereby accurately identifying the upper and lower boundaries of the diamond wire.
[0077] In one embodiment, if the diamond line boundary recognition conditions include pixel values and changes, the electronic device can obtain the first row of pixels and the second row of pixels based on the ratio of the change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the pixel value change.
[0078] Here, the pixel value and the variation are used to screen the diamond line boundary, and are proportional to the minimum difference between the pixel value sum of the diamond line boundary and the pixel value sum of a row of pixels in the area outside the diamond line. Exemplarily, the pixel value and the variation are the minimum difference between the pixel value sum of the diamond line boundary and the pixel value sum of a row of pixels in the area outside the diamond line.
[0079] Since the pixel value of the diamond pixel in the preprocessed image is a specified positive integer, the pixel value of the non-diamond pixel is zero. For any pair of adjacent two rows of pixels in the preprocessed image, if the two adjacent rows of pixels are both located in the diamond line area or the area outside the diamond line, the difference in the number of diamond pixels in the two rows of pixels is small, and accordingly, the change value between the sum of the pixel values is also small. If the two adjacent rows of pixels are located exactly at the junction of the diamond line area and the non-diamond line area, one row of pixels belongs to the diamond line area and the other row of pixels belongs to the non-diamond line area, then the difference in the number of diamond pixels in the two rows of pixels is large, and accordingly, the change value between the sum of the pixel values is also large.
[0080] In this case, by calculating the sum of the pixel values of each row of pixels in the preprocessed image, the change value between the sum of the pixel values of multiple pairs of two adjacent rows of pixels is determined, and the ratio of the change value to the pixel value and the change value is calculated. The larger the ratio, the larger the change value between the pixel sums of two adjacent rows of pixels. The electronic device can determine the two adjacent rows of pixels at the junction of the diamond line area and the non-diamond line area based on the ratio, and then determine the first row of pixels and the second row of pixels therefrom as the upper boundary and the lower boundary. Exemplarily, if the pixel value and the change amount are the minimum difference between the pixel value sum of the diamond line boundary and the pixel value sum of a row of pixels in the area outside the diamond line, then when the ratio of the change value to the pixel value and the change amount is not less than 1, it can be determined that there is a diamond line boundary in the two adjacent rows of pixels corresponding to the change value.
[0081] Through the above measures, the first row of pixels and the second row of pixels can be found from the preprocessed image based on the pixel values of the two rows of pixels at the junction of the diamond line area and the non-diamond line area and the law of large changes.
[0082] In one embodiment, when obtaining the first row of pixels and the second row of pixels according to the ratio of the change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the change amount of the sum of pixel values, the electronic device may detect the sum of pixel values of each row of pixels in the preprocessed image in a top-to-bottom order. After detecting the sum of pixel values of each row, the first change value between the sum of pixel values of two adjacent rows of pixels may be calculated. Here, the first change value is the change value between the sum of pixel values calculated for each pair of two adjacent rows of pixels when traversing each row of pixels from top to bottom.
[0083] The electronic device can determine whether the first change value is greater than the pixel value and the change amount. In one case, if the first change value is not greater than the pixel value and the change amount, the first change value of the sum of the pixel values of the next pair of adjacent two rows of pixels can be checked. In another case, if the first change value is greater than the pixel value and the change amount, when it is first detected that the first change value between the sum of the pixel values of the first two adjacent rows of pixels is greater than the pixel value and the change amount, the next row of pixels in the first two adjacent rows of pixels can be used as the first row of pixels. Here, the first two adjacent rows of pixels are the two adjacent rows of pixels corresponding to the first change value greater than the pixel value and the change amount that is detected for the first time.
[0084] The electronic device may detect the sum of the pixel values of each row of pixels in the preprocessed image in a bottom-up order. After detecting the sum of the pixel values of each row, a second change value between the sum of the pixel values of two adjacent rows of pixels may be calculated. Here, the second change value is a change value between the sum of the pixel values calculated for each pair of two adjacent rows of pixels when traversing each row of pixels from bottom to top.
[0085] The electronic device can determine whether the second change value is greater than the pixel value and the change amount. In one case, if the second change value is not greater than the pixel value and the change amount, the second change value of the sum of the pixel values of the next pair of adjacent two rows of pixels can be checked. In another case, if the second change value is greater than the pixel value and the change amount, when it is first detected that the second change value between the sum of the pixel values of the second adjacent two rows of pixels is greater than the pixel value and the change amount, the previous row of pixels in the second adjacent two rows of pixels can be used as the second row of pixels. Here, the second adjacent two rows of pixels are the adjacent two rows of pixels corresponding to the second change value greater than the pixel value and the change amount that is first detected.
[0086] Through the above measures, detection can be performed sequentially from the top and bottom of the preprocessed image, so as to accurately detect the first row of pixels and the second row of pixels based on the pixel values of the two rows of pixels at the junction of the diamond line area and the non-diamond line area and the law of large changes.
[0087] In one embodiment, if the diamond wire roll to be tested includes N diamond wire images, then N diamond wire diameters corresponding to the N diamond wire images are obtained, where N is an integer greater than 1.
[0088] The electronic device can determine the diameter dimension evaluation result of the diamond wire roll to be tested according to the N diamond wire diameters. Here, the diameter dimension evaluation result represents the overall evaluation result of the diamond wire roll to be tested in the diameter dimension.
[0089] In one embodiment, the electronic device can calculate the average of N diamond wire diameters to obtain an average diameter, and then determine whether the average diameter is in a standard diameter interval. Here, the standard diameter interval represents an interval consisting of the maximum and minimum diameters of the diamond wire that meets the quality standards, and the standard diameter interval can be pre-configured as needed. On the one hand, if the average diameter is in the standard diameter interval, it can be determined that the diameter dimension evaluation result is qualified. On the other hand, if the average diameter is not in the standard diameter interval, it can be determined that the diameter dimension evaluation result is unqualified.
[0090] In one embodiment, the electronic device can determine whether each diamond wire diameter is within a standard diameter interval. Here, the standard diameter interval represents an interval consisting of a maximum value and a minimum value of a diamond wire diameter that meets the quality standard, and the standard diameter interval can be pre-configured as needed. In this case, a judgment result corresponding to each diameter can be obtained. The judgment result can be "yes" or "no".
[0091] The electronic device can count the proportion of N diamond wire diameters that are within the standard diameter range, and then multiply the proportion by 100 to obtain a score, and use the score as the diameter dimension evaluation result. In this case, the larger the diameter dimension evaluation result, the better the quality of the diamond wire roll to be tested in the diameter dimension.
[0092] Through the above measures, the electronic device can integrate and convert the overall evaluation result of the diamond wire roll to be tested in the diameter dimension based on the diamond wire diameter of the diamond wire roll to be tested on the N diamond wire images. In this way, since the N diamond wire images usually correspond to most of the diamond wires in the diamond wire roll to be tested, the diameter of most of the diamond wires in the diamond wire roll to be tested can be obtained, so that the accuracy of the diameter of the diamond wire roll to be tested obtained based on the diameter of most of the diamond wires is higher.
[0093] Figure 5 is a block diagram of a device for identifying the diameter of a diamond wire according to an embodiment of the present invention, Figure 5 As shown, the device may include:
[0094] A preprocessing module 510 is used to preprocess the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image, wherein the preprocessed image includes a plurality of non-diamond pixels and a plurality of diamond pixels;
[0095] An identification module 520, configured to identify the upper boundary and the lower boundary of the diamond line in the preprocessed image according to the sum of the pixel values of each row of pixels in the preprocessed image;
[0096] The acquisition module 530 is used to acquire the diamond wire diameter in the diamond wire image according to the upper boundary and the lower boundary.
[0097] In one embodiment, the identification module 520 is further configured to:
[0098] The first row of pixels and the second row of pixels satisfying the diamond line boundary recognition condition are obtained from the preprocessed image, and the first row of pixels is used as the upper boundary of the diamond line in the preprocessed image, and the second row of pixels is used as the lower boundary of the diamond line in the preprocessed image, wherein the first row of pixels is located above the second row of pixels.
[0099] In one embodiment, the identification module 520 is further configured to:
[0100] If the diamond line boundary recognition condition includes a diamond line boundary setting value, then from top to bottom, it is determined in turn whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value, and a row of pixels whose pixel values and the sum of the pixels are greater than the diamond line boundary setting value determined for the first time are used as the first row of pixels;
[0101] And in order from bottom to top, determine in turn whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value, and use a row of pixels whose pixel values are first determined to be greater than the diamond line boundary setting value as the second row of pixels.
[0102] In one embodiment, the identification module 520 is further configured to:
[0103] If the diamond wire boundary recognition condition includes pixel values and changes, the first row of pixels and the second row of pixels are obtained according to the ratio of the change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the pixel values and changes.
[0104] In one embodiment, the identification module 520 is further configured to:
[0105] Detecting the sum of pixel values of each row of pixels in the preprocessed image in order from top to bottom, and when it is first detected that a first change value between the sum of pixel values of first two adjacent rows of pixels is greater than the sum of pixel values, taking the next row of pixels in the first two adjacent rows of pixels as the first row of pixels;
[0106] The pixel value sum of each row of pixels in the preprocessed image is detected in order from bottom to top. When it is first detected that the second change value between the pixel sum of the second two adjacent rows of pixels is greater than the pixel value sum change, the upper row of pixels in the second two adjacent rows of pixels is used as the second row of pixels.
[0107] In one embodiment, the preprocessing module 510 is further configured to:
[0108] Converting the diamond wire image into a grayscale image;
[0109] Clustering the pixels in the grayscale image using three preset initial 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;
[0110] The ternary image is converted into a binary image, wherein the binary image is used as a preprocessed image.
[0111] In one embodiment, the acquisition module 530 is further configured to:
[0112] If the diamond wire roll to be tested includes N diamond wire images, then obtaining N diamond wire diameters corresponding to the N diamond wire images, where N is an integer greater than 1;
[0113] According to the N diamond wire diameters, a diameter dimension evaluation result of the diamond wire roll to be tested is determined.
[0114] 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 identifying the diameter of the diamond wire, and will not be repeated here.
[0115] like Figure 6As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 6 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 identifying the diameter of a diamond wire.
[0116] 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.
[0117] 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 identifying the diamond wire diameter provided in the present application.
[0118] 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.
[0119] 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.
[0120] 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 identifying the diameter of a diamond wire, characterized in that: include: Preprocessing the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image, wherein the preprocessed image includes a plurality of non-diamond pixels and a plurality of diamond pixels; According to the sum of pixel values of each row of pixels in the preprocessed image, identifying the upper boundary and the lower boundary of the diamond line in the preprocessed image; The diamond wire diameter in the diamond wire image is acquired according to the upper boundary and the lower boundary.
2. The method according to claim 1, characterized in that The step of identifying the upper boundary and the lower boundary of the diamond line in the preprocessed image according to the sum of the pixel values of each row of pixels in the preprocessed image comprises: The first row of pixels and the second row of pixels satisfying the diamond line boundary recognition condition are obtained from the preprocessed image, and the first row of pixels is used as the upper boundary of the diamond line in the preprocessed image, and the second row of pixels is used as the lower boundary of the diamond line in the preprocessed image, wherein the first row of pixels is located above the second row of pixels.
3. The method according to claim 2, characterized in that The step of acquiring a first row of pixels and a second row of pixels satisfying a diamond line boundary recognition condition from the preprocessed image comprises: If the diamond line boundary recognition condition includes a diamond line boundary setting value, then from top to bottom, it is determined in turn whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value, and a row of pixels whose pixel values and the sum of the pixels are greater than the diamond line boundary setting value determined for the first time are used as the first row of pixels; And in order from bottom to top, determine in turn whether the sum of the pixel values of each row of pixels in the preprocessed image is greater than the diamond line boundary setting value, and use a row of pixels whose pixel values are first determined to be greater than the diamond line boundary setting value as the second row of pixels.
4. The method according to claim 2, characterized in that: The step of acquiring a first row of pixels and a second row of pixels satisfying a diamond line boundary recognition condition from the preprocessed image comprises: If the diamond wire boundary recognition condition includes pixel values and changes, the first row of pixels and the second row of pixels are obtained according to the ratio of the change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the pixel values and changes.
5. The method according to claim 4, characterized in that The acquiring the first row of pixels and the second row of pixels according to the ratio of the change value between the sum of pixel values of two adjacent rows of pixels in the preprocessed image and the change amount of the sum of pixel values comprises: Detecting the sum of pixel values of each row of pixels in the preprocessed image in order from top to bottom, and when it is first detected that a first change value between the sum of pixel values of first two adjacent rows of pixels is greater than the sum of pixel values, taking the next row of pixels in the first two adjacent rows of pixels as the first row of pixels; The pixel value sum of each row of pixels in the preprocessed image is detected in order from bottom to top. When it is first detected that the second change value between the pixel sum of the second two adjacent rows of pixels is greater than the pixel value sum change, the upper row of pixels in the second two adjacent rows of pixels is used as the second row of pixels.
6. The method according to claim 1, characterized in that The method of preprocessing the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image includes: Converting the diamond wire image into a grayscale image; Clustering the pixels in the grayscale image using three preset initial 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; The ternary image is converted into a binary image, wherein the binary image is used as a preprocessed image.
7. The method according to claim 1, characterized in that After obtaining the diamond wire diameter in the diamond wire image, the method further includes: If the diamond wire roll to be tested includes N diamond wire images, then obtaining N diamond wire diameters corresponding to the N diamond wire images, where N is an integer greater than 1; According to the N diamond wire diameters, a diameter dimension evaluation result of the diamond wire roll to be tested is determined.
8. A device for identifying the diameter of a diamond wire, characterized in that: include: A preprocessing module, used for preprocessing the diamond wire image of the diamond wire coil to be tested to obtain a preprocessed image, wherein the preprocessed image includes a plurality of non-diamond pixels and a plurality of diamond pixels; An identification module, used for identifying the upper boundary and the lower boundary of the diamond line in the preprocessed image according to the sum of the pixel values of each row of pixels in the preprocessed image; An acquisition module is used to acquire the diamond wire diameter in the diamond wire image according to the upper boundary and the lower boundary.
9. 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 diamond wire diameter identification method described in any one of claims 1-7.
10. 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 identifying the diameter of a diamond wire as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Diamond cutter-based dimension detection method and device and terminal equipment
CN116402786A
Map building method, computer-readable storage medium and robot
US20210183116A1