An oil gum identification processing system and method based on hyperspectral imaging
By adding tiny particles to engine oil as tracers, and combining the Canny algorithm with a physical constraint spectral clustering method based on multi-feature fusion, the problem of inaccurate edge recognition of gum-like substances in hyperspectral imaging was solved, achieving accurate identification and segmentation of engine oil gum-like substances and providing real quality assessment data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TONGYI PETROLEUM CHEM CO LTD
- Filing Date
- 2025-07-02
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, the identification method for oil gum based on hyperspectral imaging has the problem of inaccurate edge recognition of gum, especially the detection accuracy of early trace gum is affected by noise and spectral distortion, resulting in unsatisfactory detection results.
A system and method for identifying and processing oil gum deposits based on hyperspectral imaging were developed. By uniformly adding tiny particles as tracers to the oil, hyperspectral images were acquired using an image acquisition module. Local pixel spectral distortion correction was performed by combining the Canny algorithm and the density of tiny particles. The edge pixels of the gum deposits were identified and corrected using a physical constraint spectral clustering method with multi-feature fusion, resulting in a complete image of the gum deposits.
It enables accurate identification and segmentation of oil gum deposits, providing a solid foundation for quality assessment data, reducing noise interference, enhancing spectral consistency, and improving the accuracy and completeness of detection.
Smart Images

Figure CN120876373B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of engine oil substance detection technology, and in particular to an engine oil gum substance identification and processing system and method based on hyperspectral imaging. Background Technology
[0002] Lubricating oil, especially engine oil for internal combustion engines, plays a crucial role in modern machinery, directly impacting equipment operating efficiency, reliability, and lifespan. During use, engine oil inevitably undergoes chemical reactions such as oxidation, nitration, and thermal cracking, and mixes with contaminants such as fuel, water, worn metal particles, and dust. Among these, the gum-like substances formed by oil oxidation are a key indicator of the oil's aging degree and remaining service life. These gum-like substances are mainly composed of large polar molecular compounds formed by the oxidation, polymerization, and condensation of unstable components in the oil (such as olefins and aromatics) under high temperature, oxygen, and metal catalysis. Excessive accumulation of these compounds can lead to a series of serious problems, including sludge formation, filter clogging, oil passage blockage, and piston ring sticking, ultimately causing accelerated equipment wear and even failure.
[0003] Therefore, rapid, accurate, online, or real-time monitoring of the gum content in engine oil is of great significance for achieving predictive maintenance based on oil condition, optimizing oil change intervals, and ensuring the safe and efficient operation of equipment. Current mainstream technologies (such as infrared spectroscopy and fluorescence spectroscopy) rely on the identification of characteristic peaks of chemical groups in gums. However, the spectra of gums in engine oil differ from those of engine oil itself due to the different spectral absorption characteristics of gums, leading to peak shifts or obliteration, significantly reducing detection accuracy. This is especially true for early trace amounts of gum (<0.5 wt%), whose weak spectral signals are easily masked by background noise.
[0004] Further research revealed that while hyperspectral imaging technology can provide combined spatial-spectral information, it has serious limitations in the edge recognition of gum-like substances. On the one hand, the sudden change in refractive index at the interface between the gum-like substance and the oil matrix causes local spectral distortion (such as the Mie scattering effect), leading traditional edge detection algorithms such as Canny to misidentify the distorted area as the boundary of the gum-like substance. On the other hand, when small noises (such as soot) accumulate in the edge region, they further distort the spectral curve, causing a surge in false edge pixels. For these reasons, the recognition effect of oil gum-like substances based on hyperspectral imaging is not ideal. Summary of the Invention
[0005] The purpose of this invention is to provide a system and method for identifying and processing oil residues based on hyperspectral imaging, which solves the aforementioned technical problems mentioned in the prior art.
[0006] This invention provides a system for identifying and processing oil residues based on hyperspectral imaging, comprising an image acquisition module, a preprocessing module, an identification and correction module, and a processing module.
[0007] The image acquisition module is used to acquire hyperspectral images of engine oil in which fine particles have been uniformly added in advance;
[0008] The preprocessing module is used to preprocess the hyperspectral image of engine oil to obtain a preprocessed hyperspectral image of engine oil.
[0009] The identification and correction module is used to perform local pixel spectral distortion correction on the preprocessed hyperspectral image of engine oil by combining the Canny algorithm with the density of small particles, so as to obtain the edge pixels of the gel.
[0010] The processing module is used to obtain an image of the gelatinous material based on the edge pixels of the gelatinous material.
[0011] In another aspect, the present invention provides a method for identifying and processing oil residues based on hyperspectral imaging, comprising the following steps:
[0012] Acquire hyperspectral images of engine oil in which fine particles have been uniformly added beforehand;
[0013] The hyperspectral image of engine oil is preprocessed to obtain the preprocessed hyperspectral image of engine oil.
[0014] The preprocessed hyperspectral image of engine oil was processed by the Canny algorithm combined with the density of small particles to perform local pixel spectral distortion correction, and the edge pixels of the gel were obtained.
[0015] The image of the gelatinous material is obtained based on the edge pixels of the gelatinous material.
[0016] Preferably, the preprocessed hyperspectral image of engine oil is processed using the Canny algorithm combined with the density of small particles to perform local pixel spectral distortion correction, resulting in the edge pixels of the gel-like material, including:
[0017] The gradient magnitude and gradient direction are calculated for each pixel in the preprocessed hyperspectral image of engine oil.
[0018] Candidate edge pixels are extracted based on gradient magnitude and gradient direction using a loose thresholding process;
[0019] The candidate edge pixels are screened by gradient magnitude and local spectral consistency to obtain the first gel-like material edge pixels and the gel-like material edge pixels;
[0020] The pixel distortion degree of the edge pixels of the gel-like material is calculated by analyzing the density distortion of local microparticles within a local window.
[0021] The spectral distortion of the edge pixels of the gel-like material is corrected by using the pixel distortion degree to obtain the corrected edge pixels of the gel-like material.
[0022] The corrected gel-like edge pixels are filtered out using a physical constraint spectrum clustering method with multi-feature fusion to obtain the second gel-like edge pixels;
[0023] The target gel edge pixels are obtained based on the edge pixels of the first gel and the edge pixels of the second gel.
[0024] Preferably, the pixel distortion of the edge pixels of the gel-like material is calculated as follows:
[0025] ;
[0026] In the formula, The density of tiny particles within the local window of the i-th class of gelatinous material edge pixel; G represents the global particle density; This is the normalization function; It is the natural logarithm; Let be the gradient magnitude of the i-th pixel at the edge of the gel-like material. Let be the gradient magnitude of the j-th neighboring pixel within the local window of the i-th gel-like edge pixel; This is due to local spectral intensity differences; is the average distortion of the neighboring pixels of the i-th gel-like edge pixel; 8 represents the 8 neighboring pixels of the i-th gel-like edge pixel; , These are the weighting coefficients, and their sum is 1;
[0027] Preferably, the corrected gel-like edge pixels are filtered to obtain the second gel-like edge pixels using a physical constraint spectrum clustering method with multi-feature fusion, including the following steps:
[0028] The gradient magnitude and pixel distortion are extracted from the edge pixels of the corrected gel-like material.
[0029] The dynamic bandwidth parameter of the b-th corrected gel-like edge pixel is obtained by calculating the gradient magnitude of the corrected gel-like edge pixel and the b-th neighboring corrected gel-like edge pixel in the neighborhood of the corrected gel-like edge pixel.
[0030] Based on the dynamic bandwidth parameters, a similarity matrix is constructed between the a-th corrected gel-like edge pixel and the b-th corrected neighboring gel-like edge pixel in the neighborhood of the a-th corrected gel-like edge pixel.
[0031] Based on the similarity matrix, an angle matrix D is constructed; based on the angle matrix and the similarity matrix, a graph Laplacian matrix is constructed; the graph Laplacian matrix is solved by feature system to obtain a symmetric normalized Laplacian matrix.
[0032] The embedding space is constructed by extracting the first k non-zero eigenvectors based on the symmetric normalized Laplacian matrix.
[0033] Within the embedded space, the corrected gel-like edge pixels are clustered to obtain the second gel-like edge pixels.
[0034] Preferably, the corrected gel-like edge pixels within the embedding space are clustered to obtain second gel-like edge pixels, including the following steps:
[0035] Randomly select any k corrected gel-like edge pixels as cluster centers; calculate the gel-like adaptive distance to the cluster center for each corrected gel-like edge pixel; cluster the corrected gel-like edge pixels based on the gel-like adaptive distance to obtain multiple initial clusters;
[0036] The corrected gel-like edge pixels are selected based on the initial cluster, the gradient magnitude of the corrected gel-like edge pixels, and the pixel distortion of the corrected gel-like edge pixels to obtain the gel-like edge repair reference pixels;
[0037] Obtain multiple neighboring reference pixels of the reference pixel for edge repair of the gel-like material;
[0038] The spectral continuity factor is calculated based on the spectral vector of the reference pixel for edge repair of the gel material and the spectral vector of the neighboring reference pixels.
[0039] When the spectral continuity factor is determined to be greater than or equal to a preset spectral continuity factor threshold, the reference pixel for repairing the edge of the gelatinous material is merged into the initial cluster to which the neighboring reference pixel belongs, thus obtaining the first cluster.
[0040] Obtain the spectral vectors of each of the corrected gel-like edge pixels; perform connectivity analysis on the first cluster based on the spectral vectors and perform clustering and filtering again to obtain the target second gel-like edge pixels.
[0041] Preferably, the selection method for the reference pixel for repairing the gel-like edge is as follows: the gradient magnitude of the corrected gel-like edge pixel is greater than or equal to the gradient magnitude threshold, and the neighboring pixels of the corrected gel-like edge pixel include corrected gel-like edge pixels in an initial cluster other than the initial cluster of the currently corrected gel-like edge pixel, and the absolute value of the pixel distortion difference between the corrected gel-like edge pixel and each of the corrected gel-like edge pixels in the neighboring pixels of the corrected gel-like edge pixel is less than or equal to the absolute value threshold of the pixel distortion difference.
[0042] Preferably, based on the spectral vector, connectivity analysis is performed on the first cluster, followed by further clustering and filtering to obtain the edge pixels of the target second gelatinous substance, including the following steps:
[0043] The mean spectral vector of each corrected gel-like edge pixel in the first cluster is calculated;
[0044] The spectral deviation of each of the corrected gel-like material edge pixels is calculated based on the mean of the spectral vector; when the spectral deviation is less than or equal to the spectral deviation threshold, the corrected gel-like material edge pixel is determined as the second gel-like material edge pixel to be determined.
[0045] In the first cluster, connectivity analysis is performed on the edge pixels of the second gelatinous material to be determined to obtain multiple gelatinous material connected regions. Based on the area of the gelatinous material connected regions, re-clustering is performed to obtain multiple second clusters.
[0046] Obtain the number of pixels within the second cluster; sort the second clusters from high to low based on the number of pixels within the cluster to obtain a second cluster sequence; select the first d second clusters in the second cluster sequence as the third cluster;
[0047] The target second gel edge pixel is obtained by analyzing and filtering the spectral vectors of each undetermined second gel edge pixel in each second cluster other than the third cluster.
[0048] Preferably, the target second gel edge pixels are obtained by analyzing and filtering based on the spectral vectors of each undetermined second gel edge pixel in the third cluster and the spectral vectors of each undetermined second gel edge pixel in each second cluster other than the third cluster, including the following steps:
[0049] The mean value of the spectral vector of the gelatinous material at the edge of the second gelatinous material in all the third clusters to be determined is calculated;
[0050] The absolute value of the difference between the spectral vectors is calculated based on the mean of the spectral vector of the gel and the spectral vector of each edge pixel of the second gel in each second cluster (excluding the third cluster).
[0051] When the absolute value of the spectral vector difference corresponding to each undetermined gelatinous material edge pixel in each of the second clusters (excluding the third cluster) is greater than or equal to the absolute value threshold of the spectral vector difference, and the proportion of undetermined gelatinous material edge pixels in the corresponding second cluster is greater than or equal to the proportion threshold, the second cluster is filtered out, and the undetermined second gelatinous material edge pixels in the deleted second cluster and the third cluster are the target second gelatinous material edge pixels.
[0052] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:
[0053] Analysis of the above-mentioned system and method for identifying and processing oil gum based on hyperspectral imaging provided by this invention reveals that, in practical applications, firstly, tiny particles are uniformly distributed in the oil and oil gum as "tracers" or "internal standards" to detect, identify, and locate the gum. Furthermore, since the original hyperspectral image of the oil inevitably contains various noises and invalid information, preprocessing is required to reduce noise interference and enhance spectral consistency, providing a standard data foundation for accurate identification of the oil gum image. Subsequently, the preprocessed hyperspectral image is corrected using the Canny algorithm combined with the density distribution of tiny particles in the hyperspectral image. Due to pixel distortion caused by the oil gum, the edge pixels of the oil gum can be identified through the above processing method. Finally, the edge pixels of the oil gum are segmented to obtain a complete and clear image of the oil gum, providing a true data foundation for oil quality assessment. Attached Figure Description
[0054] Figure 1 This is a schematic diagram of the overall architecture of a hyperspectral imaging-based oil gum identification and processing system according to Embodiment 1 of the present invention;
[0055] Figure 2 This is a schematic diagram of the main process of a method for identifying and processing oil gum based on hyperspectral imaging according to Embodiment 2 of the present invention;
[0056] Figure 3This is a schematic diagram simulating the distortion of the hyperspectral image of engine oil caused by the spectral distortion caused by tiny particles in engine oil gum, in a method for identifying and processing engine oil gum based on hyperspectral imaging according to Embodiment 2 of the present invention.
[0057] Figure 4 This is a schematic diagram simulating the edge pixels of gum-like substances and the edge pixels of gum-like substances in a method for identifying and processing oil gum-like substances based on hyperspectral imaging according to Embodiment 2 of the present invention.
[0058] Figure 5 This is a schematic diagram of spectral distortion correction in a method for identifying and processing oil gum based on hyperspectral imaging according to Embodiment 2 of the present invention.
[0059] Figure 6 This is a schematic diagram of the second cluster in a method for identifying and processing oil gum based on hyperspectral imaging according to Embodiment 2 of the present invention. Detailed Implementation
[0060] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0061] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings.
[0062] Example 1
[0063] like Figure 1 As shown, Embodiment 1 of the present invention provides a system for identifying and processing oil residues based on hyperspectral imaging, including an image acquisition module 10, a preprocessing module 20, an identification and correction module 30, and a processing module 40.
[0064] The image acquisition module 10 is used to acquire hyperspectral images of engine oil in which small particles have been uniformly added in advance.
[0065] The preprocessing module 20 is used to preprocess the hyperspectral image of engine oil to obtain a preprocessed hyperspectral image of engine oil.
[0066] The identification and correction module 30 is used to perform local pixel spectral distortion correction processing on the preprocessed engine oil hyperspectral image by combining the Canny algorithm with the density of small particles to obtain the edge pixels of the gel.
[0067] The processing module 40 is used to obtain an image of the gelatinous material based on the edge pixels of the gelatinous material.
[0068] In summary, in the first embodiment of this application, tiny particles are first uniformly distributed in the engine oil and oil gum as "tracers" or "internal standards" to detect, identify, and locate the gum. The image acquisition module 10 manipulates the hyperspectral image of the engine oil with uniformly added tiny particles. Furthermore, since the original hyperspectral image of the engine oil inevitably contains various noises and invalid information, it needs to be preprocessed by the preprocessing module 20 to reduce noise interference and enhance spectral consistency, providing a standard data basis for the subsequent accurate identification of the oil gum image. Subsequently, the identification and correction module 30 corrects the preprocessed hyperspectral image of the engine oil by combining the density distribution of tiny particles in the hyperspectral image with the Canny algorithm. Because of the pixel distortion caused by the oil gum, the edge pixels of the oil gum can be identified by the above processing method. Finally, the processing module 40 segments the oil gum according to the edge pixels to obtain a complete and clear image of the oil gum, providing a real data basis for the quality assessment of the engine oil.
[0069] Example 2
[0070] like Figure 2 As shown, Embodiment 2 of the present invention provides a method for identifying and processing oil residues based on hyperspectral imaging, comprising the following steps:
[0071] Step S10: Acquire hyperspectral images of engine oil with pre-mixed microparticles;
[0072] It should be noted that before acquiring the hyperspectral image of the engine oil, microparticles need to be added to the engine oil to ensure that the microparticles are evenly distributed in the engine oil and the oil gum. (For example, oleophobic (oil-soluble) modification of polystyrene microspheres, polymethyl methacrylate (PMMA) microspheres, or silica nanospheres can effectively enhance their compatibility with engine oil and oil gum, and prevent aggregation or sedimentation due to differences in interfacial tension.)
[0073] By uniformly distributing microparticles in engine oil (including uniformly distributing them within the oil and the gum deposits present in the oil), the distortion of the hyperspectral image of the engine oil caused by the spectral distortion caused by the gum deposits can be accurately identified during subsequent processing. Figure 3 As shown in the figure, this allows for accurate identification of gum-like substances in the engine oil.
[0074] Step S20: Preprocess the hyperspectral image of the engine oil to obtain the preprocessed hyperspectral image of the engine oil;
[0075] Step S30: The preprocessed hyperspectral image of engine oil is processed by the Canny algorithm combined with the density of small particles to perform local pixel spectral distortion correction to obtain the edge pixels of the gel.
[0076] Step S40: Obtain an image of the gum based on the edge pixels of the gum (this is necessary to accurately identify the gum in the engine oil).
[0077] It should be noted that when microparticles are uniformly distributed in engine oil and its gum-like substances, the different spectral absorption characteristics of the gum-like substances and engine oil (engine oil is a homogeneous substance, while engine oil gum-like substances are viscous substances produced by chemical changes in engine oil under high temperature, oxidation, and other factors, and have different absorption characteristics in different spectral bands) cause changes in the reflection spectrum of the oil gum-like substances and engine oil in the Lego spectral image, resulting in a visual distortion. This distortion causes a density distortion of the uniformly distributed microparticles, which seriously affects the effective identification of the gum-like substance boundary. In this embodiment, microparticles are uniformly distributed in the engine oil and its gum-like substances as "tracers" or "internal standards" to detect, identify, and locate the gum-like substances. Further, the original Hyperspectral images of engine oil inevitably contain various noises (such as sensor noise, uneven illumination, carbon soot, etc.) and invalid information (such as background, image edges). This application preprocesses the hyperspectral images of engine oil to reduce noise interference and enhance spectral consistency, providing a standard data foundation for the subsequent accurate identification of oil gum deposits. Furthermore, the preprocessed hyperspectral images are processed using the Canny algorithm, combined with the density distribution of microparticles in the hyperspectral image, to correct distortion (specifically, the pixel distortion caused by oil gum deposits in the hyperspectral image). This identifies the edge pixels of the oil gum deposits. Finally, segmentation is performed based on the edge pixels of the oil gum deposits to obtain a complete and clear image of the oil gum deposits, providing a reliable data foundation for engine oil quality assessment.
[0078] Specifically, in S30, the preprocessed hyperspectral image of engine oil is processed using the Canny algorithm combined with the density of small particles to perform local pixel spectral distortion correction, resulting in the edge pixels of the gel-like material, including:
[0079] Step S31: Extract and calculate the gradient magnitude and gradient direction of each pixel in the preprocessed hyperspectral image of engine oil;
[0080] Step S32: Extract candidate edge pixels based on gradient magnitude and gradient direction using loose thresholding;
[0081] Step S33: The candidate edge pixels are screened by gradient magnitude and local spectral consistency to obtain the first gel-like edge pixels and the gel-like edge pixels;
[0082] Steps S31-S33 above execute the Canny algorithm described above, and finally filter by gradient magnitude and local spectral consistency to obtain the first gel-like edge pixels and the gel-like edge pixels. First, the boundary of the gel-like substance will cause a spectral abrupt change. The larger the gradient magnitude, the more likely it is to be an edge point (such as the interface between the gel-like substance and the engine oil). Therefore, this embodiment calculates the gradient magnitude (intensity of change) and gradient direction (trend of change) of the spectral features of each pixel as the basis for the initial edge detection. Further, based on the gradient magnitude and gradient direction, the initial edge detection is performed by using a loose threshold to ensure that potential gel-like edge pixels are not missed. Then, the local spectral consistency is used to distinguish typical gel-like edge pixels that can be directly identified as gel-like substances from less certain (possibly due to interference or gel-like edge pixels) gel-like edge pixels. Specifically, pixels with high gradient amplitudes and strong spectral consistency in their neighborhood can be directly identified as edges of gel-like substances. This is because they exhibit significant differences from engine oil in hyperspectral images, i.e., high gradient amplitudes, and strong spectral consistency in their neighborhood. The spectral distortion of genuine gel-like substances at their edges shows local continuity, while noise or artifacts appear random (e.g., ...). Figure 4 As shown in the figure, the circled area represents the spectral vector of the pixel. It can be seen intuitively that the pixels at the edge of the gelatinous substance are lighter-colored areas with strong neighborhood spectral consistency, while the darker areas are pixels at the edge of the gelatinous substance with random and inconsistent spectral vectors. Then, further analysis is performed on the less certain pixels at the edge of the gelatinous substance to obtain the accurate pixels at the edge of the gelatinous substance (see steps S34-S37 for details).
[0083] Step S34: Calculate the pixel distortion degree of the edge pixels of the gel-like material within the local window by performing local micro-particle density distortion analysis within the local window;
[0084] The pixel distortion of the edge pixels of the gel-like material is calculated as follows:
[0085] ;
[0086] In the formula, The density of tiny particles within the local window of the i-th class of gelatinous material edge pixel; G represents the global particle density; This is the normalization function; It is the natural logarithm; Let be the gradient magnitude of the i-th pixel at the edge of the gel-like material. Let be the gradient magnitude of the j-th neighboring pixel within the local window of the i-th gel-like edge pixel; This is due to local spectral intensity differences; is the average distortion of the neighboring pixels of the i-th gel-like edge pixel; 8 represents the 8 neighboring pixels of the i-th gel-like edge pixel; , These are the weighting coefficients, and their sum is 1;
[0087] It should be noted that in step S10 above, the microparticles are uniformly distributed in the engine oil and its gum-like substances. Therefore, in reality, the local density of microparticles in the engine oil and its gum-like substances is consistent. However, due to the spectral absorption characteristics of the gum-like substances captured by the spectral camera, the density of microparticles at the gum-like substances in the engine oil will be distorted. Therefore, this embodiment calculates the distortion of the edge pixels of the gum-like substances by observing the distribution of microparticles in the engine oil and its gum-like substances in the spectral image, thus avoiding the distortion of the edge pixels of the gum-like substances caused by the engine oil gum-like substances, which would lead to errors in the extraction of the gum-like substance image.
[0088] In the calculation of pixel distortion at the edge of the gel-like material in the above embodiments of this application, firstly, because the boundary of the gel-like material distorts the gradient field, the gradient amplitude of the edge point differs from its neighborhood. If the pixel is located at the edge of a real gel-like material, its gradient amplitude should systematically deviate from its neighborhood (e.g., the gradient amplitude is increased due to absorption by the gel-like material). Therefore, the embodiments of this application... By averaging the differences in the neighborhood, single-point noise is eliminated, enhancing the robustness of identifying pixels at the edges of gelatinous objects.
[0089] Furthermore, local spectral intensity differences (Representing the intensity difference in spectral absorption between the gel-like substance and the engine oil) and the density of tiny particles within the local window of the i-th gel-like substance edge pixel. (Imaging density in areas covered by gelatinous material (artificially high due to absorption effect)), the stronger the absorption of the gelatinous material, the darker the image of the covered area, and the more densely packed the same number of particles appear (density distortion); utilizing The density-spectral coupling term is obtained only when significant absorption is present simultaneously ( Larger) and virtual high density ( Only when the distortion is relatively large is it considered a gelatinous object distortion; furthermore, if the neighborhood is full of high-distortion points, the distortion of the current point needs to be relatively reduced (to avoid overall overestimation). The distortion of the gelatinous object region has spatial continuity, and isolated high values are more likely to be noise. By calculating the average distortion of the neighborhood, if the neighborhood is full of high-distortion points, the distortion of the current point needs to be relatively reduced (to avoid overall overestimation as edge pixels of the gelatinous object); furthermore, the global micro-particle density is used. The global density is normalized to a global baseline to eliminate scale differences caused by the overall uneven density of tiny particles in hyperspectral images.
[0090] Furthermore, since the optical attenuation model itself is exponential, logarithmic linearization is easier to process. In this embodiment, the natural logarithm is used to convert multiplicative distortion (such as spectral absorbance) into an additive term, compressing the dynamic range and avoiding extreme values from dominating the calculation. At the same time, the normalization function is used to map the distortion to the [0,1] interval, unifying the dimensions and facilitating the setting of a unified threshold for distortion correction.
[0091] In the above embodiments of this application, since the spectral difference between engine oil and engine oil gum is weak, this embodiment analyzes the pixel distortion caused by engine oil gum by detecting the density distortion generated during imaging of tiny particles. For the artifacts of high density in tiny particles, this embodiment uses... To distinguish between true distortion and the true degree of microparticle aggregation; and, using gradient terms Quantize boundary abrupt changes, combined with the average distortion of neighboring pixels of the gel-like edge pixel. Quantify spatial continuity to accurately locate edge pixels of oily residue; and use the average calculation of neighborhood gradient difference to suppress isolated noise and prevent interference from optical noise.
[0092] Finally, when the calculated pixel distortion is approximately 0, it can be determined that the pixels at the edge of this type of gelatinous material are actually pixels located in engine oil. When the pixel distortion is greater than 0, it proves that the pixels at the edge of this type of gelatinous material exhibit significant spectral-density coupling effects due to drastic changes in the gradient field, and that there is no systematic high distortion in the neighborhood (in the case of systematic high distortion, it would be...). (Inhibition) revealed that it was located at the edge of the gelatinous substance.
[0093] Step S35: Perform spectral distortion correction on the edge pixels of the gel-like material using pixel distortion to obtain the corrected edge pixels of the gel-like material;
[0094] It should be noted that, as Figure 5 As shown, the above-described embodiment of this application corrects the edge pixels of the gel-like material in the hyperspectral image of engine oil by measuring the pixel distortion degree of the edge pixels in the image, thus obtaining pixel information that truly matches the actual engine oil image. This prevents the pixels near the gel-like material in the hyperspectral image from being distorted due to the spectral absorption characteristics of the gel-like material, thereby preventing extraction errors of the edge pixels of the gel-like material. After obtaining the pixel distortion degree, the above-described embodiment of this application performs correction processing on the edge pixels of the gel-like material with a pixel distortion degree greater than 0 (which are located at the edge of the gel-like material). Specifically, the correction operation is to use spectral intensity compensation to counteract the light intensity attenuation caused by the absorption of the gel-like material (the exponential form corresponds to Beer's Law), that is, using the formula:
[0095] ;
[0096] Optical compensation reverses optical attenuation caused by colloidal absorption and corrects the imaging density distortion of tiny particles in hyperspectral images.
[0097] Step S36: The corrected gel-like edge pixels are filtered to obtain the second gel-like edge pixels by using a physical constraint spectrum clustering method with multi-feature fusion;
[0098] Step S37: Obtain the target gel edge pixel based on the first gel edge pixel and the second gel edge pixel.
[0099] It should be noted that the above-described embodiments of this application first utilize Canny detection to calculate the gradient magnitude (spectral change intensity) and gradient direction (change trend) of each pixel, and extract candidate edges using a loose threshold. Then, the candidate edges are screened using spectral consistency to obtain edge pixels that can be identified as oil gum and gum-like edge pixels that need further verification. Further, the degree of imaging distortion caused by gum is quantified by calculating the pixel distortion, providing a basis for correction. Then, spectral distortion correction is performed based on the pixel distortion to eliminate the geometric distortion of the gum region. Next, multi-feature fusion clustering is used to remove points that still do not conform to the characteristics of gum after correction (such as residual noise), obtaining second gum edge pixels. Finally, based on the combination of all gum edge pixels and second gum edge pixels, the gum edge pixels are obtained, thereby extracting a complete image of oil gum in the further processing.
[0100] Specifically, in step S36, the corrected gel-like edge pixels are filtered to obtain the second gel-like edge pixels using a physical constraint spectrum clustering method with multi-feature fusion, including the following steps:
[0101] Step S361: Extract the gradient magnitude and pixel distortion of the edge pixels of the corrected gel-like material;
[0102] Step S362: Calculate the dynamic bandwidth parameter of the b-th corrected colloidal edge pixel by using the gradient magnitude for the corrected colloidal edge pixel and the b-th neighboring corrected colloidal edge pixel in the neighborhood of the corrected colloidal edge pixel.
[0103] The dynamic bandwidth parameter is calculated as follows:
[0104] ;
[0105] in, Let be the gradient magnitude of the a-th corrected gel-like edge pixel; Let be the gradient magnitude of the b-th neighboring corrected gel-like edge pixel among the 8 neighboring pixels of the a-th corrected gel-like edge pixel; These are the 8 neighboring pixels of the a-th corrected gel-like edge pixel;
[0106] It should be noted that the aforementioned dynamic bandwidth parameter refers to the average local variation intensity of the current pixel and its 8 neighboring pixels in the three-dimensional feature space. To adapt to the non-uniform diffusion characteristics of the gel-like material edge, the processing operation of calculating the dynamic bandwidth parameter in the embodiments of this application automatically increases the bandwidth in the high gradient change region of the three-dimensional feature vector (i.e., when the gradient magnitude difference is large) to avoid over-segmentation; conversely, when the gradient magnitude difference is small, the bandwidth can be controlled to decrease to improve sensitivity.
[0107] Step S363: Based on the dynamic bandwidth parameter, construct a similarity matrix between the a-th corrected gel-like edge pixel and the b-th neighboring corrected gel-like edge pixel of the a-th corrected gel-like edge pixel; the similarity matrix is expressed as:
[0108] ;
[0109] When the distortion of two pixels is significantly different ( A similarity score >0.5 indicates that the substances are in different physical states (e.g., gum-like substances vs. pure engine oil), thus forcibly reducing their similarity.
[0110] In the transition zone at the edge of the gelatinous material ( <0.2), maintaining high similarity to form continuous edges;
[0111] Step S364: Construct the pair angle matrix D based on the similarity matrix; construct the graph Laplacian matrix based on the pair angle matrix and the similarity matrix; solve the graph Laplacian matrix using the feature system to obtain the symmetric normalized Laplacian matrix;
[0112] Step S365: Extract the first k non-zero eigenvectors based on the symmetric normalized Laplacian matrix to form the embedding space;
[0113] Step S366: Within the embedding space, the corrected gel-like edge pixels are clustered to obtain the second gel-like edge pixels.
[0114] It should be noted that the above embodiments of this application first extract the gradient magnitude and pixel distortion of each corrected gel-like object edge pixel to provide a basis for separability in subsequent clustering processing; then, the dynamic bandwidth parameter of each corrected gel-like object edge pixel is calculated by using the gradient magnitude. When the gradient magnitude difference is large, the dynamic bandwidth parameter is increased to break down continuous edges (such as the edge between engine oil gel and engine oil) into fragments, avoiding over-segmentation caused by abrupt feature changes; when the gradient magnitude difference is small, the dynamic bandwidth is reduced to improve the detection sensitivity of edges with weak differences (such as the junction between tiny gel-like clumps and engine oil). Therefore, the above processing operation can utilize the non-uniform diffusion characteristics of adaptive gel edges to ensure that the clustering results conform to physical reality.
[0115] Furthermore, by calculating similarity based on gradient magnitude and pixel distortion, the continuity of geometric features is ensured. Then, by using the similarity matrix to construct the angle matrix, the graph Laplacian matrix is constructed using the angle matrix and the similarity matrix, and the graph Laplacian matrix is solved for feature system processing. This reduces the three-dimensional feature vector to a more discriminative low-dimensional space, removing noise and highlighting the clustering structure of the gelatinous material edges. By extracting the first k non-zero feature vectors from the normalized Laplacian matrix to construct the embedding space, the main structure of the data is preserved and high-frequency noise (such as isolated points) is filtered out. Analysis shows that in this low-dimensional space of the constructed embedding space, the gelatinous material edge points are closely clustered due to similar physical properties, which facilitates separation. Pixels are clustered in the embedding space (e.g., K-means), and the category belonging to the gelatinous material edge is output, namely the second gelatinous material edge pixel. After distortion correction, the second gelatinous material edge pixel satisfies geometric continuity and physical consistency, improving the accuracy of subsequent complete gelatinous material image extraction.
[0116] Specifically, in step S366, the corrected gel-like edge pixels within the embedding space are clustered to obtain second gel-like edge pixels, including the following steps:
[0117] Step S3661: Randomly select any k corrected gel-like edge pixels as cluster centers; calculate the gel-like adaptive distance to the cluster center for each corrected gel-like edge pixel; cluster the corrected gel-like edge pixels based on the gel-like adaptive distance to obtain multiple initial clusters;
[0118] The adaptive distance of the gelatinous material is calculated as follows:
[0119] ;
[0120] In the formula, is the feature vector of the m-th corrected gel-like edge pixel; The feature vector of the nth cluster center; This represents the gradient magnitude-weighted Euclidean distance; Let be the pixel distortion of the m-th corrected gel-like edge pixel; Let be the pixel distortion of the nth cluster center; , These are the weighting coefficients, and + =1;
[0121] It should be noted that, in the above embodiments of this application, the use of In the transition region (high gradient region) at the edge of the gel-like material, the sensitivity to differences in spectral features is enhanced to ensure tight aggregation of edge pixels, utilizing... The smaller the difference in the physical distortion of the gelatinous material, the more similar the two are in physical state (such as the edges of gelatinous materials).
[0122] Step S3662: Select the reference pixel for gelatinous material edge repair based on the initial cluster, the gradient magnitude of the corrected gelatinous material edge pixel, and the pixel distortion of the corrected gelatinous material edge pixel;
[0123] The selection method for the reference pixel for gelatinous material edge repair is as follows: the gradient magnitude of the corrected gelatinous material edge pixel is greater than or equal to the gradient magnitude threshold (for gelatinous material edge pixels in areas with obvious boundaries), and simultaneously, the neighboring pixels of the corrected gelatinous material edge pixel contain corrected gelatinous material edge pixels in an initial cluster other than the initial cluster of the currently corrected gelatinous material edge pixel (i.e., there is at least one corrected gelatinous material edge pixel belonging to another initial cluster in the neighborhood of the corrected gelatinous material edge pixel, indicating that the corrected gelatinous material edge pixel is at the cluster boundary), and simultaneously, the absolute value of the pixel distortion difference between the corrected gelatinous material edge pixel and each of the corrected gelatinous material edge pixels in the neighboring pixels of the corrected gelatinous material edge pixel is less than or equal to the absolute value threshold of the pixel distortion difference (ensuring that the selected corrected gelatinous material edge pixel is not in an area of drastic distortion).
[0124] Step S3663: Obtain multiple neighboring reference pixels of the reference pixel for repairing the edge of the gelatinous material (neighboring reference pixels refer to the reference pixels for repairing the edge of the gelatinous material within the neighborhood of the reference pixel for repairing the edge of the gelatinous material).
[0125] Step S3664: Calculate the spectral continuity factor based on the spectral vector of the reference pixel for edge repair of the gel and the spectral vector of the neighboring reference pixels;
[0126] The spectral continuity factor is calculated as follows:
[0127] ;
[0128] In the formula, Let r be the spectral vector of the reference pixel for edge repair of the gel-like material; The spectral vector of the neighboring reference pixels of the reference pixel for edge repair of the r-th gel-like material; This is the spectral similarity sensitivity coefficient;
[0129] Step S3665: When it is determined that the spectral continuity factor is greater than or equal to the preset spectral continuity factor threshold, the reference pixel point for repairing the edge of the gel material is merged into the initial cluster to which the neighboring reference pixel point belongs, and a first cluster is obtained.
[0130] It should be noted that after the initial clustering, due to factors such as spectral noise or local anomalies, the edges of the gelatinous material may exhibit breaks or discontinuities. The embodiments of this application utilize spatial, gradient, and spectral continuity analysis to re-cluster the reference pixels for repairing the edges of the gelatinous material, thereby obtaining the first cluster cluster. This achieves the repair processing of the continuity breaks of the gelatinous material edges, thereby improving the accuracy of subsequent judgment and selection of the second gelatinous material edge pixels and preventing selection errors of the second gelatinous material edge pixels caused by the breaks in the gelatinous material edges.
[0131] Step S3666: Obtain the spectral vector of each of the corrected gel-like edge pixels; perform connectivity analysis on the first cluster based on the spectral vector and perform clustering and filtering again to obtain the target second gel-like edge pixels.
[0132] It should be noted that the above-described embodiments of this application use k randomly selected cluster centers to cluster the corrected gel-like edge pixels based on the gel-like adaptive distance from each corrected edge pixel to the cluster center, resulting in multiple initial clusters. Then, by selecting repair reference points, the edge break points that need to be bridged are accurately located, while unreliable regions (such as high distortion regions) are excluded. Further, neighboring reference points are extracted from the repair reference points to provide spatial information for connecting the broken edges. The spectral continuity factor is calculated using the spectral vectors of the neighboring reference points and the spectral vectors of the repair reference points to quantify the spectral difference between the repair reference points and the neighboring reference points. If the spectral continuity factor for the repair reference point is greater than the spectral continuity factor threshold, it indicates that the current pixel and the neighboring pixels are highly similar in spectrum, thereby reassigning the pixel to its original initial cluster in the neighborhood to obtain the first cluster, achieving the purpose of repairing the edge break. Next, the spectral vectors of each corrected gel-like edge pixel are used to perform connectivity analysis and re-clustering and filtering on the first cluster to obtain the target second gel-like edge pixel.
[0133] Specifically, in step S3666, connectivity analysis is performed on the first cluster based on the spectral vector, and clustering and filtering are performed again to obtain the edge pixels of the target second gelatinous substance, including the following operation steps:
[0134] Step S36661: Calculate the mean spectral vector of each corrected gel-like edge pixel in the first cluster;
[0135] Step S36662: Calculate the spectral deviation of each corrected gel-like material edge pixel based on the mean of the spectral vector (i.e., calculate the absolute value of the difference between each corrected gel-like material edge pixel and the mean of the spectral vector); when the spectral deviation is less than or equal to the spectral deviation threshold, determine the corrected gel-like material edge pixel as the second gel-like material edge pixel to be determined.
[0136] It should be noted that when the spectral deviation is greater than the spectral deviation threshold, it indicates that the corrected gel-like edge pixel differs significantly from the spectral features in the first cluster. Therefore, it can be regarded as noise or a pseudo edge pixel, and the corrected gel-like edge pixel is screened out. The remaining corrected gel-like edge pixels are then identified as the second gel-like edge pixels to be determined.
[0137] Step S36663: In the first cluster, connectivity analysis is performed on the edge pixels of the second gelatinous material to be determined to obtain multiple gelatinous material connected regions. Based on the area of the gelatinous material connected regions (the area of the gelatinous material connected regions is determined by the number of edge pixels of the second gelatinous material to be determined in each gelatinous material connected region), re-clustering is performed to obtain multiple second clusters.
[0138] It should be noted that the above-mentioned re-clustering refers to, when the area of the colloidal connected region is less than the colloidal connected region area threshold, re-clustering the undetermined second colloidal edge pixels in the colloidal connected region using the clustering processing method described in step S3662, resulting in multiple second clusters. Multiple colloidal connected regions whose area is greater than or equal to the colloidal connected region area threshold are directly used as second clusters (i.e., the undetermined second colloidal edge pixels in the colloidal connected region whose area is greater than or equal to the colloidal connected region area threshold collectively constitute the second cluster). For regions with low area (number of pixels)... Within a preset small block, there may be noise points or isolated segments of gelatinous material caused by pixel distortion. Therefore, these blocks are re-clustered to obtain a second cluster of noise points and a second cluster composed of undetermined second gelatinous edge pixels of isolated gelatinous segments. Gelatinous connected regions whose area is greater than or equal to a threshold value are considered to have higher aggregation of gelatinous edge pixels relative to these noise points or isolated gelatinous segments, resulting in more stable spectral performance; therefore, these are directly used as the second cluster. In summary, this application embodiment has obtained multiple second clusters. Among these multiple second clusters, such as... Figure 6 As shown, the second cluster consists of noise points, isolated fragments of gelatinous material, and pixels that can be identified as edges of the second gelatinous material. In the subsequent analysis and processing, the second cluster consisting of noise points needs to be analyzed and screened out to obtain a second cluster consisting only of pixels at the edges of the second gelatinous material.
[0139] Step S36664: Obtain the number of pixels within the second cluster; sort the second clusters from high to low based on the number of pixels within the cluster to obtain a second cluster sequence; select the first d second clusters in the second cluster sequence as the third cluster;
[0140] Step S36665: Based on the spectral vectors of each undetermined second gel edge pixel in the third cluster, and combined with the spectral vectors of each undetermined second gel edge pixel in each second cluster (excluding the third cluster), the target second gel edge pixel is obtained by analysis and screening.
[0141] It should be noted that, in the above embodiments of this application, the mean spectral vector of each corrected gel-like edge pixel in the first cluster is first calculated to establish the basis for determining spectral consistency and provide a reference for subsequent spectral deviation analysis; then, the spectral deviation is calculated by comparing the spectral vector of each corrected gel-like edge pixel with the mean spectral vector, and the second gel-like edge pixels to be determined are selected and retained based on the spectral deviation, while noise or pseudo-edge pixels are removed; then, connectivity analysis is performed on the second gel-like edge pixels to be determined, by connecting spatially adjacent second gel-like edge pixels to be determined. The system identifies multiple connected regions of the gelatinous material. Large connected regions are preserved (real gelatinous material edges have spatial continuity and inevitably form large-scale connected clusters), while small connected regions are re-clustered to separate noise clusters and smaller gelatinous material fragments. Finally, using the pixels of the undetermined second gelatinous material edge in the third cluster with large connected regions as a basis, and combining the spectral vectors of the undetermined second gelatinous material edge pixels in other second clusters, the system analyzes and filters to obtain target second gelatinous material edge pixels with strong spectral consistency, spatial connectivity, and noise removal.
[0142] Specifically, in step S36665, the target second gel edge pixels are obtained by analyzing and filtering based on the spectral vectors of each undetermined second gel edge pixel in the third cluster and the spectral vectors of each undetermined second gel edge pixel in each second cluster other than the third cluster. This includes the following steps:
[0143] The mean value of the spectral vector of the gelatinous material at the edge of the second gelatinous material in all the third clusters to be determined is calculated;
[0144] The absolute value of the difference between the spectral vectors is calculated based on the mean of the spectral vector of the gel and the spectral vector of each edge pixel of the second gel in each second cluster (excluding the third cluster).
[0145] When the absolute value of the spectral vector difference corresponding to each undetermined gelatinous material edge pixel in each of the second clusters (excluding the third cluster) is greater than or equal to the absolute value threshold of the spectral vector difference, and the proportion of undetermined gelatinous material edge pixels in the corresponding second cluster is greater than or equal to the proportion threshold, the second cluster is filtered out, and the undetermined second gelatinous material edge pixels in the deleted second cluster and the third cluster are the target second gelatinous material edge pixels.
[0146] It should be noted that, in the above embodiments of this application, the mean value of the spectral vector of the second gelatinous material edge pixels to be determined in the third cluster with a larger connected region is first calculated. The mean value of the spectral vector of the gelatinous material is a reliable global standard spectral feature of the gelatinous material edge (i.e., the spectral benchmark of the large cluster after scale screening). Then, the absolute value of the spectral vector difference is calculated using this mean value of the spectral vector, directly using the spectral mean value of the most reliable cluster as a benchmark to avoid interference from small cluster noise. For the absolute value of the spectral vector difference that is greater than or equal to the absolute value threshold of the spectral vector difference (i.e., the corresponding second gelatinous material edge pixel to be determined differs significantly from the mean value of the spectral vector of the gelatinous material), (Identify outliers with significant spectral deviations) and count the number of outliers in each second cluster whose absolute spectral vector difference is greater than or equal to a threshold. If the proportion of such outliers in the corresponding second cluster is greater than or equal to a threshold (there are too many outliers in the second cluster whose spectral vector difference is significantly different from the mean of the colloid edge), the corresponding second cluster is removed, resulting in multiple remaining second clusters with noise-removed outliers. Thus, the remaining outlier pixels in the second and third clusters are used as target colloid edge pixels.
[0147] In summary, the present invention presents a system and method for identifying and processing oil gum based on hyperspectral imaging. First, it detects and identifies gum by uniformly distributing tiny particles in the oil and its gum as "tracers" or "internal standards." Second, since the original hyperspectral image of the oil inevitably contains various noises and invalid information, preprocessing the image reduces noise interference and enhances spectral consistency, providing a standard data foundation for accurate identification of the oil gum. Third, by applying the Canny algorithm to the preprocessed hyperspectral image and combining it with the density distribution of tiny particles, distortion is corrected, thereby identifying the edge pixels of the oil gum. Finally, segmentation based on these edge pixels yields a complete and clear image of the oil gum, providing a reliable data foundation for oil quality assessment.
[0148] In the specific execution process, the pixel distortion of the edge pixels of the gel-like substance is calculated by analyzing the density distortion of local microparticles within the local window. This avoids the distortion of the edge pixels of the gel-like substance caused by the oil gel, which would introduce errors in the extraction of the gel image. Then, based on the pixel distortion, spectral distortion correction is performed, and optical compensation is used to reverse the optical attenuation caused by the absorption of the gel and correct the imaging density distortion of microparticles in the hyperspectral image. Finally, clustering processing is used to identify the edge pixels of the oil gel.
[0149] Furthermore, during the execution process, the accuracy of subsequent complete gel-like object image extraction is improved by calculating the dynamic bandwidth parameter and similarity of each corrected gel-like object edge pixel.
[0150] Furthermore, the spectral continuity factor is calculated by using the spectral vectors of the neighboring reference points and the spectral vectors of the repair reference points, which quantifies the spectral differences between the repair reference points and the neighboring reference points, and repairs edge breaks; thus improving the accuracy of subsequent screening.
[0151] Furthermore, after analyzing connectivity, the edge pixels of the second gelatinous material to be determined in the third cluster with a large connected region area are used as the basis, and the spectral vectors of the edge pixels of the second gelatinous material to be determined in other second clusters are analyzed and screened to obtain target edge pixels of the second gelatinous material with strong spectral consistency, spatial connectivity and noise removal.
[0152] Furthermore, noise points are eliminated by judging the difference in spectral vectors and the proportion of each vector, thus ensuring the accuracy of the complete image of the gel-like material.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; those skilled in the art can modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A system for identifying and processing oil residues based on hyperspectral imaging, characterized in that, It includes an image acquisition module, a preprocessing module, a recognition and correction module, and a processing module: The image acquisition module is used to acquire hyperspectral images of engine oil in which fine particles have been uniformly added in advance; The preprocessing module is used to preprocess the hyperspectral image of engine oil to obtain a preprocessed hyperspectral image of engine oil. The identification and correction module is used to perform local pixel spectral distortion correction on the preprocessed hyperspectral image of engine oil by combining the Canny algorithm with the density of small particles, so as to obtain the edge pixels of the gel. The processing module is used to obtain an image of the gelatinous material based on the edge pixels of the gelatinous material; The identification and correction module is specifically used to extract and calculate the gradient magnitude and gradient direction of each pixel in the preprocessed hyperspectral image of engine oil. Candidate edge pixels are extracted based on gradient magnitude and gradient direction using a loose thresholding process; The candidate edge pixels are screened by gradient magnitude and local spectral consistency to obtain the first gel-like material edge pixels and the gel-like material edge pixels; The pixel distortion degree of the edge pixels of the gel-like material is calculated by analyzing the density distortion of local microparticles within a local window. The spectral distortion of the edge pixels of the gel-like material is corrected by using the pixel distortion degree to obtain the corrected edge pixels of the gel-like material. The corrected gel-like edge pixels are filtered out using a physical constraint spectrum clustering method with multi-feature fusion to obtain the second gel-like edge pixels; The target gel edge pixels are obtained based on the edge pixels of the first gel and the edge pixels of the second gel.
2. A method for identifying and processing oil residues based on hyperspectral imaging, characterized in that, The oil residue identification and processing system based on hyperspectral imaging as described in claim 1 is used to perform the processing, which includes the following steps: Acquire hyperspectral images of engine oil in which fine particles have been uniformly added beforehand; The hyperspectral image of engine oil is preprocessed to obtain the preprocessed hyperspectral image of engine oil. The preprocessed hyperspectral image of engine oil was processed by the Canny algorithm combined with the density of small particles to perform local pixel spectral distortion correction, and the edge pixels of the gel were obtained. The image of the gelatinous material is obtained based on the edge pixels of the gelatinous material; The preprocessed hyperspectral image of engine oil was processed using the Canny algorithm combined with the density of small particles to correct the spectral distortion of local pixels, resulting in the edge pixels of the gel-like material, including: The gradient magnitude and gradient direction are calculated for each pixel in the preprocessed hyperspectral image of engine oil. Candidate edge pixels are extracted based on gradient magnitude and gradient direction using a loose thresholding process; The candidate edge pixels are screened by gradient magnitude and local spectral consistency to obtain the first gel-like material edge pixels and the gel-like material edge pixels; The pixel distortion degree of the edge pixels of the gel-like material is calculated by analyzing the density distortion of local microparticles within a local window. The spectral distortion of the edge pixels of the gel-like material is corrected by using the pixel distortion degree to obtain the corrected edge pixels of the gel-like material. The corrected gel-like edge pixels are filtered out using a physical constraint spectrum clustering method with multi-feature fusion to obtain the second gel-like edge pixels; The target gel edge pixels are obtained based on the edge pixels of the first gel and the edge pixels of the second gel.
3. The method for identifying and processing oil residues based on hyperspectral imaging according to claim 2, characterized in that, The corrected gel-like edge pixels are then filtered using a physical constraint spectrum clustering method with multi-feature fusion to obtain the second gel-like edge pixels. The process includes the following steps: The gradient magnitude and pixel distortion are extracted from the edge pixels of the corrected gel-like material. The dynamic bandwidth parameter of the b-th corrected gel-like edge pixel is obtained by calculating the gradient magnitude of the corrected gel-like edge pixel and the b-th neighboring corrected gel-like edge pixel in the neighborhood of the corrected gel-like edge pixel. Based on the dynamic bandwidth parameters, a similarity matrix is constructed between the a-th corrected gel-like edge pixel and the b-th corrected neighboring gel-like edge pixel in the neighborhood of the a-th corrected gel-like edge pixel. Based on the similarity matrix, an angle matrix D is constructed; based on the angle matrix and the similarity matrix, a graph Laplacian matrix is constructed; the graph Laplacian matrix is solved by feature system to obtain a symmetric normalized Laplacian matrix. The embedding space is constructed by extracting the first k non-zero eigenvectors based on the symmetric normalized Laplacian matrix. Within the embedded space, the corrected gel-like edge pixels are clustered to obtain the second gel-like edge pixels.
4. The method for identifying and processing oil residues based on hyperspectral imaging according to claim 3, characterized in that, Within the embedded space, the corrected gel-like edge pixels are clustered to obtain second gel-like edge pixels, including the following steps: Randomly select any k corrected gel-like edge pixels as cluster centers; calculate the gel-like adaptive distance to the cluster center for each corrected gel-like edge pixel; cluster the corrected gel-like edge pixels based on the gel-like adaptive distance to obtain multiple initial clusters; The corrected gel-like edge pixels are selected based on the initial cluster, the gradient magnitude of the corrected gel-like edge pixels, and the pixel distortion of the corrected gel-like edge pixels to obtain the gel-like edge repair reference pixels; Obtain multiple neighboring reference pixels of the reference pixel for edge repair of the gel-like material; The spectral continuity factor is calculated based on the spectral vector of the reference pixel for edge repair of the gel material and the spectral vector of the neighboring reference pixels. When the spectral continuity factor is determined to be greater than or equal to a preset spectral continuity factor threshold, the reference pixel for repairing the edge of the gelatinous material is merged into the initial cluster to which the neighboring reference pixel belongs, thus obtaining the first cluster. Obtain the spectral vectors of each of the corrected gel-like material edge pixels; Based on the spectral vector, connectivity analysis is performed on the first cluster, and clustering and filtering are performed again to obtain the edge pixels of the target second gelatinous substance.
5. The method for identifying and processing oil residues based on hyperspectral imaging according to claim 4, characterized in that, The selection method for the reference pixel for gel-like material edge repair is as follows: the gradient magnitude of the corrected gel-like material edge pixel is greater than or equal to the gradient magnitude threshold, and the neighboring pixels of the corrected gel-like material edge pixel include corrected gel-like material edge pixels in an initial cluster other than the initial cluster of the currently corrected gel-like material edge pixel, and the absolute value of the pixel distortion difference between the corrected gel-like material edge pixel and each of the corrected gel-like material edge pixels in the neighboring pixels of the corrected gel-like material edge pixel is less than or equal to the absolute value threshold of the pixel distortion difference.
6. The method for identifying and processing oil residues based on hyperspectral imaging according to claim 5, characterized in that, Based on the spectral vector, connectivity analysis is performed on the first cluster, followed by further clustering and filtering to obtain the edge pixels of the target second gelatinous substance. The process includes the following steps: The mean spectral vector of each corrected gel-like edge pixel in the first cluster is calculated; The spectral deviation of each of the corrected gel-like material edge pixels is calculated based on the mean of the spectral vector; when the spectral deviation is less than or equal to the spectral deviation threshold, the corrected gel-like material edge pixel is determined as the second gel-like material edge pixel to be determined. In the first cluster, connectivity analysis is performed on the edge pixels of the second gelatinous material to be determined to obtain multiple gelatinous material connected regions. Based on the area of the gelatinous material connected regions, re-clustering is performed to obtain multiple second clusters. Obtain the number of pixels within the second cluster; The second clusters are sorted from highest to lowest based on the number of pixels within each cluster to obtain a second cluster sequence; the first d second clusters in the second cluster sequence are selected as the third clusters; The target second gel edge pixel is obtained by analyzing and filtering the spectral vectors of each undetermined second gel edge pixel in each second cluster other than the third cluster.
7. The method for identifying and processing oil residues based on hyperspectral imaging according to claim 6, characterized in that, The target second gel edge pixels are obtained by analyzing and filtering the spectral vectors of each undetermined second gel edge pixel in the third cluster and each undetermined second gel edge pixel in each second cluster other than the third cluster. The process includes the following steps: The mean value of the spectral vector of the gelatinous material at the edge of the second gelatinous material in all the third clusters to be determined is calculated; The absolute value of the difference between the spectral vectors is calculated based on the mean of the spectral vector of the gel and the spectral vector of each edge pixel of the second gel in each second cluster (excluding the third cluster). When the absolute value of the spectral vector difference corresponding to each undetermined gelatinous material edge pixel in each of the second clusters (excluding the third cluster) is greater than or equal to the absolute value threshold of the spectral vector difference, and the proportion of undetermined gelatinous material edge pixels in the corresponding second cluster is greater than or equal to the proportion threshold, the second cluster is filtered out, and the undetermined second gelatinous material edge pixels in the deleted second cluster and the third cluster are the target second gelatinous material edge pixels.
Citation Information
Patent Citations
Method for detecting impurities in lubricating oil based on image processing
CN116152231A
Geological structure fracture automatic identification and detection system based on deep learning
CN120198416A