Dripping recognition method, system and device based on video comparison and storage medium

By dynamically updating the baseline library and employing a hierarchical comparison strategy, combined with a multi-dimensional verification model and time consistency check, the baseline drift and interference problems in video detection were solved, enabling accurate identification and graded early warning of minute leaks in complex scenarios.

CN121884251BActive Publication Date: 2026-07-31GUANGZHOU GUOXUN ROBOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-19
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing video detection technologies struggle to distinguish between minute drips and dynamic environmental interference in complex scenarios, and baseline frames are prone to drift, resulting in low recognition accuracy.

Method used

A three-level recognition architecture is adopted, which includes dynamically updated baseline library, hierarchical spatiotemporal comparison and multi-dimensional verification. By extracting pixel-level differences, matching features-level motion and analyzing frame groups-level trends, combined with multi-dimensional verification models and time consistency checks, hierarchical early warning signals are generated.

Benefits of technology

It improves the accuracy and anti-interference ability of identifying tiny leaks in complex scenarios, and forms a closed-loop optimization system of detection, early warning and feedback, which enhances the robustness and accuracy of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884251B_ABST
    Figure CN121884251B_ABST
Patent Text Reader

Abstract

This application provides a video comparison-based method, system, device, and storage medium for drip detection, relating to the field of target detection technology. The method includes: acquiring a video stream of a specified monitoring area and preprocessing the video frames; constructing an initial baseline library based on drip-free sample frames and updating the baseline library using an adaptive update mechanism; comparing the preprocessed video frames with the baseline library and locating suspected drip areas from the video stream using a hierarchical comparison strategy; extracting drip-related features from the suspected drip areas, inputting them into a multi-dimensional verification model for judgment, and outputting the identification result of whether a drip event has occurred after time consistency verification; generating a graded early warning signal based on the identified drip event, and feeding back interference information from the identification result to optimize the baseline library. This approach improves the accuracy and anti-interference capability of identifying minute drips in complex scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of target detection technology, and in particular to a drip identification method, system, device and storage medium based on video comparison. Background Technology

[0002] Leak detection technology is a key technology in industrial production and public welfare. Even tiny leaks from pipelines, storage tanks, and other facilities can easily lead to resource waste, safety accidents, and pollution. Leak detection technologies include two categories: contact detection and non-contact video detection. Traditional video detection avoids the installation and maintenance difficulties of contact detection, but it is usually based on single-frame segmentation or simple inter-frame difference, making it susceptible to dynamic interference such as light fluctuations and equipment shaking. Among related technologies, video comparison techniques mostly use fixed baseline frames; however, baseline frames are prone to baseline drift during long-term monitoring, and this method relies solely on inter-frame pixel differences, making it difficult to distinguish between real leaks and other dynamic environmental interferences, resulting in low accuracy in identifying tiny leaks in complex scenarios. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a video comparison-based drip identification method, system, device and storage medium, which improves the accuracy and anti-interference ability of identifying tiny drips in complex scenarios through a three-level identification architecture of dynamically updating the baseline library, hierarchical spatiotemporal comparison and multi-dimensional verification.

[0004] In a first aspect, this application provides a video comparison-based method for identifying dripping events. The method includes: acquiring a video stream of a specified monitoring area and preprocessing the video frames; wherein the video stream includes multiple consecutive video frames; constructing an initial baseline library based on drip-free sample frames and updating the baseline library using an adaptive update mechanism to suppress baseline drift caused by cumulative scene changes; comparing the preprocessed video frames with the baseline library and locating suspected dripping areas from the video stream using a hierarchical comparison strategy; wherein the hierarchical comparison strategy includes sequentially performing pixel-level difference extraction, feature-level motion matching, and frame group-level trend analysis; extracting dripping-related features for suspected dripping areas, inputting them into a multi-dimensional verification model for judgment, and outputting the identification result of whether a dripping event has occurred after time consistency verification; generating a graded early warning signal based on the identified dripping event, and feeding back the interference information in the identification result to optimize the baseline library.

[0005] Furthermore, the preprocessing includes illumination normalization and noise suppression. Illumination normalization specifically uses the Retinex algorithm to decompose the illumination and reflection components of the video frame to eliminate the influence of illumination fluctuations. Noise suppression specifically uses a guided filtering algorithm to remove Gaussian noise and salt-and-pepper noise.

[0006] Furthermore, an adaptive update mechanism is adopted to update the baseline library, including: setting an adaptive sliding time window, calculating the difference between each frame in the window and the baseline library, and calculating the overall difference based on the difference of all frames in the window; when the overall difference is less than a preset threshold, a weighted average method is used to update each frame in the window to the baseline library; wherein, the weight of each frame in the window is allocated according to the frame quality; when the overall difference is greater than or equal to the preset threshold, baseline library reconstruction is triggered; during the process of updating the baseline library, an exponential moving average algorithm is used to smooth the feature parameters of the baseline library to correct the accumulated error.

[0007] Furthermore, the preprocessed video frames are compared with a baseline library, and suspected dripping regions are located from the video stream using a hierarchical comparison strategy. This includes: performing a difference operation between the preprocessed video frames and the best matching baseline frames in the baseline library, and obtaining preliminary difference regions through adaptive threshold segmentation; wherein, the best matching baseline frames are filtered by structural similarity; extracting the morphological and motion features of the preliminary difference regions and matching them with the corresponding features of the preceding frames to filter out candidate regions with continuous motion trajectories; in a frame group consisting of multiple consecutive frames, analyzing the area and position change trends of the candidate regions, and marking the candidate regions that conform to the preset dripping motion pattern as suspected dripping regions.

[0008] Furthermore, for suspected dripping areas, drip-related features are extracted, input into a multi-dimensional verification model for judgment, and after time consistency verification, the identification result of whether a dripping event has occurred is output. This includes: extracting a set of feature vectors composed of morphological features, trajectory features, and grayscale features from the suspected dripping area; inputting the set of feature vectors into a pre-trained multi-dimensional verification model to obtain a preliminary judgment result; wherein, the preliminary judgment result includes dripping or no dripping; performing time consistency verification on the preliminary judgment results of multiple consecutive frames; when the preliminary judgment results of multiple consecutive frames meet the preset conditions, the final real dripping identification result is confirmed and output.

[0009] Furthermore, the morphological features include: the aspect ratio of the region is between 1.5 and 3, and the outline roundness is between 0.3 and 0.6; the trajectory features include: the slope of the motion trajectory is between 60 and 85 degrees, and the position offset between adjacent frames is between 5 and 20 pixels; the grayscale features include: the difference between the average grayscale value of the region and the average grayscale value of the background is between 10 and 40.

[0010] Furthermore, the time consistency check specifically includes: if at least 3 consecutive frames are determined to be leaks, then a leak event is confirmed; if a single frame is determined to be a leak, and the frame before and after the single frame is not determined to be a leak, then it is considered a false detection.

[0011] Secondly, this application provides a video comparison-based dripping detection system, comprising: a video acquisition and preprocessing module for acquiring a video stream of a specified monitoring area and preprocessing the video frames; wherein the video stream includes multiple consecutive video frames; a dynamic baseline library update module for constructing an initial baseline library based on drip-free sample frames and updating the baseline library using an adaptive update mechanism to suppress baseline drift caused by cumulative scene changes; a hierarchical spatiotemporal comparison module for comparing the preprocessed video frames with the baseline library and locating suspected dripping areas from the video stream through a hierarchical comparison strategy; wherein the hierarchical comparison strategy includes sequentially executing pixel-level difference extraction, feature-level motion matching, and frame group-level trend analysis; a feature verification and decision module for extracting dripping-related features for suspected dripping areas, inputting them into a multi-dimensional verification model for judgment, and outputting the identification result of whether a dripping event has occurred after time consistency verification; and an early warning and feedback control module for generating hierarchical early warning signals based on the identified dripping events and feeding back interference information in the identification results to optimize the baseline library.

[0012] Thirdly, this application provides a drip identification device based on video comparison, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above-mentioned drip identification method based on video comparison.

[0013] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when called and executed by a processor, cause the processor to implement the aforementioned video comparison-based drip identification method.

[0014] This application brings the following beneficial effects: The aforementioned video comparison-based dripping identification method, system, device, and storage medium acquire a video stream of a specified monitoring area and preprocess the video frames. The video stream comprises multiple consecutive video frames. An initial baseline library is constructed based on drip-free sample frames, and an adaptive update mechanism is used to update the baseline library to suppress baseline drift caused by cumulative scene changes. The preprocessed video frames are compared with the baseline library, and a hierarchical comparison strategy is used to locate suspected dripping areas from the video stream. This hierarchical comparison strategy includes sequentially executing pixel-level difference extraction, feature-level motion matching, and frame group-level trend analysis. Drip-related features are extracted from suspected dripping areas, input into a multi-dimensional verification model for judgment, and output the identification result of whether a dripping event has occurred after time consistency verification. A graded early warning signal is generated based on the identified dripping event, and interference information from the identification result is fed back to optimize the baseline library.

[0015] This approach constructs a dynamically updated baseline library to resist baseline drift caused by accumulated scene changes. It employs a hierarchical comparison strategy at the pixel, feature, and frame group levels to accurately locate suspected dripping areas. Then, it combines a multi-dimensional verification model with time consistency verification for intelligent judgment, ultimately outputting the recognition result and generating a graded early warning signal. This forms a closed-loop optimization system of detection, early warning, and feedback, improving the accuracy and anti-interference ability of identifying tiny drips in complex scenes.

[0016] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application are realized and obtained through the structures particularly pointed out in the description, claims and drawings.

[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the specific embodiments of this application or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a video comparison-based dripping identification method provided in this application embodiment; Figure 2 A technical architecture diagram of the dripping identification method based on video comparison provided in the embodiments of this application; Figure 3 A structural block diagram of a video comparison-based drip detection system provided in this application embodiment; Figure 4 This is a structural block diagram of a drip identification device based on video comparison, provided as an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] Leak detection technology is a key technology in industrial production and public welfare. Even tiny leaks from pipelines, storage tanks, and other facilities not only waste resources such as water and chemical raw materials but can also lead to safety accidents and environmental pollution. Existing leak detection technologies include two categories: contact detection and non-contact video detection.

[0022] The first type is contact detection methods: Contact detection relies on equipment such as pressure sensors and flow meters, which need to be in direct contact with the monitored medium. The installation and maintenance costs are high, and they are easily affected by medium corrosion and pipeline vibration. They are not sensitive enough to tiny leaks and have poor applicability in complex industrial scenarios such as high temperature and high pressure.

[0023] The second category is video detection methods: Traditional video detection is usually based on single-frame segmentation or simple inter-frame difference, which is easily affected by dynamic interference such as light fluctuations and equipment shaking, making it difficult to distinguish between drips and static stains, resulting in a high false negative rate. Among related technologies, video comparison techniques mostly use fixed baseline frames. However, the baseline frames are prone to failure due to cumulative changes in the scene (such as pipe scaling and dust accumulation) during long-term monitoring, leading to baseline drift problems. Moreover, this method only relies on inter-frame pixel differences, making it difficult to distinguish between real drips and other dynamic environmental interferences (such as dust carried by airflow), resulting in low accuracy in identifying tiny drips in complex scenes.

[0024] Based on this, the present application provides a video comparison-based drip identification method, system, device, and storage medium that can be applied to the identification or detection of minute drips.

[0025] To facilitate understanding of this embodiment, a video comparison-based leak detection method disclosed in this application will first be described in detail, such as... Figure 1 This method includes the following steps: Step S102: Obtain the video stream of the specified monitoring area and preprocess the video frames; wherein, the video stream includes multiple consecutive video frames.

[0026] Specifically, the device executing this embodiment can be a server or a terminal device; here, a terminal device is used as an example for explanation. This terminal device is equipped with a video comparison-based drip detection system. This system includes a dynamic baseline database update module, a hierarchical spatiotemporal comparison detection module, and an intelligent decision-making module, forming a closed loop from detection to feedback, achieving real-time, accurate, and robust identification of minute drips in complex scenarios.

[0027] First, high-definition cameras installed in designated monitoring areas capture video streams to ensure clear image capture of the area. For example, industrial-grade high-definition cameras are deployed directly in front of key monitoring areas such as industrial pipeline interfaces and tank welds.

[0028] During the acquisition of video streams by high-definition cameras, the terminal device continuously receives the video stream, which consists of multiple consecutive video frames. The terminal device can buffer the most recently received video frames, such as 300 frames, which correspond to video data of a specified duration. Each video frame contains frame information, such as a timestamp and frame sequence number.

[0029] The terminal device preprocesses each acquired video frame, including but not limited to illumination normalization and noise suppression.

[0030] By applying an improved Retinex algorithm to video frames for illumination normalization, the illumination and reflection components of the video frames are decomposed to eliminate the impact of illumination fluctuations on pixel grayscale. After illumination normalization, the grayscale value fluctuation of the same monitoring area under different illumination conditions can be significantly reduced, such as from the original 30% to less than 5%. Alternatively, guided filtering algorithms can be used for noise suppression, which can suppress random noise in low signal-to-noise ratio areas while preserving image edge details, reducing the proportion of noisy pixels to below 0.1%.

[0031] After preprocessing each video frame, the terminal device can perform quality assessments. For example, it can use the Laplacian variance algorithm to perform sharpness assessment, or the normalized standard deviation algorithm to perform brightness equalization assessment, or perform motion blur detection based on a preset quality threshold. The terminal device stores the preprocessed video frames as a continuous image sequence. Each frame file contains the original frame, the preprocessed frame, and the corresponding quality assessment data for subsequent processing modules to access.

[0032] Step S104: Construct an initial baseline library based on drop-free sample frames, and update the baseline library using an adaptive update mechanism to suppress baseline drift caused by cumulative scene changes.

[0033] Specifically, when constructing the initial baseline library, a certain number of drip-free sample frames are selected from the preprocessed video frames. These drip-free sample frames can be obtained through manual selection or automatic selection based on specific rules. For example, at the initial stage of system startup, video frames are continuously acquired over a period of time, and the presence of drip features in these frames is analyzed. Frames without drip features are designated as drip-free sample frames. Based on these drip-free sample frames, various feature parameters, such as pixel grayscale values, morphological features, and trajectory features, are calculated to construct the initial baseline library.

[0034] Over time, cumulative changes occur in the scene, such as pipe scaling and dust accumulation, which may cause the feature parameters in the baseline library to become inaccurate, resulting in baseline drift.

[0035] Here, an adaptive update mechanism is used to update the baseline library. During system operation, new droplet-free sample frames are periodically selected from the preprocessed video frames, the feature parameters are recalculated, and compared with the original parameters in the baseline library. When the difference between the new feature parameters and the original parameters is less than a set first threshold, the new feature parameters are updated in the baseline library to ensure that the baseline library can reflect scene changes in real time.

[0036] For example, at preset intervals, such as 1 hour, a certain number of drop-free sample frames are selected from the most recently acquired video frames, such as 50 drop-free sample frames, and the feature parameters of these sample frames are calculated. If the difference between the calculated pixel grayscale value and the original pixel grayscale value in the baseline library is less than 10%, the new pixel grayscale value can be updated to the baseline library.

[0037] When the difference between the new feature parameters and the original parameters is greater than or equal to the set second threshold, the corresponding scenario changes, such as a large area of ​​oil stains appearing on the device surface or the camera being accidentally blocked; at this time, the system determines that the baseline has failed and automatically triggers the baseline library reconstruction process.

[0038] In this way, baseline drift caused by cumulative changes in the scene can be effectively suppressed, improving the accuracy and stability of the system in identifying tiny drips.

[0039] Step S106: The preprocessed video frames are compared with the baseline library, and the suspected dripping area is located from the video stream through a hierarchical comparison strategy. The hierarchical comparison strategy includes pixel-level difference extraction, feature-level motion matching and frame group-level trend analysis performed sequentially.

[0040] Specifically, pixel-level difference extraction is first performed, and a structural similarity algorithm is used to select the optimal matching baseline frame with the highest matching degree to the preprocessed video frame. After performing a difference operation between the preprocessed video frame and the optimal matching baseline frame, in order to extract pixel-level difference regions more accurately, the Otsu algorithm is used to dynamically calculate an adaptive threshold for segmentation, thereby obtaining an initial difference region. This initial difference region is used to assist in the initial focusing of pixel areas that may have dripping defects.

[0041] Next, feature-level motion matching is performed. Morphological and motion features are extracted from connected regions in the initial difference regions, and these features are concatenated to form a region feature descriptor. Then, the K-nearest neighbor matching algorithm is used to match the feature descriptor of each region in the preprocessed video frame with the feature descriptors of all regions in a predetermined number of preceding frames. Regions with continuous motion trajectories are determined based on trajectory overlap, resulting in a candidate region list. Each candidate region is associated with the motion trajectory of multiple frames, thereby filtering out transient interference from discontinuous trajectories, such as flying insects and dust, reducing the impact of interference factors on drip identification.

[0042] Next, frame-group-level trend analysis is performed. Based on the candidate region list and trajectory and morphological data within a frame group (e.g., 10 consecutive frames), the spatiotemporal behavior pattern of each candidate region within the frame group is analyzed. Specifically, the temporal morphological changes and spatial trajectories of the candidate regions can be analyzed. Based on the matching degree of morphological changes with the "top-down contraction-falling-diffusion" template, the scores of trajectory linearity and verticality, and the proportion of consecutively detected frames within the frame group, a comprehensive pattern score is calculated, and suspected dripping areas are identified. This frame-group-level analysis can grasp the movement pattern of dripping from a macroscopic perspective, further improving the accuracy of localization.

[0043] Through the hierarchical comparison strategy implemented at the three levels mentioned above, the system can gradually narrow down the scope, improve the accuracy of positioning, and eliminate the vast majority of dynamic interference.

[0044] Step S108: Extract leakage-related features from the suspected leakage area, input them into a multi-dimensional verification model for judgment, and output the identification result of whether a leakage event has occurred after time consistency verification.

[0045] Specifically, morphological features, trajectory features, and grayscale features related to dripping are extracted from suspected dripping areas. The morphological features of dripping include a shape that is mostly approximately circular or elliptical, and a stretching change during the fall; the trajectory features are usually a vertically downward and relatively continuous motion trajectory; the grayscale features show that there is a significant grayscale difference between the dripping part and the surrounding environment.

[0046] The extracted drip-related features are input into a multi-dimensional validation model. This model can be a lightweight neural network model; it is trained and optimized using a cross-entropy loss function based on a large amount of historical drip sample data, exhibiting high accuracy and generalization ability. The multi-dimensional validation model performs comprehensive analysis and calculation based on the input features, outputting a preliminary judgment result, which includes whether there is a drip or no drip.

[0047] A time consistency check is then performed to rule out any accidental factors that might cause a seemingly dripping situation to occur at a particular moment. This time consistency check monitors the continuous behavior of the suspected dripping area over a specific period. If, within a preset time period, the behavior pattern of the suspected dripping area consistently matches dripping characteristics—for example, the intervals between drips are relatively stable, and the trajectory and shape are consistent—then a dripping event is identified. Otherwise, it is considered an interfering factor, eliminating the possibility of a drip, thus further improving the accuracy and reliability of the identification.

[0048] After multi-dimensional verification model judgment and time consistency check, the final output is the identification result of whether a dripping event has occurred. For example, the identification result can be expressed as a simple judgment of "yes" or "no", or it can display information such as the level, location, and drip rate of the drip.

[0049] Step S110: Generate a graded early warning signal based on the identified dripping events, and feed back the interference information in the identification results to optimize the baseline library.

[0050] Specifically, once a leak is detected, a tiered warning signal is generated based on the severity of the leak, such as the drip rate and the area affected. For example, a Level 1 warning signal indicating a minor leak is generated when the drip rate is slow and the leak area is small, prompting close monitoring of the leak. A Level 2 warning signal indicating a moderate leak is generated when the drip rate increases and the leak area expands, requiring preliminary investigation. A Level 3 warning signal indicating a severe leak is generated when the drip rate is very fast and the leak area is large, requiring immediate action to avoid safety accidents and resource waste.

[0051] Simultaneously, interference information from the identification results is fed back to optimize the baseline library. During the identification process, the system often encounters various interference factors, such as flying insects, dust, and objects carried by airflow. The terminal device collects and analyzes the video frames and feature parameters corresponding to these interference factors, extracting their characteristic patterns. These patterns are then incorporated into the baseline library update process, enabling the library to better distinguish between real leaks and various interference factors, further improving the accuracy and stability of the system's identification of minute leaks in complex scenarios. For example, when a certain type of dust is found to exhibit specific grayscale characteristics and motion trajectories in a video frame, these features are added to the baseline library. This allows the system to more accurately classify it as an interference factor rather than a leak in subsequent identification processes.

[0052] Furthermore, to ensure the continued effectiveness of the system, a feedback mechanism can be established to periodically evaluate and adjust the baseline database. Based on feedback from real-world application scenarios, the parameters of the adaptive update mechanism, such as the first threshold, second threshold, and preset duration, can be continuously optimized to adapt to different monitoring environments and scenario changes. Simultaneously, the multi-dimensional validation model is continuously trained and optimized using newly collected dripping sample data and interference information to improve the model's performance and generalization ability over long-term operation.

[0053] The aforementioned video comparison-based dripping identification method acquires a video stream of a specified monitoring area and preprocesses the video frames. The video stream comprises multiple consecutive video frames. An initial baseline library is constructed based on drip-free sample frames, and an adaptive update mechanism is used to update the baseline library to suppress baseline drift caused by cumulative scene changes. The preprocessed video frames are compared with the baseline library, and a hierarchical comparison strategy is used to locate suspected dripping areas from the video stream. This hierarchical comparison strategy includes sequentially executing pixel-level difference extraction, feature-level motion matching, and frame group-level trend analysis. Drip-related features are extracted for suspected dripping areas, input into a multi-dimensional verification model for judgment, and output the identification result of whether a dripping event has occurred after time consistency verification. A graded early warning signal is generated based on the identified dripping event, and interference information from the identification result is fed back to optimize the baseline library.

[0054] This approach constructs a dynamically updated baseline library to resist baseline drift caused by accumulated scene changes. It employs a hierarchical comparison strategy at the pixel, feature, and frame group levels to accurately locate suspected dripping areas. Then, it combines a multi-dimensional verification model with time consistency verification for intelligent judgment, ultimately outputting the recognition result and generating a graded early warning signal. This forms a closed-loop optimization system of detection, early warning, and feedback, improving the accuracy and anti-interference ability of identifying tiny drips in complex scenes.

[0055] In one approach, a specific embodiment of the preprocessing is as follows: Preprocessing includes illumination normalization and noise suppression. Illumination normalization specifically uses the Retinex algorithm to decompose the illumination and reflection components of the video frame to eliminate the influence of illumination fluctuations. Noise suppression specifically uses a guided filtering algorithm to remove Gaussian noise and salt-and-pepper noise.

[0056] Specifically, preprocessing can include illumination normalization and noise suppression.

[0057] In the process of illumination normalization using the Retinex algorithm, each pixel in the video frame is first converted to the frequency domain, and then the illumination component and reflection component are processed separately. By continuously adjusting the parameters of the illumination component, the final decomposed illumination component can reflect the illumination distribution, thereby eliminating the influence of illumination fluctuations on the video frame image and making the grayscale values ​​of the same monitoring area more stable under different lighting conditions. For example, under conditions of sufficient light during the day and low light at night, after illumination normalization, the grayscale value fluctuations of the monitoring area in the video frame can be controlled within a very small range, providing more accurate basic data for subsequent drip identification. Adaptive stretching and gamma correction are performed on the reflection component to optimize the brightness and contrast of the image.

[0058] In the process of noise suppression using the guided filtering algorithm, a neighborhood of a certain size is selected centered on each pixel in the video frame. Based on the similarity of pixel values ​​and spatial position relationship within the neighborhood, the filtering weight of each pixel is calculated. The pixel values ​​within the neighborhood are then weighted and averaged using these filtering weights to remove Gaussian noise and salt-and-pepper noise, making the preprocessed video frame clearer and smoother, which is beneficial for subsequent analysis and recognition.

[0059] The guided filtering algorithm described above can minimize the impact of noise on video frames while ensuring that image edge details are not blurred when removing Gaussian and salt-and-pepper noise. Taking pipe leak monitoring as an example, detailed information such as the pipe edges and the outline of the leak is crucial for accurate leak identification. The guided filtering algorithm can reduce the proportion of noise pixels to a very low level, making the video frames clearer and facilitating subsequent extraction and analysis of leak-related features.

[0060] After preprocessing, the quality of the video frames is improved, making them better suited for the subsequent drip identification process based on video comparison. This reduces misjudgments and improves the accuracy of determining, locating, and confirming the drip area.

[0061] In one possible implementation, an adaptive sliding time window is set, the difference between each frame within the window and the baseline library is calculated, and the overall difference is calculated based on the difference of all frames within the window. When the overall difference is less than a preset threshold, a weighted average method is used to update each frame within the window to the baseline library. The weight of each frame within the window is allocated according to the frame quality. When the overall difference is greater than or equal to the preset threshold, baseline library reconstruction is triggered. During the process of updating the baseline library, an exponential moving average algorithm is used to smooth the feature parameters of the baseline library to correct the accumulated error.

[0062] Specifically, when setting an adaptive sliding time window, the window size is dynamically adjusted according to the actual monitoring needs and scene characteristics. This sliding time window can be set between 30 and 50 frames. For example, in scenarios where the dripping changes slowly, the window size can be appropriately increased to allow for more comprehensive data analysis; while in scenarios where the dripping changes frequently and rapidly, the window size should be reduced to ensure that changes are captured in a timely manner.

[0063] When calculating the difference between each frame within a window and the baseline library, the feature parameters of each frame can be compared with the corresponding feature parameters in the baseline library. For example, differences in pixel grayscale values, morphological features, and trajectory features can be compared, and these differences can be quantified to obtain the difference between each frame and the baseline library.

[0064] Then, the overall difference is calculated based on the difference of all frames within the window. This can be done using an arithmetic mean or a weighted average.

[0065] When the overall difference is less than a preset threshold (e.g., 0.05 after normalization), it indicates that the frames in the current window differ little from the baseline library. A weighted average method can then be used to update each frame in the window to the baseline library. The weight of each frame within the window is assigned based on frame quality, which can be determined by factors such as image sharpness and integrity. For example, clear, unobstructed frames with no significant noise are assigned higher weights, while blurry, partially missing, or noisy frames are assigned lower weights. Updating the baseline library through a weighted average method allows the baseline library to more accurately reflect the actual scene conditions.

[0066] During the update process, an exponential moving average algorithm is used to smooth the feature parameters of the baseline database. This algorithm assigns different weights to data based on time sequence, with more recent data receiving greater weight and older data receiving less weight. This reduces the impact of sudden abnormal data on the feature parameters of the baseline database during updates, corrects accumulated errors, and ensures that the deviation between the baseline and the actual scene is less than or equal to 2 pixels, allowing the baseline database to gradually converge to a stable and accurate state.

[0067] When the overall difference is greater than or equal to the preset threshold, it indicates that the scene may have changed significantly, such as equipment replacement or sudden environmental changes. At this time, the baseline library reconstruction process is triggered: select no-drip sample frames from the preprocessed video frames, recalculate the feature parameters according to the method of building the initial baseline library, and build a new baseline library to ensure that the system can continue to accurately identify dripping situations.

[0068] By setting an adaptive sliding time window, updating and reconstructing the baseline library appropriately, and using an exponential moving average algorithm for smoothing, the baseline library can always adapt to the dynamic changes in the scene, further improving the reliability and accuracy of the drip identification system.

[0069] In one possible implementation, the preprocessed video frame is differentially analyzed with the optimal matching baseline frame in the baseline library, and an initial difference region is obtained through adaptive threshold segmentation. The optimal matching baseline frame is filtered by structural similarity. The morphological and motion features of the initial difference region are extracted and matched with the corresponding features of the preceding frame to filter out candidate regions with continuous motion trajectories. In a frame group consisting of multiple consecutive frames, the area and position change trends of the candidate regions are analyzed, and candidate regions that conform to the preset dripping motion pattern are marked as suspected dripping regions.

[0070] Specifically, during the difference operation, a structural similarity algorithm is first used to select the optimal matching baseline frame from the baseline library that is most similar to the preprocessed video frame. This structural similarity algorithm considers factors such as the brightness, contrast, and structure of the video frame to ensure that the selected baseline frame has the highest similarity to the preprocessed video frame, such as a structural similarity index greater than or equal to 0.95. After performing the difference operation between the preprocessed video frame and the optimal matching baseline frame, the difference information between the two frames is obtained.

[0071] Next, the results of the difference operation are processed using an adaptive thresholding segmentation method to obtain preliminary difference regions. Adaptive thresholding segmentation can dynamically adjust the threshold based on the local features of the video frame, avoiding the misjudgment problems that may occur with a fixed threshold in different scenarios. For example, in scenes with uneven lighting, adaptive thresholding segmentation can automatically adjust the threshold according to the lighting conditions of different areas, accurately segmenting the difference regions.

[0072] The morphological and motion features of the initially differing regions are extracted. Morphological features include the region's area, perimeter, and circularity, while motion features include the region's speed and direction. These features are then matched with corresponding features in the preceding frames. Candidate regions with continuous motion trajectories are selected based on indicators such as trajectory overlap (e.g., trajectory overlap greater than or equal to 80%), thereby eliminating interfering regions that appear and disappear instantaneously, such as small insects flying by quickly.

[0073] In a frame group consisting of multiple consecutive frames, the trend of area and position changes in candidate regions is analyzed. Dripping typically exhibits certain motion patterns, such as the area first shrinking and then expanding during the fall, and the position moving vertically downwards. By analyzing whether the changes in area and position of candidate regions within the frame group conform to a preset dripping motion pattern, candidate regions that conform to the dripping motion pattern and appear consecutively within the frame group more than or equal to a preset number are marked as suspected dripping regions. For example, if a candidate region exhibits an area that gradually decreases in size and then gradually increases during the fall, with its position moving primarily vertically downwards, and it appears consecutively more than or equal to 6 times within the frame group, then it can be marked as a suspected dripping region.

[0074] Using the above method, the system can accurately locate suspected dripping areas from preprocessed video frames, which helps improve the efficiency and accuracy of the entire dripping identification system.

[0075] In one possible implementation, a set of feature vectors consisting of morphological features, trajectory features, and grayscale features is extracted from the suspected dripping area; the set of feature vectors is input into a pre-trained multi-dimensional verification model to obtain a preliminary judgment result; wherein the preliminary judgment result includes dripping or non-dripping; the temporal consistency of the preliminary judgment results of multiple consecutive frames is checked, and when the preliminary judgment results of multiple consecutive frames meet the preset conditions, the final real dripping identification result is confirmed and output.

[0076] Specifically, when extracting morphological features from suspected dripping areas, a detailed analysis is performed on the shape and size of the area, such as calculating the ratio of the major and minor axes. If this ratio approaches a specific value, it is more likely to resemble a common dripping pattern. When extracting trajectory features, the curvature changes of the trajectory are recorded. Due to gravity, the curvature of a normal dripping trajectory is usually relatively stable and follows a certain pattern. Regarding grayscale features, both grayscale values ​​and their distribution, such as the standard deviation of grayscale, can be analyzed to determine the uniformity of grayscale in the dripping area. The morphological features, trajectory features, and grayscale features together form a feature vector set.

[0077] The extracted feature vector set is input into a pre-trained multi-dimensional validation model. The multi-dimensional validation model makes judgments based on its internal algorithms and rules. For example, a 12-dimensional feature vector composed of morphological features, trajectory features, and grayscale features is input into the multi-dimensional validation model, and operations are performed through a fully connected layer and activation function to output a preliminary judgment result. This preliminary judgment result includes whether there is dripping or no dripping.

[0078] The aforementioned morphological characteristics include: an aspect ratio between 1.5 and 3, and a roundness between 0.3 and 0.6. When the aspect ratio is between 1.5 and 3, the shape of the drip is more in line with common dripping patterns; a roundness between 0.3 and 0.6 indicates that the shape of the area is neither a perfectly regular circle nor too irregular, which is consistent with the approximately elliptical shape formed by a drip under the influence of gravity.

[0079] The aforementioned trajectory characteristics include: a slope between 60 and 85 degrees, and a positional offset between 5 and 20 pixels from adjacent frames. A slope between 60 and 85 degrees indicates that the dripper moves almost vertically downwards under gravity, but may have some slight deviations. A positional offset between 5 and 20 pixels from adjacent frames indicates that the dripper's falling speed is relatively stable and conforms to normal. If the offset is too small, it may indicate that the dripper is not falling or is falling abnormally slowly; if the offset is too large, other interfering factors may be affecting the normal falling of the dripper.

[0080] The aforementioned grayscale characteristics include: the difference between the average grayscale value of the area and the average grayscale value of the background is between 10 and 40. This difference indicates a certain degree of difference between the grayscale value of the dripping area and the background, which is a crucial basis for identifying the dripping area. If the difference is too small, the dripping area will be difficult to distinguish from the background, potentially leading to recognition difficulties; if the difference is too large, it may be due to uneven lighting or other abnormal conditions, affecting the accuracy of recognition.

[0081] In actual drip detection, the above features need to be considered comprehensively. This is because any single feature can be affected by chance; only when multiple features simultaneously meet the corresponding conditions can a drip event be more accurately identified. For example, even if the aspect ratio of a certain area meets the requirements, if the slope of the motion trajectory or the grayscale characteristics do not meet the requirements, then that area cannot be identified as a dripping area.

[0082] Next, a time consistency check is performed. The preset conditions can be flexibly set according to actual conditions. For example, if the preliminary judgment results for five or more consecutive frames are all considered dripping, the final true dripping identification result is confirmed and output, avoiding false dripping events caused by momentary interference. Only when the preliminary judgment results for multiple consecutive frames meet the preset conditions does the system confirm the dripping situation and output the final true dripping identification result, containing detailed information such as whether dripping occurred, the level of dripping, location, and dripping rate, providing an accurate basis for subsequent processing and decision-making. Simultaneously, the confirmed dripping events and related feature data can be used as new samples for subsequent model optimization and training, further improving model performance and recognition accuracy.

[0083] By accurately extracting and analyzing morphological features, trajectory features, and grayscale features, and combining them with multi-dimensional verification models and time consistency checks, the accuracy of drip identification can be further improved, thereby detecting dripping situations in various complex scenarios, timely identifying potential problems, and facilitating equipment maintenance and management.

[0084] In one possible implementation, the time consistency check specifically includes: if at least 3 consecutive frames are determined to be leaks, then a leak event is confirmed; if a single frame is determined to be a leak, and the frame before and after the single frame is not determined to be a leak, then it is considered a false detection.

[0085] Specifically, when performing time consistency verification, if at least 3 consecutive frames are determined to be dripping, it can be confirmed that a dripping event has occurred. The system outputs the final true dripping identification result, which includes detailed information such as whether a dripping event has occurred, the level of the dripping event, the location, and the dripping rate.

[0086] If a single frame is identified as a leak, but the preceding and following frames are not, it's likely due to momentary interference, such as a small insect rapidly flying across the monitoring area or a sudden, brief fluctuation in lighting. This can cause the frame to appear to have a leak-like appearance, but it's not actually a leak. This should be considered a false detection; the system will not recognize it as a leak event, thus avoiding false alarms and ensuring the accuracy and reliability of the leak detection system.

[0087] In practical applications, to further improve the accuracy of time consistency verification, contextual information can be incorporated into the judgment. For example, environmental changes within adjacent time periods can be considered. If there are significant abnormal changes in the environment before and after a single frame is identified as a leak, such as brief vibrations of equipment or sudden movement of nearby personnel, the credibility of classifying the leak in that single frame as a false detection increases. Simultaneously, false detections can be recorded and analyzed to summarize patterns and causes, allowing for optimization of the leak detection system's parameters and algorithms, further reducing the false detection rate and improving the overall system performance.

[0088] In a specific embodiment, such as Figure 2 As shown, a technical framework diagram for drip detection based on video comparison is provided: S201, Monitoring video acquisition and preprocessing; S202, Dynamic Baseline Library Construction and Update; S203, pixel-level difference extraction; S204, Feature-level motion matching; S205, Frame Group-Level Trend Analysis; S206, Extraction of dripping-related features; S207, Multi-dimensional verification model judgment; S208, time consistency check optimization; S209, Early Warning Signal Generation and Feedback.

[0089] The embodiments provided in this application have achieved breakthroughs in key performance indicators, with the following specific advantages: 1) Eliminate baseline drift: By using a dynamic baseline library and an adaptive update mechanism, the system matches scene changes in real time, keeping the long-term deviation between the baseline and the actual scene within 2 pixels. The baseline failure probability is less than 0.5%, and the system stability is improved by 80% compared with traditional methods. 2) Achieve high-precision recognition: By adopting hierarchical spatiotemporal comparison and multi-dimensional feature verification, the recognition accuracy of tiny drips (0.5 drops / minute) exceeds 98.5%, with a false negative rate and a false positive rate of less than 1% and 0.3% respectively. The overall performance is 4-5 times better than the traditional inter-frame difference method. 3) Enhanced environmental robustness: Through preprocessing technologies including illumination normalization and noise suppression, it overcomes complex interferences such as strong light and dust, and can work reliably in a working temperature range of -20℃ to 60℃, making it suitable for various monitoring scenarios such as industrial workshops and outdoor pipelines. 4) High practical value: It adopts a lightweight algorithm architecture and can achieve real-time processing of ≥25 FPS (frames per second) on embedded devices. Combined with hierarchical early warning and feedback optimization, it provides accurate basis for equipment maintenance and reduces leakage management costs by more than 30%.

[0090] This application provides a dripping detection system based on video comparison, such as... Figure 3 As shown, the system includes: The video acquisition and preprocessing module 31 is used to acquire the video stream of a specified monitoring area and preprocess the video frames; wherein the video stream includes multiple consecutive video frames. The dynamic baseline library update module 32 is used to build an initial baseline library based on the drop-free sample frames and update the baseline library with an adaptive update mechanism to suppress baseline drift caused by cumulative scene changes. The hierarchical spatiotemporal comparison module 33 is used to compare the preprocessed video frames with the baseline library and locate suspected dripping areas from the video stream through a hierarchical comparison strategy. The hierarchical comparison strategy includes pixel-level difference extraction, feature-level motion matching and frame group-level trend analysis executed sequentially. The feature verification and decision module 34 is used to extract drip-related features for suspected dripping areas, input them into a multi-dimensional verification model for judgment, and output the identification result of whether a dripping event has occurred after time consistency verification. The early warning and feedback control module 35 is used to generate graded early warning signals based on the identified dripping events, and to feed back the interference information in the identification results to optimize the baseline library.

[0091] The aforementioned video comparison-based drip detection system acquires a video stream of a specified monitoring area and preprocesses the video frames. The video stream comprises multiple consecutive video frames. An initial baseline library is constructed based on drip-free sample frames, and an adaptive update mechanism is used to update the baseline library to suppress baseline drift caused by cumulative scene changes. The preprocessed video frames are compared with the baseline library, and a hierarchical comparison strategy is employed to locate suspected drip areas from the video stream. This hierarchical comparison strategy includes sequentially executing pixel-level difference extraction, feature-level motion matching, and frame group-level trend analysis. Drip-related features are extracted from suspected drip areas, input into a multi-dimensional verification model for judgment, and output the identification result of whether a drip event has occurred after time consistency verification. A graded early warning signal is generated based on the identified drip events, and interference information from the identification results is fed back to optimize the baseline library.

[0092] This approach constructs a dynamically updated baseline library to resist baseline drift caused by accumulated scene changes. It employs a hierarchical comparison strategy at the pixel, feature, and frame group levels to accurately locate suspected dripping areas. Then, it combines a multi-dimensional verification model with time consistency verification for intelligent judgment, ultimately outputting the recognition result and generating a graded early warning signal. This forms a closed-loop optimization system of detection, early warning, and feedback, improving the accuracy and anti-interference ability of identifying tiny drips in complex scenes.

[0093] The above preprocessing includes illumination normalization and noise suppression. Specifically, illumination normalization uses the Retinex algorithm to decompose the illumination and reflection components of the video frame to eliminate the influence of illumination fluctuations. Noise suppression uses a guided filtering algorithm to remove Gaussian noise and salt-and-pepper noise.

[0094] The aforementioned dynamic baseline library update module is further configured to: set an adaptive sliding time window, calculate the difference between each frame within the window and the baseline library, and calculate the overall difference based on the difference of all frames within the window; when the overall difference is less than a preset threshold, update each frame within the window to the baseline library using a weighted average method; wherein, the weight of each frame within the window is allocated according to the frame quality; when the overall difference is greater than or equal to the preset threshold, trigger baseline library reconstruction; during the baseline library update process, use an exponential moving average algorithm to smooth the feature parameters of the baseline library to correct accumulated errors.

[0095] The aforementioned hierarchical spatiotemporal comparison module is also used for: performing differential operations on the preprocessed video frames and the optimal matching baseline frames in the baseline library, and obtaining preliminary difference regions through adaptive threshold segmentation; wherein, the optimal matching baseline frames are filtered by structural similarity; extracting the morphological and motion features of the preliminary difference regions and matching them with the corresponding features of the preceding frames to filter out candidate regions with continuous motion trajectories; in a frame group consisting of multiple consecutive frames, analyzing the area and position change trends of the candidate regions, and marking the candidate regions that conform to the preset dripping motion pattern as suspected dripping regions.

[0096] The aforementioned feature verification and decision module is also used to: extract a set of feature vectors consisting of morphological features, trajectory features, and grayscale features from the suspected dripping area; input the set of feature vectors into a pre-trained multi-dimensional verification model to obtain a preliminary judgment result; wherein the preliminary judgment result includes dripping or non-dripping; perform time consistency verification on the preliminary judgment results of multiple consecutive frames; and when the preliminary judgment results of multiple consecutive frames meet the preset conditions, confirm and output the final real dripping identification result.

[0097] The aforementioned morphological features include: the aspect ratio of the region is between 1.5 and 3, and the outline roundness is between 0.3 and 0.6; the trajectory features include: the slope of the motion trajectory is between 60 and 85 degrees, and the position offset between adjacent frames is between 5 and 20 pixels; the grayscale features include: the difference between the average grayscale value of the region and the average grayscale value of the background is between 10 and 40.

[0098] The aforementioned time consistency check specifically includes: if at least 3 consecutive frames are determined to be leaks, then a leak event is confirmed; if a single frame is determined to be a leak, and the frame before and after that single frame is not determined to be a leak, then it is considered a false detection.

[0099] This embodiment also provides a dripping water identification device based on video comparison, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor. The processor executes the computer-executable instructions to implement the aforementioned dripping water identification method based on video comparison. This dripping water identification device based on video comparison can be a server or a terminal device.

[0100] See Figure 4 As shown, the video comparison-based drip identification device includes a processor 100 and a memory 101. The memory 101 stores computer-executable instructions that can be executed by the processor 100. The processor 100 executes the computer-executable instructions to implement the video comparison-based drip identification method described above.

[0101] Furthermore, Figure 4 The video comparison-based drip identification device shown also includes a bus 102 and a communication interface 103. The processor 100, the communication interface 103, and the memory 101 are connected via the bus 102.

[0102] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0103] The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0104] This embodiment also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-described video comparison-based drip identification method.

[0105] The video comparison-based drip identification method, system, and video comparison-based drip identification device computer program products provided in this application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0107] Furthermore, in the description of the embodiments of this application, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0108] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0109] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0110] Finally, it should be noted that the above embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for drip detection based on video contrast, characterized in that, The method includes: Acquire a video stream of a specified monitoring area and preprocess the video frames; wherein the video stream includes multiple consecutive video frames; An initial baseline library is constructed based on drip-free sample frames, and an adaptive update mechanism is used to update the baseline library to suppress baseline drift caused by cumulative scene changes. The preprocessed video frames are compared with a baseline library, and suspected dripping areas are located from the video stream using a hierarchical comparison strategy. The hierarchical comparison strategy includes sequentially performing pixel-level difference extraction, feature-level motion matching, and frame group-level trend analysis. For the suspected dripping area, drip-related features are extracted, input into a multi-dimensional verification model for judgment, and after time consistency verification, the identification result of whether a dripping event has occurred is output. A graded early warning signal is generated based on the identified dripping events, and the interference information in the identification results is fed back to optimize the baseline library; The method of updating the baseline library using an adaptive update mechanism includes: setting an adaptive sliding time window, calculating the difference between each frame within the window and the baseline library, and calculating the overall difference based on the difference of all frames within the window; when the overall difference is less than a preset threshold, updating each frame within the window to the baseline library using a weighted average method; wherein the weight of each frame within the window is allocated according to frame quality; when the overall difference is greater than or equal to the preset threshold, triggering baseline library reconstruction; during the process of updating the baseline library, using an exponential moving average algorithm to smooth the feature parameters of the baseline library to correct accumulated errors.

2. The method of claim 1, wherein, The preprocessing includes illumination normalization and noise suppression. Specifically, the illumination normalization uses the Retinex algorithm to decompose the illumination and reflection components of the video frame to eliminate the influence of illumination fluctuations. The noise suppression uses a guided filtering algorithm to remove Gaussian noise and salt-and-pepper noise.

3. The method of claim 1, wherein, The preprocessed video frames are compared with a baseline library, and suspected dripping areas are located from the video stream using a layered comparison strategy, including: The preprocessed video frames are compared with the optimal matching baseline frames in the baseline library by differential operation, and the preliminary difference regions are obtained by adaptive threshold segmentation; wherein, the optimal matching baseline frames are selected by structural similarity. The morphological and motion features of the preliminary difference region are extracted and matched with the corresponding features of the preceding frame to filter out candidate regions with continuous motion trajectories. In a frame group consisting of multiple consecutive frames, the area and position change trends of the candidate regions are analyzed, and candidate regions that conform to the preset dripping motion law are marked as suspected dripping regions.

4. The method of claim 1, wherein, Leakage-related features are extracted from the suspected leaking area, input into a multi-dimensional verification model for judgment, and after time consistency verification, the identification result of whether a leaking event has occurred is output, including: Extract a set of feature vectors consisting of morphological features, trajectory features, and grayscale features from the suspected dripping area; The set of feature vectors is input into a pre-trained multi-dimensional verification model to obtain preliminary judgment results; wherein, the preliminary judgment results include whether there is leakage or no leakage. A time consistency check is performed on the preliminary judgment results of multiple consecutive frames. When the preliminary judgment results of multiple consecutive frames meet the preset conditions, the final real leak identification result is confirmed and output.

5. The method of claim 4, wherein, The morphological features include: an aspect ratio between 1.5 and 3, and a roundness of 0.3 to 0.

6. The trajectory features include: a motion trajectory slope between 60 and 85 degrees, and a position offset between adjacent frames between 5 and 20 pixels; The grayscale features include: the difference between the average grayscale value of the region and the average grayscale value of the background is between 10 and 40.

6. The method of claim 4, wherein, The time consistency check specifically includes: if at least 3 consecutive frames are determined to be leaks, then a leak event is confirmed; if a single frame is determined to be a leak, and the frame before and after the single frame is not determined to be a leak, then it is considered a false detection.

7. A drip detection system based on video contrast, characterized in that The system includes: The video acquisition and preprocessing module is used to acquire a video stream of a specified monitoring area and preprocess the video frames; wherein, the video stream includes multiple consecutive video frames; The dynamic baseline library update module is used to build an initial baseline library based on drop-free sample frames and update the baseline library with an adaptive update mechanism to suppress baseline drift caused by cumulative scene changes. The hierarchical spatiotemporal comparison module is used to compare the preprocessed video frames with a baseline library and locate suspected dripping areas in the video stream through a hierarchical comparison strategy; wherein, the hierarchical comparison strategy includes pixel-level difference extraction, feature-level motion matching and frame group-level trend analysis executed sequentially. The feature verification and decision module is used to extract drip-related features for the suspected dripping area, input them into a multi-dimensional verification model for judgment, and output the identification result of whether a dripping event has occurred after time consistency verification. The early warning and feedback control module is used to generate graded early warning signals based on the identified dripping events, and to feed back the interference information in the identification results to optimize the baseline library. The method of updating the baseline library using an adaptive update mechanism includes: setting an adaptive sliding time window, calculating the difference between each frame within the window and the baseline library, and calculating the overall difference based on the difference of all frames within the window; when the overall difference is less than a preset threshold, updating each frame within the window to the baseline library using a weighted average method; wherein the weight of each frame within the window is allocated according to frame quality; when the overall difference is greater than or equal to the preset threshold, triggering baseline library reconstruction; during the process of updating the baseline library, using an exponential moving average algorithm to smooth the feature parameters of the baseline library to correct accumulated errors.

8. A drip detection device based on video contrast, characterized in that The device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the video comparison-based drip identification method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the video comparison-based drip identification method according to any one of claims 1-6.