A method and system for detecting an over-limit oil level at a train air compressor

CN122597768APending Publication Date: 2026-08-18CRRC HANGZHOU DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610751824.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]现有油液位检测方法存在显著缺陷:其一,人工目视检测依赖运维人员现场观察液位计刻度,不仅效率低下、劳动强度大,还受设备安装位置、人员主观判断差异影响,易出现误判、漏判,且存在人身安全风险;其二,接触式传感器检测虽实现自动化,但传感器直接接触油液,长期使用中易受油污附着、振动冲击、温度变化影响,导致检测精度漂移、故障频发,维护成本较高;其三,传统图像检测方法虽为非接触式,但未适配空压机油液场景特性:缺乏针对反光、油污的专项处理机制,边界清晰度不足;仅单一评估液位线位置,未考虑连续度、平行度等关键特征,易受离散点干扰;综合评估采用固定权重,无法根据图像质量动态调整指标权重,导致可信度不足,难以适应列车复杂运行工况

Benefits of technology

[0013] The beneficial effects of this invention are as follows: It enables automated and non-contact operation of oil level detection, eliminating the need for manual intervention. This reduces the labor intensity of maintenance personnel and the safety risks associated with high-altitude and high-temperature environments, while significantly improving detection efficiency and meeting the needs of large-scale and real-time train maintenance. Compared to contact sensors, it avoids the impact of oil contamination and vibration on the detection components, reducing equipment failure rates and maintenance costs, and extending the service life of the detection system. The clarity analysis introduces a consistency verification step, evaluating the spatial correlation and consistency between boundary clarity and liquid level clarity to perform secondary verification of the detection results, avoiding the bias of a single clarity index. Simultaneously, it dynamically adjusts the clarity value based on consistency confidence, making the image quality assessment more aligned with actual scenarios and providing reliable basic data for subsequent liquid level comparisons. An innovative dynamic weighted comprehensive evaluation strategy dynamically adjusts the weight factors of continuity and parallelism based on clarity, adapting the evaluation logic to different image quality scenarios: when image clarity is high, the weights of continuity and parallelism are increased to enhance feature matching accuracy; when image clarity is low, the weight ratio of a single feature is reduced to avoid error amplification, significantly improving the rationality of the comprehensive credibility assessment and ensuring the reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597768A_ABST
    Figure CN122597768A_ABST
Patent Text Reader

Abstract

The application provides a kind of oil level over-limit detection method at train air compressor, it is characterized in that, including: obtaining the image containing air compressor and oil level as target image, and by target detection and cutting, obtain the key area containing oil liquid boundary as the image to be analyzed;By semantic segmentation in the image to be analyzed, obtain the marked area and oil area, obtain the reference liquid level line of marked area, the first liquid level line and the second liquid level line of oil area, according to the first liquid level line, the second liquid level line and the reference liquid level line, continuous degree evaluation and parallelism evaluation are carried out, and the continuous degree and parallelism are obtained, and according to the marked area and oil area, the definition evaluation is carried out to obtain the definition, according to the continuous degree, the parallelism and the definition, the reliability is obtained by comprehensive evaluation strategy;Based on reliability, determine the final marked reference line and the highest liquid level, and by liquid level comparison strategy, judge whether the oil level is normal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to liquid level detection methods, and more particularly to a method and system for detecting excessive oil levels at a train air compressor. Background Technology

[0002] The air compressor in a train is the power source for core equipment such as the braking system and air suspension system of rail transit vehicles, and its operational stability directly determines the safety of train operation. As the lubricating and cooling medium for the moving parts inside the air compressor, the oil level is a key parameter affecting the reliability of the equipment: too low an oil level will lead to insufficient lubrication of components, accelerated wear, and even air compressor burn-out failure; too high an oil level is prone to oil emulsification and leakage, compromising the sealing of the braking system, which also poses a significant safety hazard. Therefore, accurate and efficient over-limit detection of the air compressor oil level is an important guarantee for the safety of train operation and maintenance.

[0003] Existing oil level detection methods have significant drawbacks: First, manual visual inspection relies on maintenance personnel observing the level gauge scale on-site, which is not only inefficient and labor-intensive, but also susceptible to errors and omissions due to equipment installation location and subjective judgment, and poses personal safety risks. Second, while contact sensor detection achieves automation, the sensors are in direct contact with the oil, making them susceptible to oil contamination, vibration, and temperature changes over long-term use, leading to drift in detection accuracy, frequent malfunctions, and high maintenance costs. Third, although traditional image detection methods are non-contact, they are not adapted to the characteristics of air compressor oil scenarios: they lack specific processing mechanisms for reflections and oil contamination, resulting in insufficient boundary clarity; they only assess the position of the level line without considering key features such as continuity and parallelism, making them susceptible to interference from discrete points; and the comprehensive evaluation uses fixed weights, which cannot dynamically adjust the index weights according to image quality, resulting in insufficient reliability and difficulty in adapting to the complex operating conditions of trains. Summary of the Invention

[0004] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a method and system for detecting excessive oil level at the air compressor of a train, so as to overcome the above-mentioned defects in the existing technology.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for detecting excessive oil level at a train air compressor, comprising: The image acquisition step involves acquiring an image containing the air compressor and the oil surface as the target image, and then using target detection and cropping to acquire the key region containing the oil boundary as the image to be analyzed. The image processing steps involve obtaining the marked region and the oil region in the image to be analyzed through semantic segmentation, obtaining the baseline liquid level line of the marked region, the first liquid level line and the second liquid level line of the oil region, performing continuity and parallelism evaluation based on the first liquid level line, the second liquid level line and the baseline liquid level line, obtaining continuity and parallelism, and performing sharpness evaluation based on the marked region and the oil region to obtain sharpness. Based on continuity, parallelism and sharpness, a comprehensive evaluation strategy is used to obtain credibility. The liquid level comparison step, based on the reliability, determines the final marking baseline and the highest liquid level line, and uses a liquid level comparison strategy to determine whether the oil level is normal. Preferably, the image processing step includes a sharpness analysis strategy, which includes: The boundary sharpness acquisition sub-step defines the marked area and the oil area as the areas to be analyzed and obtains their neighboring areas. It calculates the color difference value between the area where each pixel is located and its neighboring areas as the boundary sharpness. The liquid level clarity acquisition sub-step involves acquiring the boundary region of the liquid level line and the adjacent regions on both sides of the boundary line, and calculating the color difference value between the pixels in the boundary region and the pixels in the adjacent regions on both sides as the liquid level clarity. The clarity consistency verification sub-step calculates the correlation and consistency degree of the boundary clarity and liquid level clarity in spatial distribution, and generates a consistency confidence score. The clarity generation sub-step obtains the boundary clarity and level clarity of the liquid level area and oil area based on the consistency confidence level, and adjusts the boundary clarity and level clarity based on the consistency confidence level to generate the clarity.

[0006] Preferably, the image processing step includes a continuity analysis strategy, which includes: The boundary point zone construction sub-step involves obtaining a reference straight line based on discrete points on the liquid level line, and then expanding the tolerance on both sides of the reference straight line to generate an ideal boundary zone. The compliance calculation sub-step obtains the number of discrete points that fall into the ideal boundary zone and calculates the proportion of the number of discrete points in the corresponding liquid level line as the benchmark compliance. The uniformity calculation sub-step divides the ideal boundary zone into several continuous evaluation units along the direction of the reference line, and calculates the uniformity of the distribution of points falling into the zone within each evaluation unit. The continuity acquisition sub-step obtains the reference conformity and uniformity of the first liquid level line, the second liquid level line, and the reference liquid level line, and calculates and generates the continuity.

[0007] Preferably, the image processing step further includes a reflection analysis strategy, which includes: extracting the color brightness features and texture features of the image, obtaining the reflective area, determining the positional relationship between the marked area, the oil area and the reflective area, automatically ignoring the reflective area when it is located within the marked area or the oil area, deducing the liquid level line of the reflective area by analyzing the continuity of other areas of the liquid level line when the reflective area is located within the liquid level line and completely obscures the liquid level line, and re-taking the target image when the reflective area is located within the liquid level line and completely obscures the liquid level line.

[0008] Preferably, the image processing step further includes a parallelism analysis strategy. The parallelism analysis strategy includes obtaining the bottom of the image to be analyzed as a reference straight line, obtaining the direction vectors of the first liquid level line, the second liquid level line, the reference liquid level line, and the reference straight line respectively, obtaining a consensus direction vector based on the direction vectors of the four straight lines, the average sum of the angles between the consensus direction vector and the four direction vectors being the best, calculating the angle between the direction vector of each straight line and the consensus direction vector as the deviation angle, aggregating the four deviation angles, and mapping them to parallelism.

[0009] Preferably, the comprehensive scoring strategy includes obtaining sharpness, continuity, and parallelism respectively, dynamically adjusting the weight factors of continuity and parallelism based on the sharpness, and using the dynamically adjusted weights to calculate the credibility.

[0010] Preferably, the image acquisition step further includes a visual correction sub-step. The visual correction sub-step is used to acquire an image containing the air compressor and oil level, identify at least one preset circular component, fit its contour as an initial ellipse, obtain the initial ellipse equation, regard the initial ellipse as the perspective projection of a spatial circle, obtain the angle between the optical axis of the shooting lens and the normal of the plane containing the spatial circle as the initial shooting angle deviation, perform perspective transformation on the image based on the initial shooting angle deviation, generate a first corrected image, and identify and fit the circular component again in the first corrected image to obtain a first corrected ellipse. Calculate the deviation of the first corrected ellipse from the ideal circle. If the deviation is lower than a threshold, the correction is completed. If the deviation is higher than the threshold, the calculation is iterated again based on the first corrected ellipse until the deviation meets the requirements, and the target image is output.

[0011] Preferably, the liquid level comparison strategy includes obtaining a marker baseline and a liquid level maximum line, generating coordinate axes based on the image to be analyzed, obtaining the baseline height and liquid level height respectively, obtaining the difference between the baseline height and liquid level height, and setting a baseline threshold. When the difference is less than the baseline threshold, the oil level is normal; when the difference is greater than the baseline threshold, the oil level exceeds the limit.

[0012] An oil level over-limit detection method at a train air compressor includes: The image acquisition module acquires an image containing the air compressor and the oil surface as the target image, and obtains the key area containing the oil boundary as the image to be analyzed through target detection and cropping. The image processing module obtains the marked region and oil region in the image to be analyzed through semantic segmentation, obtains the baseline liquid level line of the marked region, the first liquid level line and the second liquid level line of the oil region, performs continuity and parallelism evaluation based on the first liquid level line, the second liquid level line and the baseline liquid level line, obtains continuity and parallelism, performs sharpness evaluation based on the marked region and the oil region, obtains sharpness, and obtains credibility through a comprehensive evaluation strategy based on continuity, parallelism and sharpness. The liquid level comparison module determines the final marker baseline and the highest liquid level line based on the reliability, and judges whether the oil level is normal through the liquid level comparison strategy.

[0013] The beneficial effects of this invention are as follows: It enables automated and non-contact operation of oil level detection, eliminating the need for manual intervention. This reduces the labor intensity of maintenance personnel and the safety risks associated with high-altitude and high-temperature environments, while significantly improving detection efficiency and meeting the needs of large-scale and real-time train maintenance. Compared to contact sensors, it avoids the impact of oil contamination and vibration on the detection components, reducing equipment failure rates and maintenance costs, and extending the service life of the detection system. The clarity analysis introduces a consistency verification step, evaluating the spatial correlation and consistency between boundary clarity and liquid level clarity to perform secondary verification of the detection results, avoiding the bias of a single clarity index. Simultaneously, it dynamically adjusts the clarity value based on consistency confidence, making the image quality assessment more aligned with actual scenarios and providing reliable basic data for subsequent liquid level comparisons. An innovative dynamic weighted comprehensive evaluation strategy dynamically adjusts the weight factors of continuity and parallelism based on clarity, adapting the evaluation logic to different image quality scenarios: when image clarity is high, the weights of continuity and parallelism are increased to enhance feature matching accuracy; when image clarity is low, the weight ratio of a single feature is reduced to avoid error amplification, significantly improving the rationality of the comprehensive credibility assessment and ensuring the reliability of the detection results. Attached Figure Description

[0014] Figure 1 This is an overall flowchart of the present invention; Figure 2 This is a flowchart of the reflectivity analysis strategy of the present invention; Figure 3 This is the target image of the present invention; Figure 4 This is the image to be analyzed in this invention. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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.

[0016] It should be noted that when a component is described as "fixed to" another component, it can be directly on the other component or may have a component in between. When a component is considered "connected to" another component, it can be directly connected to the other component or may have a component in between. When a component is considered "set on" another component, it can be directly set on the other component or may have a component in between. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0018] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings: A method for detecting excessive oil level at a train air compressor, such as... Figure 1-2 As shown, it includes: Image acquisition steps, such as Figure 3 As shown, an image containing the air compressor and oil level is acquired as the target image, and then target detection and cropping are performed, as follows: Figure 4 As shown, the key region containing the oil boundary is obtained as the image to be analyzed; The image acquisition step also includes a visual correction sub-step. This sub-step acquires images containing the air compressor and oil level, identifies at least one pre-defined circular component, and fits its contour to an initial ellipse, obtaining the initial ellipse equation. The initial ellipse is considered a perspective projection of a spatial circle. The angle between the optical axis of the shooting lens and the normal to the plane containing the spatial circle is obtained as the initial shooting angle deviation. Based on this deviation, a perspective transformation is performed on the image to generate a first corrected image. The circular component is then identified and fitted again in the first corrected image to obtain a first corrected ellipse. The deviation of the first corrected ellipse from the ideal circle is calculated. If the deviation is below a threshold, correction is complete; if it is above the threshold, iterative calculations are performed again based on the first corrected ellipse until the deviation meets the requirements, and the target image is output. The circular component is close to the oil observation area, structurally stable, with no easily detachable markings or easily worn contours on its surface, and its circular size is standardized. The acquired raw image is preprocessed to locate the edge contour of the pre-defined circular component; the least squares method is used to fit the edge contour points to obtain the mathematical equation of the initial ellipse. Since the preset component is a standard circle in physical space, the initial ellipse in the image is essentially a distortion result of this circle under the camera's perspective projection. Based on the camera pinhole imaging model, a mapping relationship between ellipse parameters and shooting angle is established: let the normal vector of the plane containing the spatial circle be n, the direction vector of the camera's optical axis be v, and the angle between them be θ; θ can be derived from the ellipse parameters a and b. Based on the initial shooting angle deviation θ, a perspective transformation matrix is ​​constructed. The core of perspective transformation is to restore the distorted image from the tilted viewpoint to the orthographic viewpoint image through inverse projection. Using the camera's imaging plane as a reference, the coordinates of each pixel in the original image are spatially mapped to correct the near-large and far-small distortion caused by the optical axis not being perpendicular to the circular plane. The original image is convolved with the perspective transformation matrix to obtain the first corrected image; to avoid pixel loss or blurring in the corrected image, a bilinear interpolation algorithm is used to fill the grayscale values ​​of the transformed pixel coordinates to ensure that the clarity of the corrected image is consistent with the original image. The first corrected image undergoes contour extraction and ellipse fitting to obtain the parameters of the first corrected ellipse. The deviation is defined as the degree of difference between the first corrected ellipse and the ideal circle. The deviation is calculated, and a threshold is preset. When the deviation is less than the threshold, the graphic distortion has been eliminated, the geometric relationship is accurately restored, and the first corrected image is output as the target image for subsequent processing. When the deviation is greater than the threshold, the parameters of the first corrected ellipse are used as new initial conditions to recalculate the shooting angle deviation, update the perspective transformation matrix, and perform perspective transformation again to obtain the second corrected image. The above iterative process is repeated until the deviation of the corrected ellipse is less than the threshold, and finally the target image that meets the accuracy requirements is output.

[0019] The image processing steps involve semantic segmentation to obtain marked regions and oil regions in the image to be analyzed. A baseline liquid level line for the marked region and a first and second liquid level line for the oil region are then obtained. Continuity and parallelism are evaluated based on these lines, and sharpness is assessed. Finally, a comprehensive evaluation strategy is used to determine the reliability of the data based on continuity, parallelism, and sharpness. Key regions are first accurately extracted through semantic segmentation, then three core liquid level lines are located. Feature reliability is quantified using three dimensions: continuity, parallelism, and sharpness. Finally, a dynamic weighted comprehensive evaluation is used to generate the reliability score, providing high-confidence foundational data for subsequent liquid level comparisons. Based on the segmented marked and oil regions, three key liquid level lines are extracted, corresponding to the baseline standard and the actual state of the oil, respectively. Continuity is used to determine whether the liquid level line is a physically continuous and uniform real interface and scale line, avoiding interference from discrete points caused by noise and local contamination. Based on the mechanical structural characteristics of the air compressor, the baseline liquid level line in the marked area and the two liquid level lines in the oil area should remain parallel in physical space. Parallelism is evaluated by quantifying the consistency of the straight line direction. Sharpness directly affects the accuracy of liquid level line extraction and feature evaluation. A three-level evaluation, including boundary sharpness and liquid level sharpness consistency verification, comprehensively characterizes the image quality. The weights of continuity and parallelism are dynamically adjusted based on sharpness to adapt the evaluation results to different image quality scenarios. A weighted summation formula is used to calculate the credibility.

[0020] The image processing steps include a sharpness analysis strategy, which includes: The boundary sharpness acquisition sub-step defines the marked area and the oil area as the areas to be analyzed and obtains their neighboring areas. The color difference value between the area where each pixel is located and its neighboring areas is calculated as the boundary sharpness. The boundary sharpness focuses on the contour integrity of the marked area and the oil area. By calculating the color difference between the area and its neighbors, the degree of separation between the area boundary and the background is evaluated, avoiding the interference of boundary blurring caused by oil and dust. The image to be analyzed is converted into a grayscale image. For each boundary pixel, 8 neighboring pixels in its neighborhood area are selected. The absolute difference between the grayscale value of the boundary pixel and the grayscale value of the neighboring pixels is calculated. The average value is taken as the local difference value of the pixel. The boundary sharpness of the two areas is fused by weighted summation.

[0021] The liquid level clarity acquisition sub-step involves acquiring the boundary region of the liquid level line and its adjacent regions on both sides. The color difference between the pixels in the boundary region and the pixels in the adjacent regions is calculated as the liquid level clarity. Liquid level clarity is evaluated based on the edge sharpness of the baseline liquid level line, the first liquid level line, and the second liquid level line to ensure the recognizability of the liquid level line as a key feature and avoid edge blurring caused by reflections or oil fluctuations. Based on the linear equations of the three acquired liquid level lines, the boundary region of each liquid level line is delineated in the image to be analyzed. Using each boundary region as a baseline, it is extended 5 pixels to both sides to form the left and right adjacent regions. For each liquid level line, the grayscale difference between its boundary region and the left adjacent region, and between its boundary region and the right adjacent region, is calculated to obtain the clarity. The average of the clarity values ​​of the three liquid level lines is taken to obtain the liquid level clarity.

[0022] The sharpness consistency verification sub-step calculates the correlation and consistency degree of boundary sharpness and liquid level sharpness in spatial distribution, generating a consistency confidence score. The core of sharpness consistency verification is to determine the degree of matching between boundary sharpness and liquid level sharpness in spatial distribution, avoiding the one-sidedness of a single indicator. For example, if the area boundary is clear but the liquid level line is blurry, it may be due to local anomalies caused by oil covering the liquid level line, ensuring a comprehensive sharpness assessment. The image to be analyzed is divided into a uniform grid. For each grid, the local boundary sharpness and local liquid level sharpness are statistically analyzed. The Pearson correlation coefficient is used to calculate the correlation coefficient between the local boundary sharpness sequence and the local liquid level sharpness sequence of all grids. The correlation coefficient ranges from -1 to 1; the closer the correlation coefficient is to 1 or -1, the stronger the spatial correlation between the two. Considering that sharpness indicators are all non-negative values, the correlation should be positive. Therefore, the absolute value of the correlation coefficient is used as the basis, combined with local consistency verification: the proportion of all grids with local boundary sharpness and local liquid level sharpness greater than a threshold is counted, finally obtaining the consistency confidence score.

[0023] The sharpness generation sub-step obtains the boundary sharpness and liquid level sharpness of the liquid level and oil areas based on the consistency confidence level. Then, it adjusts the boundary sharpness and liquid level sharpness according to the consistency confidence level to generate the final sharpness. Based on the consistency confidence level, the fusion weights of the boundary sharpness and liquid level sharpness are dynamically adjusted to ensure that the final sharpness accurately reflects the image quality and avoids misjudgments caused by anomalies in a single metric.

[0024] The image processing steps include a continuity analysis strategy. The core objective of this strategy is to quantify the physical continuity and uniformity of the liquid level lines—the baseline, the first, and the second—to identify true and reliable liquid level line features and eliminate interference from discrete points caused by oil contamination, noise, and local occlusion. This provides high-quality feature data for subsequent parallelism assessment and comprehensive reliability calculation. This strategy is adaptable to scenarios where there may be slight fluctuations or localized contamination at the oil interface of a train air compressor. Through a closed-loop logic of boundary point band construction, conformity calculation, uniformity calculation, and continuity fusion, it achieves accurate assessment of the integrity and stability of the liquid level lines.

[0025] The boundary point band construction sub-step involves obtaining a reference straight line based on discrete points on the liquid level line, and expanding the tolerance on both sides of the reference straight line as the center to generate an ideal boundary band. For each liquid level line to be evaluated, the original discrete edge point set in the liquid level line extraction stage is extracted, and a reference straight line is obtained. The reference straight line can truly reflect the overall trend of the liquid level line. With the reference straight line as the center axis, the tolerance threshold is expanded in both directions vertically to form an ideal boundary band, which is a strip-shaped region parallel to the reference straight line.

[0026] The compliance calculation sub-step obtains the number of discrete points falling within the ideal boundary zone and calculates its proportion to the total number of discrete points in the corresponding liquid level line, serving as the baseline compliance. Compliance quantifies the degree of fit between the effective discrete point set and the baseline line; its core is to statistically analyze the proportion of discrete points falling within the ideal boundary zone, reflecting the overall integrity of the liquid level line. For each point in the denoised effective discrete point set, its perpendicular distance to the corresponding baseline line is calculated, and the number of discrete points satisfying this distance is counted, i.e., the number of effective points falling within the ideal boundary zone. The baseline compliance is the ratio of the number of discrete points falling within the boundary zone to the total number of effective discrete points.

[0027] The uniformity calculation sub-step divides the ideal boundary zone into several continuous evaluation units along the direction of the reference line. It calculates the uniformity of the distribution of points falling within the zone within each evaluation unit. Uniformity is used to supplement the evaluation of whether the distribution of discrete points within the ideal boundary zone is continuous and uniform, avoiding false conformity caused by local point density or gaps. For example, some areas may have densely packed discrete points that fit the reference line, but the overall distribution is broken, resulting in high conformity but actual discontinuity. Along the length of the reference line, the ideal boundary zone is equally divided into several continuous evaluation units. Using the coordinates of the start and end points of the reference line, the lateral and longitudinal boundaries of each evaluation unit are calculated, ensuring that each unit is a small strip-shaped region parallel to the reference line, with no overlap or gaps between units. The number of discrete points falling within each evaluation unit is counted, and the variance of the number of points in each unit is calculated. A larger variance indicates a more uneven distribution of discrete points. The uniformity is mapped to the 0-1 interval using the reciprocal of the variance combined with a threshold constraint.

[0028] The continuity acquisition sub-step obtains the baseline compliance and uniformity of the first liquid level line, the second liquid level line, and the baseline liquid level line, and calculates the continuity. This sub-step generates a global continuity evaluation value by weightedly fusing the baseline compliance and uniformity of each liquid level line and then combining the continuity results of the three liquid level lines.

[0029] The image processing steps also include a reflection analysis strategy. This strategy involves: extracting the image's color and brightness features and texture features, identifying reflective areas, and determining the positional relationship between the marked area, oil area, and reflective area. When the reflective area is located within the marked area or oil area, it is automatically ignored. When the reflective area is located on the liquid level line and partially obscures it, the liquid level line of the reflective area is derived by analyzing the continuity of other areas of the liquid level line. When the reflective area is located on the liquid level line and completely obscures it, a new image is taken to acquire the target image. Reflection is one of the most common interference factors in train air compressor oil level image detection: the air compressor's metal casing and oil surface are easily affected by strong ambient light and oil fluctuations caused by equipment vibration, producing localized high-brightness reflective areas that may obscure the liquid level line and blur the area boundaries, leading to distortion in liquid level line extraction and increased feature evaluation errors. The core objective of the reflectivity analysis strategy is to accurately identify reflective areas and apply differentiated processing based on their positional relationships. This minimizes the interference of reflection on detection accuracy and ensures the stability of detection results under complex lighting conditions. By fusing color brightness features and texture features, accurate differentiation between reflective and normal areas is achieved. Based on the marked region mask, oil region mask, and liquid level line extraction results from semantic segmentation output, the positional relationship between the reflective area and the core detection area is determined. When the reflective area is located within the marked area or the oil area, it is automatically ignored. When the reflective area is located on the liquid level line and partially obscures the liquid level line, the partially obscured liquid level line is divided into unobscured and obscured segments based on the location of the reflective area. The discrete point set of the unobscured segment is extracted, its continuity is calculated, and the linear trend of the unobscured segment is fitted. Based on the linear trend of the unobscured segment and combined with the parallelism constraint of the three liquid level lines, the linear parameters of the obscured segment are calculated. If the unobscured segment is divided into two segments, left and right, the average of the slopes of the two segments is taken as the slope of the obscured segment. The intercept range of the obscured segment is obtained by linear interpolation of the endpoint coordinates of the two segments. Combined with the uniformity requirement of continuity, the discrete point set of the obscured segment is determined. The discrete points of the unobscured segment are merged with the derived discrete points of the obscured segment, and the complete liquid level line is refitted. The linear equation and discrete point set of the liquid level line are updated for subsequent continuity and parallelism evaluation. When the reflective area is located on the liquid level line and is completely obscured, the core features of the liquid level line are completely lost, and reliable results cannot be obtained by deduction and completion. It is necessary to re-acquire the image to eliminate reflective interference.

[0030] The image processing steps also include a parallelism analysis strategy. This strategy involves obtaining the bottom of the image to be analyzed as a baseline line, acquiring the direction vectors of the first liquid level line, the second liquid level line, the baseline liquid level line, and the baseline line, respectively, and obtaining a consensus direction vector based on the direction vectors of the four lines. The average sum of the angles between the consensus direction vector and the four direction vectors is minimized. The angle between the direction vector of each line and the consensus direction vector is calculated as the deviation angle. The four deviation angles are aggregated and mapped to parallelism. The core objective of the parallelism analysis strategy is to verify the physical rationality of the liquid level line extraction results by quantifying the directional consistency of the four key lines based on the mechanical structural characteristics of the train air compressor, eliminating abnormal fitting biases caused by noise and local contamination, and providing core feature basis for comprehensive credibility assessment. The baseline line at the bottom of the image to be analyzed must conform to the actual mechanical structure of the air compressor to avoid baseline distortion caused by image edge noise. For the four key lines—the baseline liquid level line, the first liquid level line, the second liquid level line, and the bottom baseline line—direction vectors are extracted and normalized to eliminate the influence of length differences on the angle calculation. The consensus direction vector is the vector with the smallest average sum of angles with the four direction vectors. Its core is to capture the common trend of the four lines and avoid the impact of abnormal deviations of a single line on the evaluation results. By aggregating the deviation angles of the four lines, it is mapped to a parallelism index in the 0-1 interval, which intuitively reflects the consistency of the line directions.

[0031] The comprehensive scoring strategy involves separately acquiring sharpness, continuity, and parallelism. Based on sharpness, it dynamically adjusts the weighting factors of continuity and parallelism, and uses the dynamically adjusted weights to calculate the reliability. The core of the comprehensive scoring strategy is to dynamically adjust the weighting factors of continuity and parallelism based on image sharpness, achieving adaptive matching between image quality and feature reliability. This avoids reliability assessment bias caused by fixed weights and ensures reliable evaluation results are output under different image quality scenarios. Sharpness directly reflects image quality and is a prerequisite for determining the reliability of continuity and parallelism: when image sharpness is high, liquid level line feature extraction is more accurate, and the reference value of continuity and parallelism is higher, so they should be given higher weights; when image sharpness is low, feature extraction errors are larger, so the weighting of continuity and parallelism needs to be reduced to avoid error amplification.

[0032] The liquid level comparison step, based on credibility, determines the final marker baseline and the highest liquid level line, and uses a liquid level comparison strategy to determine whether the oil level is normal. Based on the credibility output from the image processing stage, highly reliable marker baselines and highest liquid level lines are selected and confirmed. The height relationship between the two is quantified by establishing a unified coordinate system, and a preset benchmark threshold is used to determine whether the oil level is normal or exceeds the limit. Credibility directly determines the reliability of the marker baseline and liquid level line extraction results; targeted selection based on credibility level is necessary to avoid misjudgments due to low-credibility features. For scenarios with high credibility, the benchmark liquid level line extracted in the image processing stage is directly used as the final marker baseline. This line is the most representative standard scale line in the marked area and has been verified to conform to physical characteristics through continuity and parallelism. The average y-coordinate of the first and second liquid level lines in the oil area is compared, and the line with the larger y-value is taken as the final highest liquid level line.

[0033] In scenarios with moderate credibility and moderate reliability: Combine all the tick marks in the marked area, calculate the parallelism between each tick mark and the consensus direction vector, select tick marks with high parallelism to form a benchmark candidate set, and take the straight line with the highest continuity in the center of the candidate set as the final marking benchmark line to improve the reliability of the benchmark. Calculate the average y-coordinate of the first liquid level line and the second liquid level line, and take the straight line parallel to the baseline corresponding to the average value as the final highest liquid level line.

[0034] Low reliability in scenarios where credibility is insufficient: If the reliability of the feature extraction results is insufficient, forced comparison may lead to misjudgment, directly triggering the abnormal handling process and prioritizing the re-execution of the image processing steps; if the reliability still does not meet the standard after 3 consecutive processing steps, a detection failure alarm signal will be output to prompt maintenance personnel to manually intervene and check.

[0035] The liquid level comparison strategy includes acquiring a baseline and a maximum liquid level line, generating coordinate axes based on the image to be analyzed, and acquiring the baseline height and liquid level height separately. The difference between the baseline height and the liquid level height is then calculated, with a preset baseline threshold. When the difference is less than the baseline threshold, the oil level is considered normal; when the difference is greater than the baseline threshold, the oil level is considered excessive. To accurately calculate the height difference between the baseline and the maximum liquid level line, a stable and distortion-free unified coordinate system needs to be established based on the image to be analyzed, ensuring the consistency of height quantification. Both the baseline height and the liquid level height are quantified using the y-axis coordinate of the coordinate system. The influence of local fluctuations in the straight line is eliminated through mean calculation, ensuring the stability of the height value. By quantifying the deviation between the actual liquid level and the safety baseline, combined with the preset threshold, the normal or excessive level determination is completed.

[0036] An oil level over-limit detection system at a train air compressor includes: The image acquisition module acquires an image containing the air compressor and the oil surface as the target image, and obtains the key area containing the oil boundary as the image to be analyzed through target detection and cropping. The image processing module obtains the marked region and oil region in the image to be analyzed through semantic segmentation, obtains the baseline liquid level line of the marked region, the first liquid level line and the second liquid level line of the oil region, performs continuity and parallelism evaluation based on the first liquid level line, the second liquid level line and the baseline liquid level line, obtains continuity and parallelism, performs sharpness evaluation based on the marked region and the oil region, obtains sharpness, and obtains credibility through a comprehensive evaluation strategy based on continuity, parallelism and sharpness. The liquid level comparison module determines the final marker baseline and the highest liquid level line based on the reliability, and judges whether the oil level is normal through the liquid level comparison strategy.

[0037] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for detecting excessive oil level at a train air compressor, characterized in that, include: The image acquisition step involves acquiring an image containing the air compressor and the oil surface as the target image, and then using target detection and cropping to acquire the key region containing the oil boundary as the image to be analyzed. The image processing steps involve obtaining the marked region and the oil region in the image to be analyzed through semantic segmentation, obtaining the baseline liquid level line of the marked region, the first liquid level line and the second liquid level line of the oil region, performing continuity and parallelism evaluation based on the first liquid level line, the second liquid level line and the baseline liquid level line, obtaining continuity and parallelism, and performing sharpness evaluation based on the marked region and the oil region to obtain sharpness. Based on continuity, parallelism and sharpness, a comprehensive evaluation strategy is used to obtain credibility. The liquid level comparison step, based on the reliability, determines the final marking baseline and the highest liquid level line, and uses a liquid level comparison strategy to determine whether the oil level is normal.

2. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The image processing step includes a sharpness analysis strategy, which includes: The boundary sharpness acquisition sub-step defines the marked area and the oil area as the areas to be analyzed and obtains their neighboring areas. It calculates the color difference value between the area where each pixel is located and its neighboring areas as the boundary sharpness. The liquid level clarity acquisition sub-step involves acquiring the boundary region of the liquid level line and the adjacent regions on both sides of the boundary line, and calculating the color difference value between the pixels in the boundary region and the pixels in the adjacent regions on both sides as the liquid level clarity. The clarity consistency verification sub-step calculates the correlation and consistency degree of the boundary clarity and liquid level clarity in spatial distribution, and generates a consistency confidence score. The clarity generation sub-step obtains the boundary clarity and level clarity of the liquid level area and oil area based on the consistency confidence level, and adjusts the boundary clarity and level clarity based on the consistency confidence level to generate the clarity.

3. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The image processing step includes a continuity analysis strategy, which includes: The boundary point zone construction sub-step involves obtaining a reference straight line based on discrete points on the liquid level line, and then expanding the tolerance on both sides of the reference straight line to generate an ideal boundary zone. The compliance calculation sub-step obtains the number of discrete points that fall into the ideal boundary zone and calculates the proportion of the number of discrete points in the corresponding liquid level line as the benchmark compliance. The uniformity calculation sub-step divides the ideal boundary zone into several continuous evaluation units along the direction of the reference line, and calculates the uniformity of the distribution of points falling into the zone within each evaluation unit. The continuity acquisition sub-step obtains the reference conformity and uniformity of the first liquid level line, the second liquid level line, and the reference liquid level line, and calculates and generates the continuity.

4. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The image processing steps also include a reflection analysis strategy, which includes: extracting the color brightness features and texture features of the image, obtaining the reflective area, determining the positional relationship between the marked area, the oil area and the reflective area, automatically ignoring the reflective area when it is located within the marked area or the oil area, and deducing the liquid level line of the reflective area by analyzing the continuity of other areas of the liquid level line when the reflective area is located within the liquid level line and completely obscures the liquid level line when the reflective area is located within the liquid level line and completely obscures the liquid level line, and re-taking the target image.

5. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The image processing steps also include a parallelism analysis strategy. The parallelism analysis strategy includes obtaining the bottom of the image to be analyzed as a reference straight line, obtaining the direction vectors of the first liquid level line, the second liquid level line, the reference liquid level line, and the reference straight line respectively, obtaining a consensus direction vector based on the direction vectors of the four straight lines, and finding that the average sum of the angles between the consensus direction vector and the four direction vectors is the best. The angle between the direction vector of each straight line and the consensus direction vector is calculated as the deviation angle, and the four deviation angles are aggregated and mapped to parallelism.

6. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The comprehensive scoring strategy includes obtaining clarity, continuity, and parallelism respectively, dynamically adjusting the weight factors of continuity and parallelism based on the clarity, and using the dynamically adjusted weights to calculate the credibility.

7. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The image acquisition step also includes a visual correction sub-step. This sub-step acquires an image containing the air compressor and oil level, identifies at least one preset circular component, fits its contour to an initial ellipse, obtains the initial ellipse equation, treats the initial ellipse as a perspective projection of a spatial circle, obtains the angle between the optical axis of the shooting lens and the normal to the plane containing the spatial circle as the initial shooting angle deviation, performs perspective transformation on the image based on the initial shooting angle deviation, generates a first corrected image, and identifies and fits the circular component again in the first corrected image to obtain a first corrected ellipse. The deviation of the first corrected ellipse from the ideal circle is calculated. If the deviation is lower than a threshold, the correction is completed. If the deviation is higher than the threshold, the calculation is iterated again based on the first corrected ellipse until the deviation meets the requirements, and the target image is output.

8. The method for detecting excessive oil level at a train air compressor according to claim 1, characterized in that, The liquid level comparison strategy includes obtaining the marked baseline and the highest liquid level line, generating coordinate axes based on the image to be analyzed, obtaining the baseline height and the liquid level height respectively, obtaining the difference between the baseline height and the liquid level height, and setting a baseline threshold. When the difference is less than the baseline threshold, the oil level is normal; when the difference is greater than the baseline threshold, the oil level exceeds the limit.

9. A system for detecting excessive oil level at a train air compressor, characterized in that, include: The image acquisition module acquires an image containing the air compressor and the oil surface as the target image, and obtains the key area containing the oil boundary as the image to be analyzed through target detection and cropping. The image processing module obtains the marked region and oil region in the image to be analyzed through semantic segmentation, obtains the baseline liquid level line of the marked region, the first liquid level line and the second liquid level line of the oil region, performs continuity and parallelism evaluation based on the first liquid level line, the second liquid level line and the baseline liquid level line, obtains continuity and parallelism, performs sharpness evaluation based on the marked region and the oil region, obtains sharpness, and obtains credibility through a comprehensive evaluation strategy based on continuity, parallelism and sharpness. The liquid level comparison module determines the final marker baseline and the highest liquid level line based on the reliability, and judges whether the oil level is normal through the liquid level comparison strategy.