Mechanical oil leakage detection method based on fluorescence reaction
Through ultraviolet irradiation and fluorescence reaction detection methods, combined with image processing technology, the accuracy, efficiency and environmental adaptability of mechanical oil leakage detection are solved, and efficient and accurate oil leakage identification and real-time monitoring are achieved.
Patent Information
- Application Number
- CN202411321730.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-11-12
AI Technical Summary
The existing mechanical oil leakage detection methods have low accuracy, low efficiency, poor real-time performance, and are difficult to accurately detect in complex environments, especially the identification of micro oil leakage points and environmental adaptability.
UV irradiation combined with fluorescence reaction detection method is used to measure fluorescence spectrum, weighted peak division, image processing and K-means clustering and other technologies to realize oil leakage detection of mechanical equipment, and use fluorescence point extraction algorithm and connectivity domain analysis to identify leakage Oil conditions, eliminate ambient light interference, improve detection accuracy and efficiency.
It realizes efficient and accurate real-time detection of oil leakage in mechanical equipment, and can detect tiny oil leakage points in a timely manner. It is suitable for complex environments, with good environmental adaptability and real-time monitoring capabilities, and is suitable for dust-free, unmanned workshops or artificial Areas that are not easy to detect.
Smart Images

Figure CN118936772A_ABST
Abstract
Description
Technical Field
[0001] The present application proposes a method for detecting mechanical oil leakage by utilizing ultraviolet light irradiation and fluorescence reaction, which belongs to the field of automated detection. Background Art
[0002] With the rapid development of computer vision technology, various imaging detection technologies have been widely used.
[0003] In the process of mechanical equipment operation and maintenance, daily detection and judgment of oil leakage is one of the basic operation items, and also one of the common and serious technical failures. Oil leakage will not only cause damage to mechanical equipment and performance degradation, but also may cause environmental pollution and safety hazards.
[0004] The existing oil leakage detection methods mainly include visual inspection, mechanical detection and analysis, etc. These methods have problems such as low accuracy, low efficiency, and poor real-time performance. In addition, sensors such as thermal imaging technology are also used for detection, but they may be limited in certain environments. If chemical reagents are used to mark the oil and then tested through corresponding detection devices, although the test results are more accurate, the operation is more complicated and may have an adverse effect on the properties of the equipment oil.
[0005] Although the above-mentioned alternatives can achieve similar effects, they still have obvious shortcomings in terms of sensitivity, accuracy, real-time monitoring and ease of operation.
[0006] In view of this, this patent application is proposed. Summary of the invention
[0007] The mechanical oil leakage detection method based on fluorescence reaction described in the present application aims to solve the problems existing in the above-mentioned prior art and is based on irradiating the area to be tested with ultraviolet light, and determining whether there is an oil leakage by detecting the fluorescence reaction of the area, thereby achieving the design purpose of improving detection accuracy and efficiency, and enhancing real-time performance and environmental adaptability.
[0008] To achieve the above design objectives, the mechanical oil leakage detection method based on fluorescence reaction includes the following steps:
[0009] Step 1), measuring fluorescence spectrum;
[0010] Use ultraviolet light source to illuminate the oil product to be tested, stimulate the oil product to produce fluorescence and measure the fluorescence spectrum;
[0011] Step 2), determine the bands of all main peak signal areas in the oil product fluorescence spectrum;
[0012] Based on the weighted peak division method, the fluorescence band with higher response is weightedly intercepted;
[0013] Step 3), collect image photos;
[0014] A UV light source is set near the mechanical equipment and a camera is used to collect images of potential oil leak locations;
[0015] Step 4), image processing and oil leak detection;
[0016] If there is oil leakage during the normal operation of mechanical equipment, the oil will produce fluorescence under ultraviolet light, and the camera will take pictures through the front filter to obtain pictures with only fluorescent bright spots;
[0017] The following fluorescence point extraction algorithm is applied to the image. If there are fluorescence points in the image, it is determined that the mechanical equipment has oil leakage;
[0018] 4.1) Convert RGB image to HSV color space;
[0019] Get the input RGB image and convert the RGB image to HSV color space;
[0020] 4.2) Oil droplet mask extraction;
[0021] Construct a feature vector and transform each pixel point q of the converted HSV image i =(H i , S i , V i ) as a three-dimensional feature vector: X i =(H i , S i , V i ), the above feature vector is used as the input of K-means clustering;
[0022] K-mean clustering, using the K-means algorithm to cluster the above feature vector X i Divided into two clusters (k = 2), one cluster represents fluorescent spots and the other cluster represents background;
[0023] 4.3) Connected domain analysis and deletion;
[0024] Perform connected domain analysis on the oil drop mask image I(x, y);
[0025] 4.4) Count the area of the bright spot in the final image If the area exceeds a certain threshold A threshold , that is, A f ≥A threshold , it is determined that there is oil leakage; otherwise, it is determined that there is no oil leakage.
[0026] Furthermore, the step 2) includes the following execution process:
[0027] 2.1) Determine the position and height of each wave crest;
[0028] From the fluorescence spectrum, we can know the position μ of each peak i and the corresponding height h i ;
[0029] 2.2) Calculate the weighted average peak position;
[0030] Using the peak height as the weight, calculate the weighted average μ of the peak position weighted ,
[0031] 2.3) Calculate the peak extension range;
[0032] Set the band range ratio α and calculate the standard deviation range Δλ of each peak i , Δλ i =α·h i ;
[0033] 2.4) Comprehensive band range;
[0034] Combining all the peaks, the band range is determined as:
[0035] λ min =μ weighted -max(Δλ i ), λ max =μ weighted +max(Δλ i );
[0036] Through the above steps, an overall band range covering all peaks is determined, and this band range includes the signal areas of all major peaks in the spectrum; this wavelength range is used as the selected bandpass filter range to eliminate ambient light interference, that is, only the light signal of the fluorescence reaction is received, that is, only the fluorescent oil droplets whose reflections meet the above wavelength range can be presented in the subsequently collected images.
[0037] Furthermore, in step 4.1), for each pixel point p i =(R i , G i , B i ), the converted HSV value q i =(H i , S i , V i ), converted by the following formula: C max =max(R i , G i , B i ), C min =min(R i , G i , B i ),
[0038] Then Δ=C max -C min ; Calculate the hue H,
[0039]
[0040] Calculate the saturation S.
[0041]
[0042] Calculate the brightness V, V i =C max ;
[0043] Among them, each pixel p in the image i =(R i , G i , B i ) corresponds to q i =(H i , S i , V i ).
[0044] Furthermore, in step 4.2), the K-means algorithm process is as follows:
[0045] Initial cluster centers: where r j is the index of randomly selected pixel points;
[0046] Distance calculation and allocation: for each pixel X i , calculate the Euclidean distance to each cluster center, and assign the pixel to the nearest cluster center:
[0047] Update cluster centers: Update each cluster center to the mean of the pixels to which it belongs
[0048] Termination condition: When the change of cluster center is less than η, or the maximum number of iterations is reached, the iteration is stopped;
[0049] Extracting oil droplet fluorescence clusters: Distinguish the fluorescence spots from the background clusters by their average brightness (such as the V channel) to separate the clusters whose average brightness (V channel) is greater than the threshold V threshold The clusters of are taken as fluorescent point clusters; Where V(x,y) represents the V channel value at position (x,y), |C i | represents cluster C i The number of pixels; Among them, C0 is the extracted oil droplet fluorescence cluster. If all clusters The value does not exceed the threshold Vthreshold , then there is no fluorescent spot; if the oil droplet fluorescence cluster can be extracted, further judgment is made;
[0050] Generate oil drop mask image M(x, y) (binary image): After K-means clustering, identify the clusters representing blue fluorescent spots, and then generate a binary image; for each pixel X i : Among them, C0 represents the clustering of blue fluorescent dots;
[0051] Mask mapping: Map the mask back to the original HSV image and set the pixels that do not belong to the fluorescent point class to 0: Then I mask (x, y) = I HSV (x, y)·M(x, y); where, I mask (x, y) represents the HSV image retained according to the mask, and the remaining pixel values are 0; HSV (x, y) represents the HSV image converted from the original RGB image;
[0052] Threshold filtering: Perform pixel-by-pixel threshold filtering on the pixels behind the mask, make judgments based on the thresholds of the S and V channels, and set the threshold interval S min , S max , V min , V max :
[0053]
[0054] Among them, M final (x, y) is the final binary image.
[0055] Furthermore, the step 4.3) includes the following process:
[0056] Use the connected domain labeling algorithm to label all connected domains in the image. The labeling result is L(x, y), L(x, y) = Label(I(x, y)); where the value of L(x, y) represents the connected domain label to which the pixel I(x, y) belongs;
[0057] Calculate the area A of each connected domain k , Among them, k is the number of labels of the connected domain, A k represents the area of the kth connected domain, L k represents the connected domain with label k;
[0058] Delete the connected domains whose area is smaller than the preset threshold T; the preset threshold is set according to the specific application scenario, and finally obtain the image B of the retained connected domain f (x, y),
[0059] In summary, the mechanical oil leakage detection method based on fluorescence reaction has the advantage that the present application can efficiently and accurately detect oil leakage of mechanical equipment in real time, and has the characteristics of strong real-time performance, timely detection of oil leakage, good environmental adaptability and no interference in complex environments. The present application uses fluorescence reaction to efficiently identify tiny oil leakage points, and effectively exclude other interfering liquids. Through cameras and image processing technology, real-time monitoring and alarming can be achieved. It is suitable for dust-free, unmanned workshops or areas that are difficult to detect manually. Ultraviolet light and fluorescence reactions are not easily interfered by ambient light, and can still be accurately detected in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The present application will now be further described with reference to the following drawings;
[0061] Figure 1 A flow chart of the mechanical oil leakage detection method based on fluorescence reaction proposed in this application; DETAILED DESCRIPTION
[0062] Embodiment 1, as Figure 1 As shown, the present application proposes a mechanical oil leakage detection method based on fluorescence reaction, which includes the following steps:
[0063] Step 1), measuring fluorescence spectrum;
[0064] Use ultraviolet light source to illuminate the oil product to be tested, stimulate the oil product to produce fluorescence and measure the fluorescence spectrum;
[0065] Step 2), determine the bands of all main peak signal areas in the oil product fluorescence spectrum;
[0066] Based on the weighted peak division method, the fluorescence band with higher response is weightedly intercepted; including:
[0067] 2.1) Determine the position and height of each wave crest;
[0068] From the fluorescence spectrum, we can know the position μ of each peak i and the corresponding height h i .
[0069] 2.2) Calculate the weighted average peak position;
[0070] Using the peak height as the weight, calculate the weighted average μ of the peak position weighted ,
[0071] 2.3) Calculate the peak extension range;
[0072] Set the band range ratio α and calculate the standard deviation range Δλ of each peak i , Δλ i =α·hi ;
[0073] 2.4) Comprehensive band range;
[0074] Combining all the peaks, the band range is determined as:
[0075] λ min =μ weighted -max(Δλ i ), λ max =μ weighted +max(Δλ i );
[0076] According to the above steps, an overall wavelength range covering all peaks is determined, and the wavelength range includes the signal areas of all main peaks in the spectrum; the wavelength range is used as the selected bandpass filter range to exclude the interference of ambient light, that is, only the light signal of the fluorescence reaction is received, that is, only the fluorescent oil droplets whose reflection meets the above wavelength range can be presented in the subsequently collected images;
[0077] Step 3), collect image photos;
[0078] A UV light source is set near the mechanical equipment and a camera is used to collect images of potential oil leak locations;
[0079] Step 4), image processing and oil leak detection;
[0080] If there is oil leakage during the normal operation of mechanical equipment, the oil will produce fluorescence under ultraviolet light, and the camera will take pictures through the front filter to obtain pictures with only fluorescent bright spots;
[0081] The following fluorescence point extraction algorithm is used for the image. If there are fluorescence points in the image, it is determined that the mechanical equipment has oil leakage; the calculation method is as follows:
[0082] 4.1) Convert RGB image to HSV color space;
[0083] Get the input RGB image;
[0084] Convert the RGB image to HSV color space; for each pixel point p i =(R i , G i , B i ), the converted HSV value q i =(H i , S i , V i ), converted by the following formula: C max =max(R i , G i , B i), C min =mim(R i , G i , B i ),
[0085] Then Δ=C max -C min ; Calculate the hue H,
[0086]
[0087] Calculate the saturation S.
[0088]
[0089] Calculate the brightness V, V i =C max ;
[0090] Among them, each pixel p in the image i =(R i , G i , B i ) corresponds to q i =(H i , S i , V i );
[0091] 4.2) Oil droplet mask extraction;
[0092] Construct a feature vector and transform each pixel point q of the converted HSV image i =(H i , S i , V i ) as a three-dimensional feature vector: X i =(H i , S i , V i ), the above feature vector will be used as the input of the following K-means clustering;
[0093] K-mean clustering, using the K-means algorithm to cluster the above feature vector X i Divided into two clusters (k = 2), one cluster represents fluorescent spots and the other cluster represents background;
[0094] The specific process of the K-means algorithm is as follows:
[0095] Initial cluster centers: where r j is the index of randomly selected pixel points;
[0096] Distance calculation and allocation: for each pixel X i, calculate the Euclidean distance from its feature to each cluster center feature, and assign the pixel point to the nearest cluster center:
[0097] Update cluster centers: Update the center of each cluster to the mean of the pixels to which it belongs
[0098] Termination condition: When the change of cluster center is less than η, or the maximum number of iterations is reached, the iteration is stopped;
[0099] Extracting oil droplet fluorescence clusters: Distinguish the fluorescence spots from the background clusters by their average brightness (such as the V channel) to separate the clusters whose average brightness (V channel) is greater than the threshold V threshold The clusters of are taken as fluorescent point clusters;
[0100] Right now Where V(x, y) represents the V channel value at position (x, y), |C i | represents cluster C i The number of pixels;
[0101] Among them, C0 is the extracted oil droplet fluorescence cluster. If all clusters The value does not exceed the threshold V threshold , then there is no fluorescent spot; if the oil droplet fluorescence cluster can be extracted, further judgment is made;
[0102] Generate oil drop mask image M(x, y) (binary image): After K-means clustering, identify the clusters representing blue fluorescent spots, and then generate a binary image; for each pixel X i : Among them, C o represents the clustering of blue fluorescent dots;
[0103] Mask mapping: Map the mask back to the original HSV image and set the pixels that do not belong to the fluorescent point class to 0: Then I mask (x, y) = I HSV (x, y)·M(x, y); where, I mask (x, y) represents the HSV image retained according to the mask, and the remaining pixel values are 0; HSV (x, y) represents the HSV image converted from the original RGB image;
[0104] Threshold filtering: Perform pixel-by-pixel threshold filtering on the pixels behind the mask, make judgments based on the thresholds of the S and V channels, and set the threshold interval S min , S max , V min , V max :
[0105] Among them, M final (x, y) is the final binary image;
[0106] 4.3) Connected domain analysis and deletion;
[0107] The connected domain analysis of the oil drop mask image I(x, y) includes the following process:
[0108] Use the connected domain labeling algorithm to label all connected domains in the image. The labeling result is L(x, y), L(x, y) = Label(I(x, y)); where the value of L(x, y) represents the connected domain label to which the pixel I(x, y) belongs;
[0109] Calculate the area A of each connected domain k , Among them, k is the number of labels of the connected domain, A k represents the area of the kth connected domain, L k represents the connected domain with label k;
[0110] Delete the connected domains whose area is smaller than the preset threshold T; the preset threshold is set according to the specific application scenario, and finally obtain the image B of the retained connected domain f (x,y),
[0111] 4.4) Count the area A of the bright spot in the final image f , if the area exceeds a certain threshold A threshold , it is determined that there is an oil leak;
[0112] If A f >A threshold , it is determined that there is an oil leak.
[0113] As described above, step 4) performs efficient image processing to accurately extract specific color areas (oil droplet fluorescence) from the RGB image, and can effectively remove noise and small non-target areas, which is suitable for a variety of application scenarios that require specific color recognition and processing.
[0114] To further explain the present application, the above oil leakage detection means is used for visual detection of oil leakage under the four-way vehicle. Specifically:
[0115] Step 1: Use a UV light source with a specific wavelength to illuminate the leaked oil, stimulate the oil to produce fluorescence, and measure the fluorescence spectrum.
[0116] Step 2: Use the weighted peak partitioning method to select the bandpass range of the bandpass filter.
[0117] S1. Determine the position and height of each wave crest.
[0118] Peak 1: μ1 = 390 nm, h1 = 4.9 × 10 6
[0119] Peak 2: μ2 = 408 nm, h1 = 4.8 × 10 6
[0120] S2. Calculate the weighted average peak position
[0121]
[0122] S3. Set the band range ratio α = 2nm / 10 6 Counts, then the band range of each peak is: Δλ i =2*4.9=9.8nm, Δλ i =2*4.8=9.6nm, the maximum expansion range max(Δλ i )=9.8nm.
[0123] S4. Determine the comprehensive band range: λ min =398.9-9.8=389.1nm,λ max =398.9+9.8=408.7nm; the final comprehensive band range is [389.1nm, 408.7nm].
[0124] Step 3: The ultraviolet light source is set under the four-way vehicle to illuminate the potential oil leakage position of the mechanical equipment.
[0125] Step 4: The four-way vehicle equipment leaks oil during normal operation, and the oil produces fluorescence under ultraviolet light.
[0126] Step 5: The camera takes a picture through a filter to obtain a picture with only fluorescent bright spots.
[0127] Step 6: The image processing unit analyzes the image captured by the camera and determines whether there are fluorescent spots in the image, thereby determining that there is oil leakage under the four-way vehicle.
[0128] The above contents and the embodiments given in the accompanying drawings are only preferred solutions for achieving the purpose of the present invention. Those skilled in the art can be inspired by this and directly deduce other alternative structures that conform to the design concept of the present invention. Other structural features obtained thereby should also belong to the scope of the solution described in the present invention.
Claims
1. A method for detecting mechanical oil leakage based on fluorescence reaction, characterized in that: The following steps are included: Step 1), measuring fluorescence spectrum; Use ultraviolet light source to illuminate the oil product to be tested, stimulate the oil product to produce fluorescence and measure the fluorescence spectrum; Step 2), determine the bands of all main peak signal areas in the oil product fluorescence spectrum; Based on the weighted peak division method, the fluorescence band with higher response is weightedly intercepted; Step 3), collect image photos; A UV light source is set near the mechanical equipment and a camera is used to collect images of potential oil leak locations; Step 4), image processing and oil leak detection; If there is oil leakage during the normal operation of mechanical equipment, the oil will produce fluorescence under ultraviolet light, and the camera will take pictures through the front filter to obtain pictures with only fluorescent bright spots; The following fluorescence point extraction algorithm is applied to the image. If there are fluorescence points in the image, it is determined that the mechanical equipment has oil leakage; 4.1) Convert RGB image to HSV color space; Get the input RGB image and convert the RGB image to HSV color space; 4.2) Oil droplet mask extraction; Construct a feature vector and transform each pixel point q of the converted HSV image i =(H i , S i , V i ) as a three-dimensional feature vector: X i =(H i , S i , V i ), the above feature vector is used as the input of K-means clustering; K-mean clustering, using the K-means algorithm to cluster the above feature vector X i Divided into two clusters (k = 2), one cluster represents fluorescent spots and the other represents background; 4.3) Connected domain analysis and deletion; Perform connected domain analysis on the oil drop mask image I(x, y); 4.4) Count the area A of the bright spot in the final image f , If the area exceeds a certain threshold A threshold , that is, A f >A threshold , it is determined that there is oil leakage; otherwise, it is determined that there is no oil leakage.
2. The method for detecting mechanical oil leakage based on fluorescence reaction according to claim 1, characterized in that: The step 2) includes the following execution process: 2.1) Determine the position and height of each wave crest; From the fluorescence spectrum, we can know the position μ of each peak i and the corresponding height h i ; 2.2) Calculate the weighted average peak position; Using the peak height as the weight, calculate the weighted average μ of the peak position weighted , 2.3) Calculate the peak extension range; Set the band range ratio α and calculate the standard deviation range Δλ of each peak i , Δλ i =α·h i ; 2.4) Comprehensive band range; Combining all the peaks, the band range is determined as: l min =μ weighted -max(Dl i ),l max =μ weighted +max(Dl i ); Through the above steps, an overall band range covering all peaks is determined, and this band range includes the signal areas of all major peaks in the spectrum; this wavelength range is used as the selected bandpass filter range to eliminate ambient light interference, that is, only the light signal of the fluorescence reaction is received, that is, only the fluorescent oil droplets whose reflections meet the above wavelength range can be presented in the subsequently collected images.
3. The method for detecting mechanical oil leakage based on fluorescence reaction according to claim 1, characterized in that: In step 4.1), for each pixel point p i =(R i , G i , B i ), the converted HSV value q i =(H i , S i , V i ), converted by the following formula: C max =max(R i , G i , B i ), C min =mim(R i , G i , B i ), Then Δ=C max -C min ; Calculate the hue H, Calculate the saturation S. Calculate the brightness V, V i =C max ; Among them, each pixel p in the image i =(R i , G i , B i ) corresponds to q i =(H i , S i , V i ).
4. The method for detecting mechanical oil leakage based on fluorescence reaction according to claim 1, characterized in that: In step 4.2), the K-means algorithm process is as follows: Initial cluster centers: where r j is the index of randomly selected pixel points; Distance calculation and allocation: For each pixel X i , calculate the Euclidean distance from its feature to the feature of each cluster center, and assign the pixel point to the nearest cluster center: Update cluster centers: Update each cluster center to the mean of the pixels to which it belongs Termination condition: When the change of cluster center is less than η, or the maximum number of iterations is reached, the iteration is stopped; Extracting oil droplet fluorescence clusters: Distinguish the fluorescence spots from the background clusters by their average brightness (such as the V channel) to separate the clusters whose average brightness (V channel) is greater than the threshold V threshold The clusters of are taken as fluorescent point clusters; Where V(x, y) represents the V channel value at position (x, y), |C i | represents cluster C i The number of pixels; Among them, C0 is the extracted fluorescence cluster. If all clusters The value does not exceed the threshold V threshold , then there is no fluorescent spot; if the fluorescent cluster can be extracted, further judgment is performed; Generate a fluorescent mask image M(x, y) (binary image): After K-means clustering, identify the clusters representing the fluorescent spots and generate a binary image; for each pixel X i : Among them, C o represents the clustering of fluorescent spots; Mask mapping: Map the mask back to the original HSV image and set the pixels that do not belong to the fluorescent point class to 0: Then I mask (x, y) = I HSV (xy)·M(x, y); where I mask (x, y) represents the HSV image retained according to the mask, and the remaining pixel values are 0; HSV (x, y) represents the HSV image converted from the original RGB image; Threshold filtering: Perform pixel-by-pixel threshold filtering on the pixels behind the mask, make judgments based on the thresholds of the S and V channels, and set the threshold interval S min , S max , V min , V max : Among them, M final (x, y) is the final binary image.
5. The method for detecting mechanical oil leakage based on fluorescence reaction according to claim 1, characterized in that: The step 4.3) includes the following process: Use the connected domain labeling algorithm to label all connected domains in the image. The labeling result is L(x, y). L(x, y) = Label(I(x, y)); where the value of L(x, y) represents the connected domain label to which the pixel I(x, y) belongs; Calculate the area A of each connected domain k , Among them, k is the number of labels of the connected domain, A k represents the area of the kth connected domain, L k represents the connected domain with label k; Delete the connected domains whose area is smaller than the preset threshold T; the preset threshold is set according to the specific application scenario, and finally obtain the image B of the retained connected domain f (x, y),
Citation Information
Cited By
Method for detecting oil contamination of oil-filled equipment based on fluorescence reflection
CN121703067A
