Hydraulic oil liquid pollution detection method based on image processing
The method improves hydraulic oil contamination assessment by using image processing to analyze particle distribution and shape, enhancing accuracy and enabling targeted maintenance.
Patent Information
- Application Number
- CN202510813615.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Existing liquid particle detectors inaccurately distinguish between solid particles and background in hydraulic oil images, leading to low accuracy in hydraulic oil contamination assessment.
A method involving image processing techniques to analyze hydraulic oil images, using pixel gradient and clustering algorithms to identify and quantify closed regions, considering area, distance, and circularity of particles to assess contamination.
Enhances the accuracy of hydraulic oil contamination assessment by accurately evaluating the distribution and shape of solid particles, providing precise contamination levels and enabling targeted maintenance.
Smart Images

Figure CN120318239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing. More specifically, the present invention relates to a method for detecting hydraulic oil pollution based on image processing. Background Art
[0002] During the operation of a hydraulic system, external pollutants may enter the system through the breather hole of the fuel tank, the fuel filling port, the reciprocating piston rod, the oil injected into the system, the air flowing in the fuel tank, and the oil leakage flowing back into the fuel tank, etc., resulting in particulate pollutants in the hydraulic oil. This will cause the lubrication ability of the equipment to decline, the equipment components to wear, reduce the actual production efficiency, and even cause faults in the hydraulic equipment.
[0003] An oil particle analyzer is a device used to monitor and analyze particulate pollutants in hydraulic oil and other oils in real time. It uses a metallurgical microscope or other optical imaging systems to magnify the particle images to improve the resolution and clarity of the images, ensuring that the detailed information of the particles can be accurately captured. In the process of using an oil particle analyzer to obtain the hydraulic oil pollution detection result, the threshold segmentation algorithm in image processing technology is used to separate the solid particles in the oil.
[0004] However, in the hydraulic oil images collected by the oil particle analyzer, the gray level difference between some tiny solid particles and the background area is small, and the gray level change at the edge is not obvious. When separating the solid particles in the oil based on threshold segmentation, such solid particles may be misjudged as the background, resulting in a low accuracy of the final obtained hydraulic oil pollution detection result.
[0005] In summary, in the process of determining the hydraulic oil pollution detection result based on the oil particle analyzer, it is urgent to solve the problem of how to accurately obtain the hydraulic oil pollution detection result based on various types of solid particles in the hydraulic oil image. Summary of the Invention
[0006] To solve the above technical problem of how to accurately identify various types of solid particles in a hydraulic oil image and thus accurately obtain the hydraulic oil pollution detection result, the present invention proposes a method for detecting hydraulic oil pollution based on image processing. The method includes the following steps: Obtain a grayscale image of hydraulic oil, obtain a grayscale image of hydraulic oil, calculate the probability of each pixel point being the edge of a solid particle according to the grayscale value and gradient value of the pixel point to determine the edge pixel points of the solid particles; process the edge pixel points based on a clustering algorithm to obtain the closed regions and corresponding areas in the grayscale image of hydraulic oil, and calculate the density of the : ; is the area of the th closed region, is the maximum area of the closed regions in the grayscale image of the hydraulic oil, is the mean Euclidean distance between the th closed region and other closed regions, is the maximum Euclidean distance between the closed regions in the grayscale image of the hydraulic oil, is the exponential function with base e, is the preset weight coefficient, is the absolute value symbol; determining the angular mutation edge pixels according to the angular change between the edge pixels and their two adjacent edge pixels on both sides; correcting the circularity of the closed region based on the number of edge pixels and the number of angular mutation edge pixels of the closed region to obtain the near-circularity of the closed region; determining the static pollution degree of the grayscale image of the hydraulic oil according to the density and near-circularity of the closed region to obtain the hydraulic oil pollution detection result.
[0007] The present invention can accurately evaluate the static pollution degree of the grayscale image of the hydraulic oil by analyzing the solid particle regions existing in the grayscale image of the hydraulic oil. When analyzing the solid particle regions in the grayscale image of the hydraulic oil, the present invention takes into account that the pollution of the hydraulic oil by the solid particles is determined by their distribution and circularity, and only relying on the area of the solid particles cannot accurately evaluate the pollution of each solid particle region to the hydraulic oil; therefore, the present invention analyzes the distribution by analyzing the area of the closed regions and the distance between the closed regions, and analyzes its circularity through circularity, and can accurately obtain the pollution degree of each closed region to 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 its circularity, and the angular change of the edge pixels can reflect the smoothness of the edge of the closed region. Therefore, the present invention analyzes the protrusion degree by obtaining the number of angular mutation edge pixels of the closed region to realize the correction of the circularity, effectively improving the accuracy of the obtained static pollution degree of the grayscale image of the hydraulic oil.
[0008] According to a hydraulic oil pollution detection method based on image processing provided by the present invention, before obtaining the grayscale image of the hydraulic oil, it further includes: collecting a microscopic image of the hydraulic oil and performing preprocessing to obtain the grayscale image of the hydraulic oil.
[0009] The present invention takes into account that there will be problems such as noise and unclear edges in the original microscopic image of the hydraulic oil, so a preprocessing method is provided, and by improving the quality of the collected original microscopic image, the influence of other factors on the detection result is effectively avoided.
[0010] A hydraulic oil pollution detection method based on image processing according to the present invention, calculating the probability that each pixel point is the edge of a solid particle based on the gray value and gradient value of the pixel point to determine the edge pixel points of the solid particle, including: if the probability that a pixel point is the edge of a solid particle is greater than the probability threshold, then this pixel point is the edge pixel point of the solid particle.
[0011] A hydraulic oil pollution detection method based on image processing according to the present invention, the calculating the probability that each pixel point is the edge of a solid particle includes: ; is the probability that the i-th pixel point is the edge of a solid particle, 、 are respectively the gray value and gradient value of the i-th pixel point, 、 are respectively the maximum gray value and maximum gradient value in the gray image of the hydraulic oil, 、 are respectively the gray weight and gradient weight, is the absolute value symbol, is the exponential function with e as the base.
[0012] Considering that the area of some solid particle regions is small and their edges cannot be accurately extracted by conventional edge detection algorithms, the present invention provides an accurate calculation method for the probability that a pixel point is the edge of a solid particle. By analyzing the gray difference and gradient difference between the pixel point and the background region of the hydraulic oil, the possibility that each pixel point is the edge of a solid particle can be accurately evaluated.
[0013] A hydraulic oil pollution detection method based on image processing according to the present invention, the processing the edge pixel points based on the clustering algorithm to obtain the closed regions and corresponding areas in the gray image of the hydraulic oil, including: using the DBSCAN clustering algorithm to process the edge pixel points in the gray image of the hydraulic oil to obtain each closed region, and taking the number of all pixel points in the closed region as the area of this closed region.
[0014] A hydraulic oil pollution detection method based on image processing according to the present invention, the determining the angular mutation edge pixel points according to the angular change between the edge pixel point and its two adjacent edge pixel points on both sides, including: respectively obtaining the vectors from the edge pixel point to its two adjacent edge pixel points on both sides, inputting the ratio of the dot product of the vectors from the edge pixel point to its two adjacent edge pixel points on both sides to the modulus of the vectors into the arccosine function, and finally performing normalization processing to obtain the angle of this edge pixel point; if the angle of the edge pixel point is greater than or equal to the angle threshold, then this edge pixel is the angular mutation edge pixel point.
[0015] A hydraulic oil pollution detection method based on image processing according to the present invention corrects the circularity of the closed region based on the number of edge pixels in the closed region and the number of edge pixels with angular mutation to obtain the near-circularity of the closed region, including: ; is the near-circularity of the th closed region, , are respectively the number of edge pixels with angular mutation and the number of edge pixels in the th closed region, is the area of the th closed region, is the circularity of the th closed region, is the exponential function with base e.
[0016] The present invention takes into account that the edge of a closed region close to a circle is relatively smooth and the number of edge pixels with angular mutation is small, while the edge of an irregular closed region is relatively convex and the number of edge pixels with angular mutation is large. Therefore, the present invention provides an accurate calculation method for the near-circularity of a closed region. By obtaining the proportion of edge pixels with angular mutation in the closed region to correct the circularity of the closed region, the near-circularity of each closed region can be accurately obtained.
[0017] A hydraulic oil pollution detection method based on image processing according to the present invention determines the static pollution degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed region, including: normalizing the difference between the density and near-circularity of the closed region to obtain the pollution degree of the closed region; taking the average value of the pollution degrees of all closed regions in the hydraulic oil grayscale image as the static pollution degree of the hydraulic oil grayscale image.
[0018] A hydraulic oil pollution detection method based on image processing according to the present invention determines the static pollution degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed region to obtain the hydraulic oil pollution detection result, including: setting different levels of pollution thresholds for the static pollution degree of the hydraulic oil grayscale image, and obtaining different levels of hydraulic oil pollution detection results according to the comparison result between the static pollution degree of the hydraulic oil grayscale image and the pollution threshold.
[0019] The present invention takes into account that different levels of hydraulic oil pollution detection results need to be processed differently. For example, severe pollution requires thorough cleaning, and mild pollution only requires improving preventive measures, etc. Therefore, different levels of pollution thresholds are set to divide the hydraulic oil pollution detection results into different levels, improving the response efficiency of the staff to hydraulic oil pollution.
[0020] A hydraulic oil pollution detection method based on image processing provided by the present invention. After obtaining the hydraulic oil pollution detection result, the method further includes: setting corresponding warning methods according to different levels of hydraulic oil pollution detection results, and marking the closed regions in the grayscale image of the hydraulic oil.
[0021] The present invention has the following beneficial effects: Based on the above technical solution, for a hydraulic oil pollution detection method based on image processing provided by the present invention, when obtaining the hydraulic oil pollution detection result, by analyzing the solid particle regions existing in the grayscale image of the hydraulic oil, the static pollution degree of the grayscale image of the hydraulic oil can be accurately evaluated. When analyzing the solid particle regions in the grayscale image of the hydraulic oil, the present invention considers that the pollution of the hydraulic oil by solid particles is determined by their distribution and circularity, and only relying on the area of the solid particles cannot accurately evaluate the pollution of each solid particle region to the hydraulic oil; therefore, the present invention analyzes the distribution by analyzing the area of the closed region and the distance between the closed regions, and analyzes its circularity through circularity, and can accurately obtain the pollution degree of each closed region to the hydraulic oil. In the process of obtaining circularity, the present invention considers that the overlap of some solid particles will affect its circularity, and the angular change of the edge pixel points can reflect the smoothness of the edge of the closed region. Therefore, the present invention analyzes the protrusion degree by obtaining the number of angular mutation edge pixel points of the closed region to realize the correction of circularity, effectively improving the accuracy of the obtained static pollution degree of the grayscale image of the hydraulic oil. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flowchart of the steps of a hydraulic oil pollution detection method based on image processing provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0024] A hydraulic oil pollution detection method based on image processing provided by an embodiment of the present invention can accurately obtain the hydraulic oil pollution detection result by analyzing the density characteristics and circular characteristics of various types of solid particles in the hydraulic oil image.
[0025] Please refer to Figure 1 , Figure 1 is a flowchart of the steps of a hydraulic oil pollution detection method based on image processing provided by an embodiment of the present invention. The method includes the following steps: S1: Obtain a grayscale image of the hydraulic oil.
[0026] Exemplarily, in the embodiments of the present invention, obtaining a grayscale image of hydraulic oil includes: collecting a microscopic image of the hydraulic oil and performing preprocessing to obtain the grayscale image of the hydraulic oil.
[0027] When collecting the microscopic image of the hydraulic oil and performing preprocessing, an oil particle analyzer can be used to take a picture of the hydraulic oil sample under a microscope to obtain the original microscopic color image; the weighted average method is used to convert the collected original microscopic color image into a grayscale image to reduce the subsequent amount of computation. An adaptive filter is used to remove random noise in the grayscale image and improve the signal-to-noise ratio. Adaptive histogram equalization processing is performed on the grayscale image to improve the contrast in the grayscale image. Sharpening technology is used to enhance the details of the grayscale image, and finally the grayscale image of the hydraulic oil is obtained.
[0028] The specific steps of the above preprocessing method can be implemented by the prior art, and the embodiments of the present invention will not elaborate herein.
[0029] It should be noted that based on the above steps, a grayscale image of the hydraulic oil and each pixel point in the grayscale image of the hydraulic oil can be obtained, and the distribution area of the solid particles in the grayscale image of the hydraulic oil can reflect the degree of contamination of the hydraulic oil. The larger the area, the higher the degree of contamination. Therefore, the embodiments of the present invention can obtain the area of the solid particles in the grayscale image of the hydraulic oil to evaluate the degree of its contamination, that is, the following steps are performed.
[0030] S2: Determine the edge pixel points of the solid particles according to the grayscale value and gradient value of the pixel points; process the edge pixel points based on the clustering algorithm to obtain the closed regions and the corresponding areas in the grayscale image of the hydraulic oil.
[0031] It should be noted that the areas of the solid particles in the grayscale image of the hydraulic oil vary in size, and conventional edge detection algorithms cannot accurately identify the edges of the solid particles with smaller areas. There are significant differences in the grayscale between the solid particles and the oil background part in the grayscale image of the hydraulic oil. The grayscale of the solid particles is less than that of the oil background part, and there are also significant differences in the gradient between the edge pixel points of the solid particles and the ordinary pixel points in the grayscale image of the hydraulic oil. The gradient of the edge pixel points of the solid particles is usually larger.
[0032] Therefore, the embodiments of the present invention can calculate the possibility of each pixel point being the edge of the solid particle according to the grayscale difference and gradient difference between the pixel point and the background region.
[0033] Exemplarily, in the embodiments of the present invention, according to the grayscale value and gradient value of the pixel points, calculate the probability of each pixel point being the edge of the solid particle. Specifically, the following relational expression can be referred to: ; $P_i$ is the probability that the $i$-th pixel is at the edge of the solid particle, $G_i$ is the gray value of the $i$-th pixel, $T_i$ is the gradient value of the $i$-th pixel, $G_{max}$ is the maximum gray value in the gray-scale image of the hydraulic oil, $T_{max}$ is the maximum gradient value in the gradient image of the hydraulic oil, $\omega_g$ is the gray-scale weight, $\omega_t$ is the gradient weight, $| |$ is the absolute value symbol, $e$ is the exponential function with base $e$.
[0034] It can be understood that, compared with the gradient change of the edge pixels, the gray value difference between the solid particles and the background in the gray-scale image of the hydraulic oil is more obvious. Therefore, in the embodiments of the present invention, when setting and , it can make . As an example, can be set to 0.6, and can be set to 0.4, which can be specifically adjusted according to actual needs.
[0035] In the above formula, is the normalized gray value difference between the gray value of the $i$-th pixel and the maximum gray value in the gray-scale image of the hydraulic oil, and the difference value is normalized between 0 and 1. The larger this value is, the more likely the $i$-th pixel is in the solid particle area with a lower gray value.
[0036] is the normalized gradient difference between the gradient value of the $i$-th pixel and the maximum gradient value in the gradient image of the hydraulic oil, and the difference value is normalized between 0 and 1. The smaller this value is, the closer the gradient value of the $i$-th pixel is to the maximum gradient value in the gradient image of the hydraulic oil, and the greater the possibility of being at the edge of the solid particle area.
[0037] In summary, if the difference between the gray value of the pixel and the maximum gray value in the gray-scale image of the hydraulic oil is larger, and the gradient value is closer to the maximum gradient value in the gray-scale image of the hydraulic oil, it indicates that the gray-scale feature and gradient feature of this pixel are more in line with the characteristics of the edge of the solid particle area, and the possibility of being at the edge of the solid particle area is greater.
[0038] Exemplarily, in the embodiments of the present invention, determining the edge pixels of the solid particles according to the gray value and gradient value of the pixels includes: if the probability that the pixel is at the edge of the solid particle is greater than the probability threshold, then this pixel is the edge pixel of the solid particle.
[0039] Among them, the probability threshold can be set to 0.6; the probability threshold can be specifically set according to actual needs, and the embodiments of the present invention do not limit it too much here.
[0040] It can be understood that if the probability of a pixel point being at the edge of a solid particle is not greater than the probability threshold, it indicates that its gray - scale feature and gradient feature do not conform to the features of the edge of a solid particle.
[0041] After obtaining all the edge pixel points of the solid particles based on the above steps, a closed solid - particle region in the grayscale image of the hydraulic oil can be obtained according to the edge pixel points of the solid particles.
[0042] Exemplarily, in the embodiment of the present invention, processing the edge pixel points based on a clustering algorithm to obtain the closed regions and the corresponding areas in the grayscale image of the hydraulic oil includes: using the DBSCAN clustering algorithm to process the edge pixel points in the grayscale image of the hydraulic oil to obtain each closed region, and taking the number of all pixel points in the closed region as the area of the closed region.
[0043] Specifically, when using the DBSCAN clustering algorithm to process the edge pixel points in the grayscale image of the hydraulic oil to obtain each closed region, the neighborhood radius and the minimum number of points of the edge pixel points can be set according to the resolution of the grayscale image of the hydraulic oil; if the number of pixel points within the neighborhood radius of an edge pixel point is at least the minimum number of points, then this edge pixel point is a core pixel point; adding the core pixel point and the pixel points that are density - reachable from it to the cluster centered on this core pixel point, repeating the above process to visit all core pixel points, and finally obtaining multiple clusters, each cluster being a closed solid - particle region, that is, a closed region.
[0044] Based on the above steps, the closed regions in the grayscale image of the hydraulic oil can be accurately obtained. By analyzing the areas corresponding to the closed regions, the degree of contamination of the grayscale image of the hydraulic oil can be evaluated. However, the distribution and near - circularity of the solid particles in the grayscale image of the hydraulic oil also affect the degree of contamination of the grayscale image of the hydraulic oil. There are limitations in evaluating the degree of contamination of the grayscale image of the hydraulic oil only based on the areas corresponding to the closed regions. Therefore, when obtaining the degree of contamination of the grayscale image of the hydraulic oil in the embodiment of the present invention, not only the area of the solid - particle region needs to be obtained, but also its specific distribution and near - circularity need to be obtained, that is, the following steps are performed.
[0045] S3: Calculate the density of the closed regions according to the areas of the closed regions and the Euclidean distances between the closed regions.
[0046] It should be noted that when the solid particles are evenly distributed in the oil, although the overall particle area remains unchanged, the particle concentration in each local region is relatively low and stable. This means that the interaction between particles and the contact probability between particles and equipment components are relatively uniform, and the wear and impact on the equipment are relatively uniform and slow, which can reduce the risk of severe wear or failure in a certain local area to a certain extent, and the degree of contamination is relatively low.
[0047] Based on this, embodiments of the present invention can obtain the area of the closed region and the Euclidean distance between the closed regions to determine the density of each closed region, thereby evaluating the impact of its distribution on the pollution degree.
[0048] Among them, when obtaining the Euclidean distance between the closed regions, the Euclidean distance between the central pixel points of the closed regions can be used as the Euclidean distance between the closed regions. The steps of obtaining the Euclidean distance can be obtained through the existing Euclidean distance formula and will not be elaborated here.
[0049] Exemplarily, in embodiments of the present invention, to calculate the density of the closed region, the following relational expression can be specifically referred to: ; is the density of the th closed region, is the th area of the closed region, is the maximum value of the areas of the closed regions in the hydraulic oil grayscale image, is the th average value of the Euclidean distances between the th closed region and other closed regions, is the maximum value of the Euclidean distances between the closed regions in the hydraulic oil grayscale image, is the preset weight coefficient, is the absolute value symbol.
[0050] In the above formula, is the normalized difference value between the area of the th closed region and the maximum value of the areas of the closed regions in the hydraulic oil grayscale image. The smaller this value is, the closer the area of the th closed region is to the maximum value of the areas of the closed regions in the hydraulic oil grayscale image.
[0051] is the normalized value of the average Euclidean distance between the th closed region and other closed regions. The larger this value is, the greater the Euclidean distance between the th closed region and other closed regions, and the more discrete the distribution is.
[0052] In summary, if the difference between the area of the closed region and the maximum area value is smaller and the Euclidean distance between this closed region and other closed regions is smaller, it indicates that the density of this closed region is higher.
[0053] S4: Determine the angular mutation edge pixels according to the angular change between an edge pixel and its two adjacent edge pixels on both sides; correct the circularity of the closed region based on the number of edge pixels of the closed region and the number of angular mutation edge pixels to obtain the near-circularity of the closed region.
[0054] It should be noted that in the grayscale image of hydraulic oil, the surface of spherical particles is relatively smooth. When moving in the oil, the contact area with the surface of equipment components is small, and the contact method is relatively gentle. Under the same particle area, spherical particles cause relatively less damage to the equipment and relatively lower pollution level. Irregularly shaped particles usually have sharp edges and complex surface structures. The edges are likely to embed into the surface of equipment components during the oil flow, exacerbating wear. Moreover, the contact area and contact points between irregular particles and the equipment surface are relatively more, which will cause more serious friction and wear. At the same time, it may also scratch key components such as seals, resulting in problems such as oil leakage, thereby increasing the pollution level.
[0055] Based on this, the embodiments of the present invention can obtain the degree of approximation to a circle of each closed region to evaluate the degree of pollution it causes. Since there will be overlap in some solid particle regions, morphologically, part of the edge of the solid particle region will be circular, and the remaining part will be a protruding circle, that is, two circles overlap to form an approximate ellipse. Therefore, when analyzing the circularity of the closed region, it is necessary to analyze the degree of its morphological approximation to a circle according to the angular change of its edge pixels.
[0056] Exemplarily, in the embodiments of the present invention, determining the angular mutation edge pixels according to the angular change between an edge pixel and its two adjacent edge pixels on both sides includes: respectively obtaining the vectors from the edge pixel to its two adjacent edge pixels on both sides, inputting the ratio of the dot product of the vectors from the edge pixel to its two adjacent edge pixels on both sides to the modulus of the vectors into the arccosine function, and finally performing normalization processing to obtain the angle of the edge pixel; if the angle of the edge pixel is greater than or equal to the angle threshold, then the edge pixel is an angular mutation edge pixel.
[0057] Among them, the angle threshold can be set to 30°; the angle threshold can be specifically set according to actual needs.
[0058] It can be understood that the angular mutation edge pixels are the edge pixels with relatively large angular changes on the edge of the closed region. The edge pixels of circular particles are relatively smooth and have small angular changes. If there are sharp corners on the edge, there will be relatively large angular changes in the edge pixels of the particle.
[0059] Based on the above steps, the angular mutation edge pixels in the edge pixels of each closed region can be obtained.
[0060] Exemplarily, in the embodiments of the present invention, the circularity of the closed region is corrected based on the number of edge pixels of the closed region and the number of edge pixels with angular mutation to obtain the near-circularity of the closed region, including: ; is the near-circularity of the th closed region, is the edge pixel with angular mutation in the th closed region, is the number of edge pixels in the th closed region, is the area of the th closed region, is the exponential function with base e, is pi.
[0061] Among them, is the circularity of the th closed region. The number of edge pixels in the th closed region is the perimeter of the th closed region.
[0062] In the above formula, represents the protrusion degree of the th closed region. The larger this value is, the more edge pixels with mutation exist in the th closed region, and the greater the protrusion degree is. The circularity of the th closed region can be corrected through its protrusion degree, so as to accurately obtain the near-circularity of the th closed region. The higher the near-circularity is, the smaller the possibility of pollution caused by this closed region is.
[0063] S5: Determine the static pollution degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed region to obtain the hydraulic oil pollution detection result.
[0064] According to the above steps S2 and S3, the density and near-circularity of the closed region can be obtained respectively. If the density of the closed region is higher and the near-circularity is lower, it indicates that the degree of pollution to the hydraulic oil is higher, and it is very likely to affect the equipment.
[0065] Therefore, in the embodiments of the present invention, the static pollution degree of the hydraulic oil grayscale image is determined through the density and near-circularity of the closed region.
[0066] Exemplarily, in an embodiment of the present invention, determining the static pollution degree of a hydraulic oil grayscale image according to the density and near-circularity of a closed region includes: normalizing the difference between the density of the closed region and the near-circularity to obtain the pollution degree of the closed region; taking the average value of the pollution degrees of all closed regions in the hydraulic oil grayscale image as the static pollution degree of the hydraulic oil grayscale image.
[0067] Among them, the normalization process can be achieved through the specific steps of the algorithm, which are not elaborated in the embodiments of the present invention.
[0068] Exemplarily, in an embodiment of the present invention, determining the static pollution degree of a hydraulic oil grayscale image to obtain a hydraulic oil pollution detection result includes: setting pollution thresholds of different levels for the static pollution degree of the hydraulic oil grayscale image, obtaining hydraulic oil pollution detection results of different levels according to the comparison result between the static pollution degree of the hydraulic oil grayscale image and the pollution threshold, and setting corresponding warning methods according to the hydraulic oil pollution detection results of different levels.
[0069] Specifically, when obtaining hydraulic oil pollution detection results of different levels according to the comparison result between the static pollution degree of the hydraulic oil grayscale image and the pollution threshold, threshold 1, threshold 2, and threshold 3 can be set, which can be set to 0.7, 0.5, and 0.1 respectively. The comparison result between the static pollution degree of the hydraulic oil grayscale image and the pollution threshold specifically includes the following possible situations: In a possible situation, the static pollution degree of the hydraulic oil grayscale image is greater than threshold 1; in this case, the hydraulic oil detection result is severe pollution, and a first-level alarm can be set.
[0070] In another possible situation, the static pollution degree 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 pollution, and a second-level alarm can be set.
[0071] In yet another possible situation, the static pollution degree 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 mild pollution, and a third-level alarm can be set.
[0072] In still another possible situation, the static pollution degree of the hydraulic oil grayscale image is less than or equal to threshold 3; in this case, the hydraulic oil detection result is clean, and no alarm needs to be set.
[0073] Among them, the priorities of each level of alarm are that the first-level alarm is higher than the second-level alarm, and the second-level alarm is higher than the third-level alarm. The alarm method can be a sound warning or a signal light warning, and the specific alarm method can be set according to actual needs.
[0074] After obtaining the detection result of hydraulic oil pollution based on the above steps in the embodiment of the present invention, the particle regions in the hydraulic oil detection result can also be marked, so that the staff can quickly locate the solid particle regions in the hydraulic oil.
[0075] Exemplarily, in the embodiment of the present invention, after obtaining the detection result of hydraulic oil pollution, it further includes: marking the closed regions in the grayscale image of the hydraulic oil.
[0076] Among them, the marking method can be the grayscale highlighting of the solid particle region, the color highlighting of the edge of the solid particle region, etc., which can be specifically set according to actual needs, and the embodiment of the present invention does not limit it too much here.
[0077] It can be seen that in the embodiment of the present invention, when obtaining the detection result of hydraulic oil pollution, a grayscale image of the hydraulic oil can be obtained, and the probability that each pixel point is the edge of a solid particle can be calculated according to the grayscale value and gradient value of the pixel point to determine the edge pixel points of the solid particles; the edge pixel points are processed based on a clustering algorithm to obtain the closed regions and their corresponding areas in the grayscale image of the hydraulic oil, and the density of the th closed region is calculated : ; is the area of the th closed region, is the maximum value of the areas of the closed regions in the grayscale image of the hydraulic oil, is the th closed region and the average Euclidean distance between other closed regions, is the maximum value of the Euclidean distances between the closed regions in the grayscale image of the hydraulic oil, is the exponential function with e as the base, is the preset weight coefficient, is the absolute value symbol; the angular mutation edge pixel points are determined according to the angular change between the edge pixel points and their two adjacent edge pixel points on both sides; the circularity of the closed region is corrected based on the number of edge pixel points and the number of angular mutation edge pixel points in the closed region to obtain the near-circularity of the closed region; the static pollution degree of the grayscale image of the hydraulic oil is determined according to the density and near-circularity of the closed region to obtain the detection result of hydraulic oil pollution, effectively improving the accuracy of hydraulic oil pollution detection.
[0078] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A hydraulic oil pollution detection method based on image processing, characterized in that, Including: Obtain a grayscale image of hydraulic oil, calculate the probability of each pixel point being the edge of a solid particle based on the grayscale value and gradient value of the pixel point, so as to determine the edge pixel points of the solid particles; Process the edge pixels based on the clustering algorithm to obtain the closed regions and their corresponding areas in the grayscale image of hydraulic oil, and calculate the density of the th closed region : ; is the area of the th closed region, is the maximum area of the closed regions in the grayscale image of the hydraulic oil, is the average Euclidean distance between the th closed region and other closed regions, is the maximum Euclidean distance between the closed regions in the grayscale image of the hydraulic oil, is the exponential function with base e, is the preset weight coefficient, is the absolute value symbol; Determine the angle mutation edge pixel points according to the angle change between the edge pixel points and their two adjacent edge pixel points on both sides; Based on the number of edge pixel points in the closed area and the number of angle mutation edge pixel points, correct the circularity of the closed area to obtain the near-circularity of the closed area; Determine the static pollution degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed area, so as to obtain the hydraulic oil pollution detection result.
2. The hydraulic oil pollution detection method based on image processing according to claim 1, wherein, Before the step of obtaining the grayscale image of hydraulic oil, it further includes: Collect a microscopic image of hydraulic oil and perform preprocessing to obtain a grayscale image of hydraulic oil.
3. The hydraulic oil pollution detection method based on image processing according to claim 1, characterized in that The step of calculating the probability of each pixel point being the edge of a solid particle based on the grayscale value and gradient value of the pixel point, so as to determine the edge pixel points of the solid particles, includes: If the probability of a pixel point being the edge of a solid particle is greater than the probability threshold, then the pixel point is the edge pixel point of the solid particle.
4. The hydraulic oil pollution detection method based on image processing according to claim 3, wherein The step of calculating the probability of each pixel point being the edge of a solid particle includes: ; is the probability that the i-th pixel is the edge of the solid particle, 、 are the gray value and gradient value of the i-th pixel respectively, 、 are the maximum gray value and maximum gradient value in the gray image of the hydraulic oil respectively, 、 are the gray weight and gradient weight respectively, is the absolute value symbol, is the exponential function with base e.
5. A hydraulic oil pollution detection method based on image processing according to claim 1, characterized in that, The step of processing the edge pixel points based on a clustering algorithm to obtain the closed areas and corresponding areas in the hydraulic oil grayscale image, includes: Use the DBSCAN clustering algorithm to process the edge pixel points in the hydraulic oil grayscale image to obtain each closed area, and take the number of all pixel points in the closed area as the area of the closed area.
6. The hydraulic oil pollution detection method based on image processing according to claim 1, wherein, The step of determining the angle mutation edge pixel points according to the angle change between the edge pixel points and their two adjacent edge pixel points on both sides, includes: Respectively obtain the vectors from the edge pixel point to its two adjacent edge pixel points on both sides, input the ratio of the dot product of the vectors from the edge pixel point to its two adjacent edge pixel points on both sides to the modulus of the vector into the inverse cosine function, and finally perform normalization processing 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 the angle mutation edge pixel point.
7. A hydraulic oil contamination detection method based on image processing according to claim 1, characterized in that The step of correcting the circularity of the closed area based on the number of edge pixel points in the closed area and the number of angle mutation edge pixel points to obtain the near-circularity of the closed area, includes: ; is the circularity of the th closed region, , are respectively the angle mutation edge pixels and the number of edge pixels in the th closed region, is the area of the th closed region, is the circularity of the th closed region, is the exponential function with base e.
8. A hydraulic oil contamination detection method based on image processing according to claim 1, characterized in that The step of determining the static pollution degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed area, includes: Normalize the difference between the density of the closed area and the near-circularity to obtain the pollution degree of the closed area; Take the average value of the pollution degrees of all closed areas in the hydraulic oil grayscale image as the static pollution degree of the hydraulic oil grayscale image.
9. A hydraulic oil pollution detection method based on image processing according to claim 8, characterized in that, The step of determining the static pollution degree of the hydraulic oil grayscale image according to the density and near-circularity of the closed area, so as to obtain the hydraulic oil pollution detection result, includes: Set different levels of pollution thresholds for the static pollution degree of the hydraulic oil grayscale image, and obtain different levels of hydraulic oil pollution detection results according to the comparison result between the static pollution degree of the hydraulic oil grayscale image and the pollution threshold.
10. A hydraulic oil contamination detection method based on image processing according to claim 9, characterized in that, After the step of obtaining the hydraulic oil pollution detection result, it further includes: Set corresponding warning methods according to different levels of hydraulic oil pollution detection results, and mark the closed areas in the hydraulic oil grayscale image.
Citation Information
Patent Citations
Non-continuity lithium battery thin film defect detection method and device based on machine vision
CN103499585A
Pollen detection method based on digital image processing technology
CN112669304A
Black and odorous water body identification method and system based on image identification processing
CN119741615A
Methods of utilizing image noise information
US20160140725A1
Methods for detection of contaminants on optical fiber connectors
US20190339456A1