Drilling tool surface quality detection method and system

By calculating the noise possibility and confidence of pixel points in the drilling tool surface image and adjusting the mark value during the LBP feature extraction process, the low accuracy problem caused by noise interference in traditional detection methods is solved, and a higher drilling tool surface detection accuracy is achieved.

CN119963542BActive Publication Date: 2025-06-06ZHONGKE DRILLING (XIAN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510416519.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-06-06
Estimated Expiration
2045-04-03

AI Technical Summary

Technical Problem

The traditional drilling tool surface quality detection method has noise interference, resulting in low detection accuracy and inability to accurately identify drilling tool surface defects.

Method used

By calculating the noise possibility and confidence of pixel points in the grayscale image of the drill tool, adjusting the mark value of neighboring pixel points, improving the accuracy of LBP feature extraction, thereby improving the accuracy of drill tool surface detection.

Benefits of technology

Effectively reduce the impact of noise on LBP feature extraction, improve the accuracy of drilling tool surface detection, reduce misjudgment, and enhance the reliability of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963542B_ABST
    Figure CN119963542B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and in particular to a method and system for detecting the surface quality of a drill tool, the method comprising the steps of: calculating the confidence of the neighboring pixel points of each pixel point in the grayscale image of the drill tool; adjusting the label value of the neighboring pixel points according to the confidence of the neighboring pixel points to obtain the optimal label value; calculating the optimal feature value of the central pixel point based on the optimal label value, and extracting features from the grayscale image based on the optimal feature value to determine the surface state of the drill tool. The present application has the effect of improving the detection accuracy of the drill tool surface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and system for detecting the surface quality of drilling tools. Background Art

[0002] Drilling tools refer to tools related to thresholds such as drilling holes and drilling holes. During the operation of drilling tools, cracks, scratches, corrosion, pits and other defects are prone to occur on the surface of drilling tools. These defects will not only reduce the mechanical properties of drilling tools, but may also cause underground accidents and cause huge economic losses. Therefore, it is necessary to conduct quality inspection of drilling tool surface defects before or during construction to reduce safety risks. The traditional inspection method is direct observation by staff; this method is labor-intensive and the inspection results are not accurate enough. However, the development of machine vision technology is gradually applied to industry, gradually replacing traditional manual inspection methods. LBP (Local Binary Patterns) is a common image processing algorithm that can describe the texture features of images. It is mainly used in detection and recognition tasks. For example, a method and system for intelligent monitoring of wire rope surface damage based on LBP features is disclosed in the patent document with the authorization announcement number CN109859170B; it mainly includes the steps of obtaining wire rope images, extracting image texture features extracted by LBP algorithm, training integrated algorithm models, and inspecting the wire rope to be inspected through the integrated algorithm model.

[0003] However, noise is inevitable in the image acquisition process, which will have a great interference on the LBP algorithm. Specifically, the existence of noise causes abnormal fluctuations in the grayscale value of pixels in the image, which in turn leads to errors in the label values ​​of neighboring pixels, and ultimately causes deviations in the calculation process of the LBP algorithm, affecting the accuracy of subsequent drilling surface detection. Summary of the invention

[0004] In order to solve the problem of low drilling tool surface detection accuracy caused by noise, the present application provides a drilling tool surface quality detection method and system.

[0005] In the first aspect, the present application provides a method for detecting the surface quality of a drilling tool, which adopts the following technical solution:

[0006] A method for detecting the surface quality of a drilling tool comprises the steps of: obtaining a grayscale image of the drilling tool; calculating the noise possibility of a pixel point based on the grayscale value of the pixel point in the grayscale image;

[0007] Calculate the confidence of the neighboring pixels of each pixel in the grayscale image of the drilling tool; adjust the label value of the neighboring pixels according to the confidence of the neighboring pixels; calculate the optimal eigenvalue of the central pixel based on the adjusted label value of the neighboring pixels, and extract the features of the grayscale image based on the optimal eigenvalue to determine the surface state of the drilling tool; the calculation formula of the confidence is:

[0008] ; Where: Represents the grayscale image Line The first pixel of the column The confidence of the neighboring pixels, Represents the grayscale image Line The first pixel of the column The noise probability of the neighboring pixels is Indicates Line The gray value of the pixel. Indicates Line The first pixel of the column The gray value of the neighboring pixels, Indicates Line Grayscale stability of pixels in the neighborhood of column pixels; Represents an exponential function with a natural constant as its base.

[0009] During the LBP extraction process, the grayscale value of the neighborhood pixel affects the LBP feature extraction of the pixel, and when the neighborhood pixel is a noise point, it will cause a deviation in the LBP feature value extraction. In this application, the grayscale value in the grayscale image of the drill is analyzed to obtain the noise possibility of each pixel. In the process of extracting the LBP feature value, the label value of the neighborhood pixel is analyzed by the noise possibility corresponding to the neighborhood pixel. The label value is adjusted according to the confidence level to reduce the impact of the noise on the LBP feature extraction and improve the accuracy of the drill surface detection. In the formula, the difference between the grayscale values ​​of the neighborhood pixel and the center pixel in the LBP feature extraction process, as well as the grayscale stability of the grayscale values ​​of the neighborhood pixel in the neighborhood, are also combined to further improve the accuracy of judging noise points, and further improve the accuracy of drilling tool detection.

[0010] Optionally, the grayscale stability calculation formula is: ; Where: Indicates Line Grayscale stability of pixels in the neighborhood of column pixels; Indicates Line The first pixel of the column The gray value of the neighboring pixels, Indicates Line The grayscale average value of the pixels in the neighborhood corresponding to the column pixels. Indicates Line The gray value extremes of the corresponding neighboring pixels of the column pixel points; Represents the total number of pixels in the neighborhood.

[0011] Calculate the difference between the grayscale values ​​of different neighborhood pixels and the average grayscale value of the neighborhood pixels, and reflect the grayscale stability of the pixels in the neighborhood through the size of the difference. The smaller the change in the grayscale value of each pixel in the neighborhood, the more stable the change in the grayscale value of the pixel in the area, and the less likely the pixel in the neighborhood is noise.

[0012] Optionally, the step of calculating the noise possibility includes: dividing the approximate point region according to the gradient value of the pixel point in the grayscale image; calculating the regional gradient smoothness based on the gradient of the pixel point in the approximate point region; and calculating the noise possibility based on the regional gradient smoothness; wherein the calculation formula of the noise possibility is:

[0013] ; Where: Indicates the image Line The noise probability of the column pixel, Indicates Line The number of pixels contained in the approximate point area where the column pixel is located. Indicates the total number of pixel rows contained in the image; Indicates the total number of pixel columns contained in the image; Indicates the number of approximate point regions; Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The gradient smoothness of the pixel column.

[0014] The grayscale image is divided into multiple approximate point regions according to the gradient. The gradients of the pixels in the approximate point regions are similar. Noise points are mostly characterized by drastic and random gradient changes. Therefore, the more pixels there are in the approximate point region, the lower the possibility of noise in the pixels in the approximate point region.

[0015] Optionally, the step of calculating the noise possibility includes: dividing the approximate point region according to the gradient value of the pixel point in the grayscale image; calculating the regional gradient smoothness based on the gradient of the pixel point in the approximate point region; and calculating the noise possibility based on the regional gradient smoothness; wherein the calculation formula of the noise possibility is:

[0016] ; Where: Indicates the image Line The noise probability of the column pixel, Indicates Line The number of pixels contained in the approximate point area where the column pixel is located. represents the maximum value function, Represents the number of pixels in the approximate point area, Represents the standard deviation of the number of pixels in all approximate point areas; Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The regional gradient smoothness of the pixel column.

[0017] The more pixels there are in the approximate point area, the lower the noise possibility of the pixels in the approximate point area. By comparing the number of pixels in any approximate point area with the number of pixels in the approximate point area with the most pixels, the noise possibility of the pixels in the current approximate point area is reflected.

[0018] Optionally, the calculation formula for regional gradient smoothness is:

[0019] ; Where: Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The regional gradient stability of the column pixels; Indicates the image Line The gradient value of the column pixel, represents the maximum value of the gradient, Indicates the image Line The pixel point in the column is located in the approximate point area. The gradient value of a pixel, Indicates Line The gradient of the area where the column pixels are located is extremely bad.

[0020] The difference between the pixel and other pixels in the same approximate point area is calculated and accumulated to obtain the overall gradient fluctuation in the approximate point area. The smaller the gradient fluctuation in the area, the more gradual the gradient change of other pixels in the approximate point area relative to the pixel, and the less likely the pixel is to be noisy.

[0021] Optionally, the method of dividing the approximate point region is a region growing method.

[0022] Optionally, a confidence threshold is set, and in response to the confidence of a neighborhood pixel being lower than the confidence threshold, the label value of the neighborhood pixel is changed.

[0023] In a second aspect, the present application provides a drilling tool surface quality detection system, which adopts the following technical solution:

[0024] A drilling tool surface quality detection system comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a drilling tool surface quality detection method as described above is implemented.

[0025] The above-mentioned drilling tool surface quality detection method is generated into a computer program and stored in a memory so as to be loaded and executed by a processor. Thus, a system is made based on the memory and the processor for easy use.

[0026] This application has the following technical effects:

[0027] In the process of LBP feature value extraction, the confidence of the neighborhood pixels is calculated through the gradient value and grayscale value of the pixel points. According to the confidence of the neighborhood pixels, the label value of the neighborhood pixels is adjusted, and the label value of the neighborhood pixels with lower confidence is reversed, thereby improving the accuracy of LBP feature value extraction, reducing the interference of noise on LBP extraction, and thus improving the accuracy of subsequent drilling tool surface detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a method flow chart of a method for detecting surface quality of a drill tool according to an embodiment of the present application.

[0029] Figure 2 This is a method flow chart of step S1 of a method for detecting surface quality of drilling tools in an embodiment of the present application.

[0030] Figure 3 This is a method flow chart of step S12 of a method for detecting surface quality of drilling tools in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The embodiment of the present application discloses a method for detecting the surface quality of a drilling tool, which obtains a grayscale image of the drilling tool, calculates the noise probability of each pixel in the grayscale image, and then calculates the confidence of each pixel according to the noise probability. In the process of extracting the LBP feature of the pixel point, the LBP feature value of the pixel point is adjusted by the confidence corresponding to the neighboring pixel, thereby reducing the influence of noise on the extraction of the LBP feature value, improving the accuracy of subsequent feature extraction, and the accuracy of drilling tool detection.

[0032] Specifically, refer to Figure 1 , the drilling tool surface quality detection method includes steps S1 to S5;

[0033] S1: Calculate the confidence of the neighboring pixels of each pixel in the grayscale image of the drilling tool;

[0034] Reference Figure 2 ; Step S1 includes steps S11 to S13;

[0035] S11: Image acquisition;

[0036] The surface image of the drilling tool is captured by an image acquisition device, and the surface image is gray-scaled to obtain a gray-scale image of the drilling tool.

[0037] S12: Calculating the noise possibility of the pixel point based on the gray value of the pixel point in the surface image;

[0038] Reference Figure 3 , step S12 includes steps S121 to S123;

[0039] S121: Divide the approximate point area according to the gradient value of the pixel point in the grayscale image;

[0040] Randomly select a pixel point in the grayscale image as a seed point for region growing or the first approximate point region; then randomly select a seed point outside the approximate point region for region growing to form a second approximate point region. Repeat the above steps until all the pixels in the grayscale image are segmented into the approximate point region.

[0041] In the process of region growing, starting from the seed point, pixels with similar gradients are gradually merged. The more pixels in the same region, the higher the gradient consistency of the pixels in the region, and the lower the possibility that the pixels in the region are noise.

[0042] S122: Calculating the regional gradient smoothness based on the gradient of the pixel points in the approximate point area;

[0043] After dividing the approximate point area, each pixel is located in the approximate point area, and the regional gradient stability of the pixel is calculated according to the changes between the gradient values ​​of each pixel in the approximate point area.

[0044] In one embodiment, the calculation formula of regional gradient smoothness is:

[0045] ;

[0046] Where: Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The gradient smoothness of the column pixels; Indicates the image Line The gradient value of the column pixel, represents the maximum value of the gradient, Indicates the image Line The pixel point in the column is located in the approximate point area. The gradient value of a pixel, Indicates Line The gradient of the area where the column pixels are located is extremely bad.

[0047] In the formula Indicates Line The gradient difference between the column pixel and other pixels in the same approximate point area; By comparing the above gradient difference with the extreme value of the gradient of the pixel point in the region, the gradient difference is normalized; at the same time, the normalized value is guaranteed to be positive through square calculation. Line The difference between the pixels in the first column is accumulated to reflect the overall gradient of the pixels in the area relative to the Line The greater the change, the greater the change in the gradient of the pixels in the area relative to the Line The greater the gradient fluctuation of the column pixels.

[0048] In another embodiment, the calculation formula of regional gradient smoothness is:

[0049] ;

[0050] Where: Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The gradient smoothness of the column pixels; Indicates the image Line The gradient value of the column pixel, represents the maximum value of the gradient, Indicates the image Line The pixel point in the column is located in the approximate point area. The gradient value of a pixel, Indicates Line The gradient extreme of the approximate area where the column pixel points are located.

[0051] In this formula, absolute value calculation is used to ensure that The calculation result is a positive value, the calculation is simpler and faster, and the workload of image processing is reduced.

[0052] S123: Calculate noise probability based on regional gradient stability;

[0053] In one embodiment, the calculation formula for pixel noise probability is: ; Indicates the image Line The noise probability of the column pixel, Indicates Line The number of pixels contained in the approximate point area where the column pixel is located. Indicates the total number of pixel rows contained in the image; Indicates the total number of pixel columns contained in the image. Indicates the number of approximate point regions; Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The regional gradient smoothness of the pixel column.

[0054] in the formula The part represents the average number of pixels in each area. For the Line The number of pixels in the approximate point area where the column pixel point is located. The more pixels there are in the approximate point area, the lower the possibility that the pixels in the approximate point area belong to noise. The smaller the value of , the less likely the noise is.

[0055] In another embodiment, the calculation formula of the pixel noise probability is:

[0056] ; Where: Indicates the image Line The noise probability of the column pixel, Indicates Line The number of pixels contained in the approximate point area where the column pixel is located. represents the maximum value function, Indicates the number of pixels in the approximate point area with the most pixels, Represents the standard deviation of the number of pixels in all approximate point areas; Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The regional gradient smoothness of the pixel column.

[0057] in the formula Indicates Line The difference between the number of pixels in the approximate point area where the pixel in the column is located and the number of pixels in the approximate point area with the most pixels in the image. This difference is compared with the standard deviation of the number of pixels in all approximate point areas, reflecting the Line The relative number of pixels in the approximate point area corresponding to the pixel points in the column; the smaller the value, the Line The more pixels there are in the approximate point area corresponding to the column pixel points, the smaller the possibility of noise.

[0058] S13: Calculate the confidence of the neighboring pixel points based on the noise possibility of the neighboring pixel points and the stationarity of the grayscale value of the neighboring pixel points;

[0059] Step S13 includes step S131-step S132;

[0060] S131: Calculate the stability of the grayscale value of the pixel in the neighborhood of the pixel;

[0061] In one embodiment, the calculation formula for the stability of the grayscale value of the neighborhood pixel is:

[0062] ;

[0063] Where: Indicates Line Grayscale stability of pixels in the neighborhood of column pixels; Indicates Line The first pixel of the column The gray value of the neighboring pixels, Indicates Line The grayscale average value of the pixels in the neighborhood corresponding to the column pixels. Indicates Line The gray value extremes of the corresponding neighboring pixels of the column pixel points; Represents the total number of pixels in the neighborhood.

[0064] in the formula Partially indicates Line The first pixel of the column The difference between the gray value of a neighborhood pixel and the average gray value of all pixels in the neighborhood; if the two are close, it means that the area is an area with uniform gray value changes, and the possibility that the pixel corresponding to the neighborhood is noise is small. Used to normalize differences. It is used to keep the gray value difference and the stationarity of the gray value of the neighborhood pixels in a negative correlation relationship, that is, the smaller the difference between the gray value of the pixels in the neighborhood and the average gray value of the pixels in the neighborhood, the higher the stationarity in the area.

[0065] In another embodiment, the calculation formula for the stability of the grayscale value of the neighborhood pixel is:

[0066] ; Where: Indicates Line Grayscale stability of pixels in the neighborhood of column pixels; Indicates Line The first pixel of the column The gray value of the neighboring pixels, Indicates Line The grayscale average value of the pixels in the neighborhood corresponding to the column pixels. Indicates Line The gray value extremes of the corresponding neighboring pixels of the column pixel points; Represents the total number of pixels in the neighborhood.

[0067] S132: Calculate pixel confidence;

[0068] The confidence calculation formula is:

[0069] ;

[0070] Where: Represents the grayscale image Line The first pixel of the column The confidence of the neighboring pixels, Represents the grayscale image Line The first pixel of the column The noise probability of the neighboring pixels is Indicates Line The gray value of the pixel. Indicates Line The first pixel of the column The gray value of the neighboring pixels, Indicates Line Grayscale stability of pixels in the neighborhood of column pixels; Represents an exponential function with a natural constant as its base.

[0071] In the formula, Indicates the center pixel and the The absolute value of the difference between the pixels. The larger the value, the more drastic the gray value change, so the lower the confidence. The confidence is calculated by combining the possibility that the central pixel is a noise point and the stability of the gray value in the neighborhood to improve the accuracy of the confidence.

[0072] S2: According to the confidence of the neighboring pixels, the marking value of the neighboring pixels is adjusted to obtain the optimal marking value;

[0073] Take any pixel as the central pixel, and the pixels in the neighborhood corresponding to the central pixel as the neighborhood pixels. Get the grayscale values ​​of the central pixel and the neighborhood pixels, and compare the grayscale values ​​of the neighborhood pixels with the grayscale value of the central pixel. Set a mark value for the neighborhood pixels based on the comparison result. For example, the neighborhood pixels with grayscale values ​​greater than or equal to the central pixel are marked as 1, and the neighborhood pixels with grayscale values ​​less than the central pixel are marked as 0.

[0074] S3: Calculate the optimal feature value of the central pixel based on the optimal label value, and extract features of the grayscale image based on the optimal feature value to determine the surface state of the drilling tool;

[0075] Use the box plot algorithm to obtain the minimum confidence threshold, and set the threshold as the confidence threshold. When the confidence of the neighborhood pixel is less than the confidence threshold, reverse the mark value of the neighborhood pixel. For example, set the confidence threshold to 0.1. When the confidence of the neighborhood pixel is less than 0.1, reverse the mark value. Specifically, if the mark value is 1, adjust the mark value to 0, and if the mark value is 0, adjust the mark value to 1.

[0076] After the mark value of the neighborhood pixel is adjusted, the feature extraction of each pixel in the image is performed according to the adjusted LBP value, and the abnormal feature values ​​in the feature values ​​of all pixels are extracted through the neural network, and the pixels corresponding to these abnormal feature values ​​are obtained and marked as abnormal pixels. If the number of abnormal pixels in the image accounts for less than 1% of the total number of pixels, it is considered that there are defects on the surface of the drilling tool, and it is necessary to notify the staff to implement manual processing.

[0077] An embodiment of the present application further discloses a drilling tool surface quality detection system, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a drilling tool surface quality detection method according to the present application is implemented.

[0078] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0079] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for detecting the surface quality of a drilling tool, characterized in that: The method comprises the following steps: calculating the confidence of the neighboring pixel points of each pixel point in the grayscale image of the drilling tool; adjusting the labeling value of the neighboring pixel points according to the confidence of the neighboring pixel points to obtain the optimal labeling value; calculating the optimal characteristic value of the central pixel point based on the optimal labeling value, and extracting the features of the grayscale image based on the optimal characteristic value to judge the surface state of the drilling tool; the calculation formula of the confidence is: ; Where: Represents the grayscale image Line The first pixel of the column The confidence of the neighboring pixels, Represents the grayscale image Line The first pixel of the column The noise probability of the neighboring pixels is Indicates Line The gray value of the pixel. Indicates Line The first pixel of the column The gray value of the neighboring pixels, represents an exponential function with a natural constant as base; Indicates Line The grayscale stability of the pixel points in the neighborhood of the column pixel point is calculated as: ; Where: Indicates Line The grayscale average value of the pixels in the neighborhood corresponding to the column pixels. Indicates Line The gray value extremes of the corresponding neighboring pixels of the column pixel points; Represents the total number of pixels in the neighborhood; The steps to calculate the noise probability include: Divide the approximate point area according to the gradient value of the pixel point in the grayscale image; Based on the gradient of the pixel points in the approximate point area, calculate the regional gradient stability: ; Where: Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The regional gradient stability of the column pixels; Indicates the image Line The gradient value of the column pixel, represents the maximum value of the gradient, Indicates the image Line The pixel point in the approximate point area is The gradient value of a pixel, Indicates Line The gradient of the area where the column pixel points are located is extremely poor; Compute the noise likelihood based on the regional gradient stationarity.

2. A drilling tool surface quality detection method according to claim 1, characterized in that: The noise probability is calculated as: ; Where: Indicates the image Line The noise probability of the column pixel, Indicates Line The number of pixels contained in the approximate point area where the column pixel is located. Indicates the total number of pixel rows contained in the image; Indicates the total number of pixel columns contained in the image; Indicates the number of approximate point regions; Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The gradient smoothness of the pixel column.

3. A drilling tool surface quality detection method according to claim 1, characterized in that: The calculation steps of the noise possibility include: dividing the approximate point region according to the gradient value of the pixel point in the grayscale image; calculating the regional gradient stability based on the gradient of the pixel point in the approximate point region; calculating the noise possibility based on the regional gradient stability; wherein the calculation formula of the noise possibility is: ; Where: Indicates the image Line The noise probability of the column pixel, Indicates Line The number of pixels contained in the approximate point area where the column pixel is located. represents the maximum value function, Represents the number of pixels in the approximate point area, Represents the standard deviation of the number of pixels in all approximate point areas; Indicates Line The approximate point area corresponding to the pixel point in the first column is Line The regional gradient smoothness of the pixel column.

4. A drilling tool surface quality detection method according to claim 3, characterized in that: The method of dividing the approximate point region is the region growing method.

5. A drilling tool surface quality detection method according to claim 1, characterized in that: The step of adjusting the label value of the neighborhood pixel includes: setting a confidence threshold, and in response to the confidence of the neighborhood pixel being lower than the confidence threshold, changing the label value of the neighborhood pixel.

6. A drilling tool surface quality detection system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for detecting surface quality of a drilling tool according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • A Smart Monitoring Method and System for Wire Rope Surface Damage Based on LBP Features

    CN109859170B

  • Image restoration area positioning method and device, and storage medium

    CN114693913A

  • Metal defect identification method

    CN115049669A