A hydraulic oil contamination detection method based on image processing

By calculating the grayscale and gradient values of pixel points in hydraulic oil pollution detection, using DBSCAN clustering algorithm and angle mutation edge pixel points, the circularity of the closed area is corrected, and the accuracy of hydraulic oil pollution detection is solved, achieving more efficient pollution assessment and response.

CN120318239BActive Publication Date: 2025-08-12SHAANXI DONGZERUI TECH DEV CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510813615.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-08-12
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

In the existing hydraulic oil pollution detection methods, the grayscale difference between the micro solid particles and the background area is small, resulting in misjudgment of the threshold segmentation algorithm, reducing the accuracy of hydraulic oil pollution detection.

Method used

By obtaining hydraulic putty grayscale images, calculating the grayscale values and gradient values of pixel points, using DBSCAN clustering algorithm to process edge pixel points, combining angle mutation edge pixel points, correcting the circularity of the closed area, and determining the degree of static pollution of hydraulic oil.

Benefits of technology

It improves the accuracy of hydraulic oil pollution detection, can evaluate the degree of pollution based on particle distribution and roundness, set pollution thresholds of different levels, and improves the response efficiency of staff.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318239B_ABST
    Figure CN120318239B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image data processing technology, and more specifically, to a method for detecting hydraulic oil contamination based on image processing, the method comprising: obtaining edge pixel points of solid particles in a hydraulic oil grayscale image; processing the edge pixel points based on a clustering algorithm to obtain a closed area and a corresponding area in the hydraulic oil grayscale image, and calculating the density of the closed area; determining an angle mutation edge pixel point based on an angle change between the edge pixel point and adjacent edge pixel points on both sides of the edge pixel point; correcting the circularity of the closed area based on the number of edge pixel points and the number of angle mutation edge pixel points in the closed area to obtain the near-circularity of the closed area; determining the static contamination degree of the hydraulic oil grayscale image based on the density and near-circularity of the closed area to obtain a hydraulic oil contamination detection result, thereby effectively improving the accuracy of the hydraulic oil contamination detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and more particularly to a method for detecting hydraulic oil contamination based on image processing. Background Art

[0002] During the operation of the hydraulic system, external contaminants may invade the system through the oil tank vent, refueling port, reciprocating piston rod, oil injected into the system, air flowing in the oil tank, and oil leakage returning to the oil tank, resulting in the presence of particulate contaminants in the hydraulic oil. This will lead to a decrease in the lubrication ability of the equipment, wear of equipment components, reduced actual production efficiency, and even cause failure of the hydraulic equipment.

[0003] An oil particle size detector is a device used for real-time monitoring and analysis of particulate contaminants in hydraulic fluids and other fluids. It uses a metallographic microscope or other optical imaging system to amplify particle images, improving image resolution and clarity to accurately capture particle details. When using an oil particle size detector to obtain hydraulic oil contamination detection results, a threshold segmentation algorithm from image processing technology is used to separate solid particles from the oil.

[0004] However, in hydraulic oil images captured by an oil particle size detector, some tiny solid particles have minimal grayscale differences from the background, and the grayscale changes at their edges are not noticeable. When using threshold segmentation to separate solid particles in the oil, these particles may be misidentified as background, resulting in low accuracy in the hydraulic oil contamination detection results.

[0005] In summary, in the process of determining the hydraulic oil contamination detection results based on the oil particle size detector, it is urgent to solve the problem of how to accurately obtain the hydraulic oil contamination detection results based on various types of solid particles in the hydraulic oil image. Summary of the Invention

[0006] To solve the above-mentioned technical problem of how to accurately identify various types of solid particles in hydraulic oil images and thus accurately obtain hydraulic oil contamination detection results, the present invention proposes a hydraulic oil contamination detection method based on image processing, which includes the following steps:

[0007] Obtain the grayscale image of hydraulic oil, obtain the grayscale image of hydraulic oil, calculate the probability that each pixel is the edge of solid particles according to the grayscale value and gradient value of the pixel point, and determine the edge pixel point of the solid particle; process the edge pixel points based on the clustering algorithm to obtain the closed area and the corresponding area in the grayscale image of hydraulic oil, and calculate the first The density of closed areas :

[0008] ;

[0009] For the The area of a closed region, is the maximum area of the closed region in the hydraulic oil grayscale image, For the The mean Euclidean distance between a closed area and other closed areas, is the maximum Euclidean distance between closed areas in the hydraulic oil grayscale image, is an exponential function with base e, is the preset weight coefficient, is the absolute value symbol; the angle mutation edge pixel point is determined according to the angle change between the edge pixel point and the adjacent edge pixel points on both sides; the circularity of the closed area is corrected based on the number of edge pixels and the number of angle mutation edge pixels in the closed area to obtain the near-circularity of the closed area; the static contamination degree of the hydraulic oil grayscale image is determined according to the density and near-circularity of the closed area to obtain the hydraulic oil contamination detection result.

[0010] The present invention can accurately evaluate the static contamination level of the hydraulic oil grayscale image by analyzing the solid particle areas present in the hydraulic oil grayscale image. When analyzing the solid particle areas in the hydraulic oil grayscale image, the present invention takes into account that the contamination of the hydraulic oil by solid particles is determined by their distribution and circularity. The contamination of the hydraulic oil by each solid particle area cannot be accurately evaluated based solely on the area of the solid particles. Therefore, the present invention analyzes the distribution by analyzing the area of the closed area and the distance between the closed areas, and analyzes the circularity by circularity, so as to accurately obtain the contamination level of each closed area on the hydraulic oil. In the process of obtaining the circularity, the present invention takes into account that the overlap of some solid particles will affect their circularity, and the angular change of the edge pixel points can reflect the smoothness of the edge of the closed area. Therefore, the present invention analyzes the protrusion level by obtaining the number of edge pixel points with sudden angle changes in the closed area to achieve the correction of the circularity, thereby effectively improving the accuracy of the static contamination level of the obtained hydraulic oil grayscale image.

[0011] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the obtaining of the hydraulic oil grayscale image further includes: collecting a microscopic image of the hydraulic oil and performing preprocessing to obtain the hydraulic oil grayscale image.

[0012] Taking into account the problems of noise and unclear edges in the original microscopic images of hydraulic oil, the present invention provides a preprocessing method to effectively avoid the influence of other factors on the detection results by improving the quality of the collected original microscopic images.

[0013] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the probability of each pixel point being the edge of a solid particle is calculated based on the grayscale value and gradient value of the pixel point to determine the edge pixel point of the solid particle, including: if the probability of the pixel point being the edge of a solid particle is greater than a probability threshold, then the pixel point is an edge pixel point of the solid particle.

[0014] According to a method for detecting hydraulic oil contamination based on image processing provided by the present invention, the method of calculating the probability that each pixel point is an edge of a solid particle includes:

[0015] ;

[0016] is the probability that the i-th pixel is the edge of a solid particle, 、 are the grayscale value and gradient value of the i-th pixel respectively, 、 are the maximum grayscale value and maximum gradient value in the hydraulic oil grayscale image, respectively. 、 are grayscale weight and gradient weight respectively, is the absolute value symbol, is an exponential function with base e.

[0017] The present invention takes into account that the area of some solid particle regions is small and their edges cannot be accurately extracted by conventional edge detection algorithms. Therefore, the present invention provides a precise method for calculating the probability that a pixel point is a solid particle edge. By analyzing the grayscale and gradient differences between the pixel point and the hydraulic oil background area, the possibility of each pixel point being a solid particle edge can be accurately evaluated.

[0018] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the edge pixel points are processed based on a clustering algorithm to obtain closed areas and corresponding areas in the hydraulic oil grayscale image, including: using the DBSCAN clustering algorithm to process the edge pixel points in the hydraulic oil grayscale image to obtain each closed area, and taking the number of all pixels in the closed area as the area of the closed area.

[0019] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the angle mutation edge pixel point is determined according to the angle change between the edge pixel point and the adjacent edge pixel points on both sides, including: respectively obtaining the vectors from the edge pixel point to the adjacent edge pixel points on both sides, inputting the ratio of the dot product of the vectors from the edge pixel point to the adjacent edge pixel points on both sides to the modulus of the vector into the inverse cosine function, and finally normalizing to obtain the angle of the edge pixel point; if the angle of the edge pixel point is greater than or equal to the angle threshold, the edge pixel is an angle mutation edge pixel point.

[0020] According to a method for detecting hydraulic oil contamination based on image processing provided by the present invention, the circularity of the closed area is corrected based on the number of edge pixels and the number of edge pixels with sudden angle changes in the closed area to obtain the near-circularity of the closed area, including:

[0021] ;

[0022] For the The degree of circularity of a closed region, 、 Respectively The number of edge pixels with angle mutations and the number of edge pixels in a closed area, For the The area of a closed region, For the The circularity of a closed area, is an exponential function with base e.

[0023] The present invention takes into account that the edges of closed areas that are close to a circle are relatively smooth and the number of edge pixels with sudden angle changes is relatively small, while the edges of irregular closed areas are relatively convex and the number of edge pixels with sudden angle changes is relatively large. Therefore, the present invention provides an accurate method for calculating the near-circularity of a closed area. By obtaining the proportion of edge pixels with sudden angle changes in the closed area and correcting the circularity of the closed area, the near-circularity of each closed area can be accurately obtained.

[0024] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the static contamination degree of the hydraulic oil grayscale image is determined based on the density and near-circularity of the closed area, including: normalizing the difference between the density and near-circularity of the closed area to obtain the contamination degree of the closed area; and taking the average of the contamination degrees of all closed areas in the hydraulic oil grayscale image as the static contamination degree of the hydraulic oil grayscale image.

[0025] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the static contamination degree of the hydraulic oil grayscale image is determined according to the density and near-circularity of the closed area to obtain the hydraulic oil contamination detection result, including: setting different levels of contamination thresholds for the static contamination degree of the hydraulic oil grayscale image, and obtaining different levels of hydraulic oil contamination detection results according to the comparison result of the static contamination degree of the hydraulic oil grayscale image and the contamination threshold.

[0026] This invention takes into account that different levels of hydraulic oil contamination detection results require different levels of treatment. For example, severe contamination requires comprehensive cleaning, while mild contamination only requires enhanced preventive measures. Therefore, different levels of contamination thresholds are set to classify hydraulic oil contamination detection results into different levels, improving the efficiency of personnel's response to hydraulic oil contamination.

[0027] According to a hydraulic oil contamination detection method based on image processing provided by the present invention, the hydraulic oil contamination detection result is obtained, and then the method further includes: setting corresponding early warning methods according to different levels of hydraulic oil contamination detection results, and marking closed areas in the hydraulic oil grayscale image.

[0028] The present invention has the following beneficial effects:

[0029] Based on the above technical solution, the present invention provides an image processing-based hydraulic oil contamination detection method. When obtaining hydraulic oil contamination detection results, the static contamination level of the hydraulic oil grayscale image can be accurately assessed by analyzing the solid particle areas present in the hydraulic oil grayscale image. When analyzing the solid particle areas in the hydraulic oil grayscale image, the present invention considers that the contamination of hydraulic oil by solid particles is determined by their distribution and circularity. The area of the solid particles alone cannot accurately assess the contamination of hydraulic oil by each solid particle area. Therefore, the present invention analyzes the distribution by analyzing the area of closed regions and the distance between closed regions, and analyzes the circularity by analyzing the circularity, thereby accurately determining the contamination level of each closed region. When obtaining the circularity, the present invention considers that the overlap of some solid particles can affect their circularity, and that the angular variation of edge pixels can reflect the smoothness of the edges of closed regions. Therefore, the present invention analyzes the protrusion level by obtaining the number of edge pixels with sudden angle changes in the closed region to achieve circularity correction, effectively improving the accuracy of the static contamination level of the hydraulic oil grayscale image. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a flowchart of the steps of a hydraulic oil contamination detection method based on image processing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.

[0032] An embodiment of the present invention provides a hydraulic oil contamination detection method based on image processing, which can accurately obtain hydraulic oil contamination detection results by analyzing the dense features and circular features of various types of solid particles in the hydraulic oil image.

[0033] See also Figure 1 , Figure 1 : This is a flowchart of a method for detecting hydraulic oil contamination based on image processing provided by an embodiment of the present invention. The method includes the following steps:

[0034] S1: Acquire a grayscale image of the hydraulic oil.

[0035] For example, in an embodiment of the present invention, obtaining a hydraulic oil grayscale image includes: collecting a microscopic image of the hydraulic oil and performing preprocessing to obtain the hydraulic oil grayscale image.

[0036] When collecting and preprocessing microscopic images of hydraulic oil, an oil particle size detector can be used to photograph the hydraulic oil sample under a microscope to obtain a raw microscopic color image. This raw microscopic color image is converted to a grayscale image using a weighted average method to reduce subsequent computational complexity. An adaptive filter is used to remove random noise from the grayscale image, improving the signal-to-noise ratio. Adaptive histogram equalization is performed on the grayscale image to increase contrast. Sharpening techniques are used to enhance details in the grayscale image, ultimately resulting in a grayscale image of the hydraulic oil.

[0037] The specific steps of the above preprocessing method can be implemented by existing technologies and will not be described in detail in the embodiment of the present invention.

[0038] It should be noted that the above steps can generate a hydraulic oil grayscale image and each pixel in the hydraulic oil grayscale image. The distribution area of solid particles in the hydraulic oil grayscale image can reflect the degree of hydraulic oil contamination: the larger the area, the higher the degree of contamination. Therefore, embodiments of the present invention can obtain the area of solid particles in the hydraulic oil grayscale image to assess the degree of contamination, namely, perform the following steps.

[0039] S2: Determine the edge pixel points of the solid particles based on the grayscale value and gradient value of the pixel points; process the edge pixel points based on the clustering algorithm to obtain the closed region and the corresponding area in the hydraulic oil grayscale image.

[0040] It should be noted that solid particles in hydraulic oil grayscale images vary in size, and conventional edge detection algorithms cannot accurately identify the edges of smaller solid particles. Furthermore, there is a significant grayscale difference between solid particles and the oil background in the hydraulic oil grayscale image, with the grayscale of solid particles being smaller than that of the oil background. Furthermore, the gradient of the edge pixels of solid particles is significantly different from that of ordinary pixels in the hydraulic oil grayscale image, with the gradient of the edge pixels of solid particles generally being larger.

[0041] Therefore, the embodiment of the present invention can calculate the possibility that each pixel point is the edge of a solid particle based on the grayscale difference and gradient difference between the pixel point and the background area.

[0042] For example, in an embodiment of the present invention, the probability that each pixel is the edge of a solid particle is calculated based on the grayscale value and gradient value of the pixel. For details, see the following relationship:

[0043] ;

[0044] is the probability that the i-th pixel is the edge of a solid particle, is the grayscale value of the i-th pixel, is the gradient value of the i-th pixel, is the maximum grayscale value in the hydraulic oil grayscale image, is the maximum gradient value in the hydraulic oil grayscale image, is the grayscale weight, is the gradient weight, is the absolute value symbol, is an exponential function with base e.

[0045] It is understandable that compared with the gradient change of edge pixels, the gray value of solid particles in the hydraulic oil gray image is more different from the gray value of the background. Therefore, in the embodiment of the present invention, and When As an example, you can Set to 0.6, Set it to 0.4 and adjust it according to actual needs.

[0046] In the above formula, It is the normalized grayscale difference between the grayscale value of the i-th pixel and the maximum grayscale value in the hydraulic oil grayscale image, and the difference value is normalized between 0 and 1. The larger the value, the more likely the i-th pixel is to be in a solid particle area with lower grayscale.

[0047] is the normalized gradient difference between the gradient value of the i-th pixel and the maximum gradient value in the hydraulic oil gradient image, and the difference value is normalized between 0 and 1. The smaller the value, the closer the gradient value of the i-th pixel is to the maximum gradient value in the hydraulic oil gradient image, and the more likely it is to be at the edge of the solid particle area.

[0048] In summary, the greater the difference between the grayscale value of the pixel point and the maximum grayscale value in the hydraulic oil grayscale image, and the closer the gradient value is to the maximum gradient value in the hydraulic oil grayscale image, the more the grayscale and gradient characteristics of the pixel point conform to the characteristics of the edge of the solid particle area, and the greater the possibility that it is the edge of the solid particle area.

[0049] For example, in an embodiment of the present invention, the edge pixel point of a solid particle is determined based on the grayscale value and gradient value of the pixel point, including: if the probability that the pixel point is the edge of a solid particle is greater than a probability threshold, then the pixel point is the edge pixel point of the solid particle.

[0050] The probability threshold may be set to 0.6. The probability threshold may be set according to actual needs, and the embodiment of the present invention does not impose any additional restrictions thereon.

[0051] It can be understood that if the probability that a pixel point is a solid particle edge is not greater than the probability threshold, it means that its grayscale characteristics and gradient characteristics do not conform to the characteristics of a solid particle edge.

[0052] After all solid particle edge pixel points are obtained based on the above steps, closed solid particle regions in the hydraulic oil grayscale image can be obtained based on the solid particle edge pixel points.

[0053] For example, in an embodiment of the present invention, edge pixel points are processed based on a clustering algorithm to obtain closed areas and corresponding areas in the hydraulic oil grayscale image, including: using the DBSCAN clustering algorithm to process edge pixel points in the hydraulic oil grayscale image to obtain each closed area, and taking the number of all pixels in the closed area as the area of the closed area.

[0054] Specifically, when using the DBSCAN clustering algorithm to process edge pixels in the hydraulic oil grayscale image to obtain closed areas, the neighborhood radius and the minimum number of points of the edge pixel points can be set according to the resolution of the hydraulic oil grayscale image; if the number of pixels within the neighborhood radius of the edge pixel point is at least the minimum number of points, then the edge pixel point is a core pixel point; the core pixel point and the pixels with reachable density are added to a cluster centered on the core pixel point, and the above process is repeated to access all core pixels, and finally multiple clusters are obtained, each cluster is a closed solid particle area, that is, a closed area.

[0055] Based on the above steps, closed regions in the hydraulic oil grayscale image can be accurately obtained. By analyzing the area corresponding to the closed regions, the degree of contamination of the hydraulic oil grayscale image can be assessed. However, the distribution and roundness of the solid particles in the hydraulic oil grayscale image also affect the degree of contamination. Assessing the degree of contamination based solely on the area corresponding to the closed regions has limitations. Therefore, when determining the degree of contamination in the hydraulic oil grayscale image, embodiments of the present invention require not only the area of the solid particle region but also its specific distribution and roundness, i.e., performing the following steps.

[0056] S3: Calculate the density of the closed areas based on the area of the closed areas and the Euclidean distance between the closed areas.

[0057] It's important to note that when solid particles are evenly distributed in the oil, while the overall particle area remains constant, the particle concentration within each local area is relatively low and stable. This means that the probability of particle-to-particle interaction and contact with equipment components is relatively uniform, resulting in relatively uniform and gradual wear and tear on the equipment. This, to a certain extent, reduces the risk of severe local wear or failure, and maintains a relatively low level of contamination.

[0058] Based on this, the embodiment of the present invention can obtain the area of the closed areas and the Euclidean distance between the closed areas to determine the density of each closed area, thereby evaluating the impact of its distribution on the pollution level.

[0059] Among them, when obtaining the Euclidean distance between closed areas, the Euclidean distance between the center pixels of the closed areas can be used as the Euclidean distance between the closed areas. The step of obtaining the Euclidean distance can be obtained by the existing Euclidean distance formula and will not be repeated here.

[0060] For example, in an embodiment of the present invention, the density of the closed area is calculated, and the details can be referred to the following relationship:

[0061] ;

[0062] For the The density of the closed area, For the The area of a closed region, is the maximum area of the closed region in the hydraulic oil grayscale image, For the The mean Euclidean distance between a closed area and other closed areas, is the maximum Euclidean distance between closed areas in the hydraulic oil grayscale image, is an exponential function with base e, is the preset weight coefficient, is the absolute value symbol.

[0063] In the above formula, It is The normalized difference between the area of the first closed region and the maximum area of the closed region in the hydraulic oil grayscale image. The smaller the value, the smaller the The closer the area of a closed region is to the maximum area of the closed region in the hydraulic oil grayscale image.

[0064] It is The normalized value of the mean Euclidean distance between a closed area and other closed areas. The larger the value, the closer the The larger the Euclidean distance between a closed area and other closed areas, the more discrete the distribution.

[0065] In summary, if the difference between the area of a closed region and the maximum area is smaller and the Euclidean distance between the closed region and other closed regions is smaller, it means that the density of the closed region is higher.

[0066] S4: Determine an angle mutation edge pixel point based on the angle change between the edge pixel point and the adjacent edge pixel points on both sides; correct the circularity of the closed area based on the number of edge pixels and the number of angle mutation edge pixels in the closed area to obtain the near-circularity of the closed area.

[0067] It's important to note that in a grayscale image of hydraulic oil, spherical particles have a relatively smooth surface. As they move through the oil, their contact area with the surface of equipment components is small and their contact pattern is gentle. Given the same particle area, spherical particles cause less damage to equipment and contribute to a lower degree of contamination. Irregularly shaped particles, on the other hand, typically have sharp edges and complex surface structures. These edges easily embed into the surface of equipment components during oil flow, exacerbating wear. Furthermore, irregular particles have a relatively large contact area and points with the surface of equipment, causing greater friction and wear. They can also scratch critical components like seals, leading to oil leaks and other problems, thus increasing the degree of contamination.

[0068] Based on this, the embodiment of the present invention can obtain the degree to which each closed area is close to a circle to evaluate the degree of pollution it causes, and some solid particle areas will overlap, which will appear in morphology as part of the edge of the solid particle area is a circle, and the remaining part is a convex circle, that is, the two circles overlap to obtain an approximate ellipse. Therefore, when analyzing the circularity of a closed area, it is necessary to analyze the degree to which its morphology is close to a circle based on the angle change of its edge pixel points.

[0069] For example, in an embodiment of the present invention, an angle-mutation edge pixel point is determined based on the angle change between the edge pixel point and the adjacent edge pixel points on both sides, including: respectively obtaining vectors from the edge pixel point to the adjacent edge pixel points on both sides, inputting the ratio of the dot product of the vectors from the edge pixel point to the adjacent edge pixel points on both sides to the modulus of the vector into an inverse cosine function, and finally normalizing to obtain the angle of the edge pixel point; if the angle of the edge pixel point is greater than or equal to the angle threshold, then the edge pixel is an angle-mutation edge pixel point.

[0070] The angle threshold may be set to 30°; the angle threshold may be set according to actual needs.

[0071] It can be understood that edge pixels with sudden angle changes are those with large angle changes on the edge of a closed area. Pixels at the edges of circular particles are relatively smooth and have small angle changes. Sharp corners on the edges will result in large angle changes at the edge pixels of the particles.

[0072] Based on the above steps, the angle mutation edge pixel points in each closed area edge pixel point can be obtained.

[0073] For example, in an embodiment of the present invention, the circularity of the closed area is corrected based on the number of edge pixels and the number of edge pixels with sudden angle changes in the closed area to obtain the near-circularity of the closed area, including:

[0074] ;

[0075] For the The degree of circularity of a closed region, For the The angle mutation edge pixel points in the closed area, For the The number of edge pixels in a closed area, For the The area of a closed region, is an exponential function with base e, is pi.

[0076] in, For the The circularity of a closed area. The number of edge pixels in a closed area is The perimeter of a closed area.

[0077] In the above formula, Indicates the The convexity of the closed area, the larger the value, the The more edge pixels with mutations in a closed area, the greater the protrusion. The convexity of a closed area can be used to correct its circularity, so as to accurately obtain the first The higher the degree of circularity, the less likely the closed area is to cause pollution.

[0078] S5: Determine the static contamination degree of the hydraulic oil grayscale image according to the density and the near-circularity of the closed area to obtain the hydraulic oil contamination detection result.

[0079] According to the above steps S2 and S3, the density and circularity of the closed area can be obtained respectively. If the density of the closed area is higher and the circularity is lower, it means that the degree of pollution to the hydraulic oil is higher, which is likely to affect the equipment.

[0080] Therefore, the embodiment of the present invention determines the static contamination degree of the hydraulic oil grayscale image by the density and circularity of the closed area.

[0081] For example, in an embodiment of the present invention, the static contamination degree of the hydraulic oil grayscale image is determined based on the density and circularity of the closed area, including: normalizing the difference between the density and circularity of the closed area to obtain the contamination degree of the closed area; and taking the average contamination degree of all closed areas in the hydraulic oil grayscale image as the static contamination degree of the hydraulic oil grayscale image.

[0082] Among them, normalization can be achieved by The specific steps of the algorithm are implemented in detail in the embodiment of the present invention.

[0083] For example, in an embodiment of the present invention, the static contamination degree of the hydraulic oil grayscale image is determined based on the density and near-circularity of the closed area to obtain a hydraulic oil contamination detection result, including: setting different levels of pollution thresholds for the static contamination degree of the hydraulic oil grayscale image, obtaining different levels of hydraulic oil contamination detection results based on the comparison result of the static contamination degree of the hydraulic oil grayscale image and the pollution threshold, and setting corresponding early warning methods based on the different levels of hydraulic oil contamination detection results.

[0084] Specifically, when obtaining different levels of hydraulic oil contamination detection results based on the comparison results of the static contamination degree of the hydraulic oil grayscale image and the contamination threshold, threshold 1, threshold 2, and threshold 3 can be set to 0.7, 0.5, and 0.1, respectively. The comparison results of the static contamination degree of the hydraulic oil grayscale image and the contamination threshold specifically include the following possible situations:

[0085] In one possible case, the static contamination level of the hydraulic oil grayscale image is greater than a threshold value 1; in this case, the hydraulic oil detection result is severe contamination, and a level one alarm may be set.

[0086] In another possible scenario, the static contamination level of the hydraulic oil grayscale image is less than or equal to threshold 1 and greater than threshold 2; in this case, the hydraulic oil detection result is moderate contamination, and a level 2 alarm can be set.

[0087] In another possible scenario, the static contamination level of the hydraulic oil grayscale image is less than or equal to threshold 2 and greater than threshold 3; in this case, the hydraulic oil detection result is light contamination, and a level 3 alarm can be set.

[0088] In another possible scenario, the static contamination level of the hydraulic oil grayscale image is less than or equal to a threshold value of 3; in this case, the hydraulic oil detection result is clean, and no alarm may be set.

[0089] The priority of each level of alarm is: level 1 alarm is higher than level 2 alarm, and level 2 alarm is higher than level 3 alarm. The alarm method can be sound warning or signal light warning, and the specific alarm method can be set according to actual needs.

[0090] After obtaining the hydraulic oil contamination detection result based on the above steps, the embodiment of the present invention can also mark the particle area in the hydraulic oil detection result so that the staff can quickly locate the solid particle area in the hydraulic oil.

[0091] For example, in an embodiment of the present invention, after obtaining the hydraulic oil contamination detection result, the method further includes: marking the closed area in the hydraulic oil grayscale image.

[0092] The marking method may be grayscale highlighting of the solid particle area, color highlighting of the edge of the solid particle area, etc., which may be set according to actual needs and is not limited in this embodiment of the present invention.

[0093] It can be seen that in the embodiment of the present invention, when obtaining the hydraulic oil contamination detection result, a hydraulic oil grayscale image can be obtained, and the probability of each pixel being the edge of a solid particle is calculated based on the grayscale value and gradient value of the pixel point to determine the edge pixel point of the solid particle; the edge pixel point is processed based on the clustering algorithm to obtain the closed area in the hydraulic oil grayscale image and the corresponding area, and the first The density of closed areas :

[0094] ;

[0095] For the The area of a closed region, is the maximum area of the closed region in the hydraulic oil grayscale image, For the The mean Euclidean distance between a closed area and other closed areas, is the maximum Euclidean distance between closed areas in the hydraulic oil grayscale image, is an exponential function with base e, is the preset weight coefficient, is the absolute value symbol; the angle mutation edge pixel point is determined according to the angle change between the edge pixel point and the adjacent edge pixel points on both sides; the circularity of the closed area is corrected based on the number of edge pixels and the number of angle mutation edge pixels in the closed area to obtain the near-circularity of the closed area; the static contamination degree of the hydraulic oil grayscale image is determined according to the density and near-circularity of the closed area to obtain the hydraulic oil contamination detection result, which effectively improves the accuracy of hydraulic oil contamination detection.

[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting hydraulic oil contamination based on image processing, characterized in that: include: Obtain a grayscale image of the hydraulic oil, and calculate the probability that each pixel is the edge of a solid particle based on the grayscale value and gradient value of the pixel to determine the edge pixel of the solid particle; Based on the clustering algorithm to process the edge pixels, the closed area and the corresponding area in the hydraulic oil grayscale image are obtained, and the first The density of closed areas : ; For the The area of a closed region, is the maximum area of the closed region in the hydraulic oil grayscale image, For the The mean Euclidean distance between a closed area and other closed areas, is the maximum Euclidean distance between closed areas in the hydraulic oil grayscale image, is an exponential function with base e, is the preset weight coefficient, is the absolute value symbol; Determining an angle mutation edge pixel point based on an angle change between an edge pixel point and adjacent edge pixels on both sides thereof; and correcting the circularity of the closed area based on the number of edge pixels and the number of angle mutation edge pixels in the closed area to obtain the near-circularity of the closed area, including: ; For the The degree of circularity of a closed region, 、 Respectively The number of edge pixels with angle mutations and the number of edge pixels in a closed area, For the the circularity of a closed area; The static contamination degree of the hydraulic oil grayscale image is determined according to the density and near-circularity of the closed area to obtain the hydraulic oil contamination detection result.

2. The method for detecting hydraulic oil contamination based on image processing according to claim 1, characterized in that: The step of obtaining the hydraulic oil grayscale image further includes: The microscopic image of the hydraulic oil is collected and preprocessed to obtain a hydraulic oil grayscale image.

3. The method for detecting hydraulic oil contamination based on image processing according to claim 1, characterized in that: The method of calculating the probability that each pixel point is the edge of a solid particle according to the grayscale value and gradient value of the pixel point to determine the edge pixel point of the solid particle includes: If the probability that a pixel point is an edge of a solid particle is greater than a probability threshold, the pixel point is an edge pixel point of the solid particle.

4. The method for detecting hydraulic oil contamination based on image processing according to claim 3, characterized in that: The calculation of the probability that each pixel point is the edge of a solid particle includes: ; is the probability that the i-th pixel is the edge of a solid particle, 、 are the grayscale value and gradient value of the i-th pixel respectively, 、 are the maximum grayscale value and maximum gradient value in the hydraulic oil grayscale image, respectively. 、 are grayscale weight and gradient weight respectively, is the absolute value symbol, is an exponential function with base e.

5. The method for detecting hydraulic oil contamination based on image processing according to claim 1, characterized in that: The clustering algorithm is used to process edge pixels to obtain closed regions and corresponding areas in the hydraulic oil grayscale image, including: The DBSCAN clustering algorithm is used to process the edge pixels in the hydraulic oil grayscale image to obtain each closed region, and the number of all pixels in the closed region is taken as the area of the closed region.

6. The method for detecting hydraulic oil contamination based on image processing according to claim 1, characterized in that: The method of determining the edge pixel point with a sudden angle change according to the angle change between the edge pixel point and the adjacent edge pixel points on both sides thereof includes: Obtain the vectors from the edge pixel to its two adjacent edge pixels respectively, input the ratio of the dot product of the vectors from the edge pixel to its two adjacent edge pixels to the modulus of the vectors into the arccosine function, and finally normalize the result to obtain the angle of the edge pixel. If the angle of an edge pixel is greater than or equal to the angle threshold, the edge pixel is an angle mutation edge pixel.

7. The method for detecting hydraulic oil contamination based on image processing according to claim 1, characterized in that: Determining the static contamination degree of the hydraulic oil grayscale image according to the density and the near-circularity of the closed area includes: The difference between the density and the near-circularity of the closed area is normalized to obtain the pollution degree of the closed area; the average pollution degree of all closed areas in the hydraulic oil grayscale image is taken as the static pollution degree of the hydraulic oil grayscale image.

8. The method for detecting hydraulic oil contamination based on image processing according to claim 7, characterized in that: Determining the static contamination degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed area to obtain the hydraulic oil contamination detection result includes: Different levels of contamination thresholds are set for the static contamination degree of the hydraulic oil grayscale image, and different levels of hydraulic oil contamination detection results are obtained according to the comparison results between the static contamination degree of the hydraulic oil grayscale image and the contamination thresholds.

9. The method for detecting hydraulic oil contamination based on image processing according to claim 8, characterized in that: The method further comprises: obtaining the hydraulic oil contamination detection result; and According to the different levels of hydraulic oil contamination detection results, corresponding warning methods are set, and closed areas in the hydraulic oil grayscale image are marked.

Citation Information

Patent Citations

  • Methods of utilizing image noise information

    US20160140725A1

  • Methods for detection of contaminants on optical fiber connectors

    US20190339456A1