Multi-frame water gauge-free anti-watermark water level detection method
By using multi-frame spatiotemporal image sequence and 3D-UNet model in water level detection, the accuracy and reliability of water level detection in complex natural environments are solved, and higher detection accuracy and lower error detection rate are achieved.
Patent Information
- Application Number
- CN202411685128.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-04
AI Technical Summary
The existing water level detection technology of unwatered ruler is susceptible to water level fluctuations, weeds and stained watermarks in complex natural environments, resulting in low detection accuracy and high error detection rate, affecting the reliability of detection.
The water mark anti-water mark water level detection method based on multi-frames is used to pre-process the image through an LMS adaptive filter, and a multi-frame spatiotemporal image sequence is constructed, and a 3D-UNet water level detection model is used for detection.
It significantly improves the accuracy and reliability of water level detection, reduces the false detection rate, improves the intelligence level of detection, and provides new ideas for further research and application.
Smart Images

Figure CN119559579A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of water conservancy detection, in particular to a multi-frame water-rule-free anti-watermark water level detection method. Background Art
[0002] Research on water level detection technology without water gauge has shown wide application potential in many fields, such as hydrological environment detection, disaster warning and water resources management. However, the current water level detection technology without water gauge still has some shortcomings:
[0003] (1) Traditional methods often rely only on the spatial information of a single image, ignoring the importance of the temporal dimension, resulting in incomplete feature extraction, insufficient information, and difficulty in distinguishing the real water level and the watermark area;
[0004] (2) When the water level fluctuates and aquatic plants interfere with the river bank, watermarks will appear. The watermarks interfere with the actual water level, resulting in low accuracy and high false detection rate of the existing detection algorithm, which affects the reliability of water level detection. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and propose a multi-frame water level detection method based on watermark-resistant watermark without water gauge, which can eliminate the influence of water level fluctuation, weeds and stain watermarks on water level detection without water gauge in complex natural environment, pre-process the image through adaptive filter, construct multi-frame spatiotemporal image sequence, and use deep learning model for detection, which significantly improves the accuracy and reliability of water level detection and reduces the false detection rate. The present invention not only improves the intelligent level of water level detection, but also provides new ideas for further research and application.
[0006] The present invention solves the technical problem by adopting the following technical solutions:
[0007] The water level detection method based on multi-frame water ruler-free anti-watermark includes the following steps:
[0008] Step 1: Obtain surveillance images from the video;
[0009] Step 2: Use LMS adaptive filter to process the monitoring image;
[0010] Step 3: extract continuous frames from the monitored image to be processed through a continuous frame extraction module TFEM, and construct a spatiotemporal image sequence;
[0011] Step 4: Train the 3D-UNet water level detection model based on the spatiotemporal image sequence;
[0012] Step 5: Output the final water level result through the 3D-UNet water level detection model.
[0013] Moreover, the specific implementation method of step 2 is:
[0014] y(n)=w T (n)x(n)
[0015] Where y(n) is the output of the filter, x(n) is the pixel value vector within the window, and w(n) is the filter coefficient vector;
[0016] The filter coefficients are updated as:
[0017] w(n+1)=w(n)+με(n)x(n)
[0018] ε(n)=d(n)-y(n)
[0019] Where μ is the step size factor, ε(n) is the error signal, and d(n) is the true or estimated value of the center pixel of a local window of the image.
[0020] Moreover, the specific implementation method of step 3 is:
[0021] Step 3.1, frame selection is performed through the continuous frame extraction module TFEM;
[0022] Step 3.2, stack the selected frames;
[0023] Step 3.3, preprocessing the stacked frames;
[0024] Step 3.4: Convert the data format of the preprocessed frame.
[0025] Moreover, the specific implementation method of step 3.1 is: select continuous frames from the video stream to form a time window, the video sequence V contains T frames, denoted as V = {v1, v2, ..., v t+(n-1)τ ,}, where each v t Represents the tth frame, extracting n consecutive frames as a set of data, denoted as F:
[0026] F={v t ,v t+τ ,v t+2τ ,…,v t+(n-1)τ}
[0027] Where t is the start index of the frame, τ is the frame interval, and n is the frame window size.
[0028] Moreover, the specific implementation method of step 3.2 is: stacking the selected consecutive frames together to form a three-dimensional array D:
[0029] D={v t ,v t+τ ,v t+2τ ,…,vt+(n-1)τ}
[0030] The shape of D is (n,H,W), where H and W are the height and width of the frame respectively.
[0031] Moreover, the specific implementation method of step 3.3 is: resizing and normalizing the height and width H×W of the frame.
[0032] Moreover, the specific implementation method of step 3.4 is: converting the processed frame data into a four-dimensional tensor format suitable for 3D convolutional network input, with a shape of (N, n, H, W), where N is the batch size, n is the frame window size, and H and W are the height and width of the frame.
[0033] Furthermore, the step 4 comprises the following steps:
[0034] Step 4.1, trim the 3D-UNet network to achieve a balance between the model detection effect and detection speed;
[0035] Step 4.2, iteratively train the data set constructed using the spatiotemporal image sequence to obtain the model; after obtaining the model, take the reference point as the center in the image, expand the image width to the left and right by 5% to obtain the left and right boundaries of the water-free ruler, and keep the upper and lower boundaries consistent with the image. After obtaining the boundary of the water-free ruler, cut the water-free ruler out of the image and send it to the model for detection to obtain the water level line area.
[0036] The advantages and positive effects of the present invention are:
[0037] 1. The present invention obtains monitoring images from videos; processes the monitoring images using an LMS adaptive filter; extracts continuous frames from the processed monitoring images using a continuous frame extraction module TFEM, and constructs a spatiotemporal image sequence; trains a 3D-UNet water level detection model based on the spatiotemporal image sequence; and outputs the final water level result using the 3D-UNet water level detection model. The present invention can eliminate the influence of water level fluctuations, weeds, and stain watermarks on water level detection without a water gauge in a complex natural environment, pre-processes the images using an adaptive filter, constructs a multi-frame spatiotemporal image sequence, and uses a deep learning model for detection, which significantly improves the accuracy and reliability of water level detection and reduces the false detection rate. The present invention not only improves the intelligence level of water level detection, but also provides new ideas for further research and application.
[0038] 2. The present invention trims the original 3D-UNet network to achieve a balance between effect and performance indicators, ensuring the real-time processing capability of the model and making it more practical.
[0039] 3. The present invention proposes a multi-frame anti-watermarking method, uses adaptive filtering to process images, combines spatiotemporal image sequences, and comprehensively considers information in both time and space dimensions, so as to make an accurate distinction between watermarks and real water levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0041] The present invention is further described in detail below with reference to the accompanying drawings.
[0042] Based on multi-frame water level detection method without watermark, such as Figure 1 As shown, the following steps are included:
[0043] Step 1: Get surveillance images from the video.
[0044] Step 2: Use LMS adaptive filter to process the monitoring image.
[0045] The LMS-based adaptive filter in step 2 is a filter that uses the LMS criterion to dynamically adjust the filter coefficients:
[0046] y(n)=w T (n)x(n)
[0047] Where y(n) is the output of the filter, x(n) is the pixel value vector within the window, and w(n) is the filter coefficient vector;
[0048] The filter coefficients are updated as:
[0049] w(n+1)=w(n)+με(n)x(n)
[0050] ε(n)=d(n)-y(n)
[0051] Where μ is the step size factor, ε(n) is the error signal, and d(n) is the true or estimated value of the center pixel of a local window of the image.
[0052] Step 3: Continuous frame extraction module TFEM is used to extract continuous frames from the monitored image to be processed, and a spatiotemporal image sequence is constructed.
[0053] The specific implementation method of step 3 is:
[0054] Step 3.1: Frame selection is performed through the continuous frame extraction module TFEM.
[0055] Select consecutive frames from the video stream to form a time window. The video sequence V contains T frames, denoted as V = {v1, v2, …, v t+(n-1)τ,}, where each v t Represents the tth frame, extracting n consecutive frames as a set of data, denoted as F:
[0056] F={v t ,v t+τ ,v t+2τ ,…,v t+(n-1)τ}
[0057] Where t is the start index of the frame, τ is the frame interval, and n is the frame window size.
[0058] Step 3.2: Stack the selected frames.
[0059] Stack selected consecutive frames together to form a three-dimensional array D:
[0060] D={v t ,v t+τ ,v t+2τ ,…,v t+(n-1)τ}
[0061] The shape of D is (n,H,W), where H and W are the height and width of the frame respectively.
[0062] Step 3.3: Preprocess the stacked frames. Resize and normalize the height and width H×W of the frames.
[0063] Step 3.4: Convert the data format of the preprocessed frame.
[0064] The processed frame data is converted into a four-dimensional tensor format suitable for 3D convolutional network input, with a shape of (N, n, H, W), where N is the batch size, n is the frame window size, and H and W are the height and width of the frame.
[0065] Step 4: Train the 3D-UNet water level detection model based on the spatiotemporal image sequence.
[0066] Perform water level area detection. The water level area detection uses a deep learning model based on 3D-UNet training. Training the model requires the following steps:
[0067] Step 4.1, trim the 3D-UNet network to achieve a balance between the model detection effect and detection speed;
[0068] Step 4.2, iteratively train the data set constructed using the spatiotemporal image sequence to obtain the model; after obtaining the model, take the reference point as the center in the image, expand the image width to the left and right by 5% to obtain the left and right boundaries of the water-free ruler, and keep the upper and lower boundaries consistent with the image. After obtaining the boundary of the water-free ruler, cut the water-free ruler out of the image and send it to the model for detection to obtain the water level line area.
[0069] Step 5: Output the final water level result through the 3D-UNet water level detection model.
[0070] The water level area in step 4 is judged to obtain the final water level detection result.
[0071] The present invention obtains monitoring images from videos; processes the monitoring images using an LMS adaptive filter; extracts continuous frames from the processed monitoring images using a continuous frame extraction module TFEM, and constructs a spatiotemporal image sequence; trains a 3D-UNet water level detection model based on the spatiotemporal image sequence; and outputs the final water level result using the 3D-UNet water level detection model. The present invention can eliminate the influence of water level fluctuations, weeds, and stain watermarks on water level detection without a water gauge in a complex natural environment, pre-processes the images using an adaptive filter, constructs a multi-frame spatiotemporal image sequence, and uses a deep learning model for detection, thereby significantly improving the accuracy and reliability of water level detection and reducing the false detection rate. The present invention not only improves the intelligent level of water level detection, but also provides new ideas for further research and application.
[0072] The present invention is based on multi-frame water gauge-free anti-watermark water level detection and can be applied to water level monitoring in multiple scenarios. By using this technology, the influence of stains, watermarks and light in complex natural environments can be eliminated. There is no need to install a water gauge or worry about complex hydrological environments. Water level monitoring can be performed around the clock, and it can be determined whether the water level reading is within the preset water level range, achieving real-time and accurate monitoring of the water level.
[0073] It should be emphasized that the embodiments described in the present invention are illustrative rather than restrictive. Therefore, the present invention includes but is not limited to the embodiments described in the specific implementation manner. Any other implementation manners derived by those skilled in the art based on the technical solution of the present invention also fall within the scope of protection of the present invention.
Claims
1. A multi-frame water-rule-free anti-watermark water level detection method, characterized by: The following steps are involved: Step 1: Obtain surveillance images from the video; Step 2: Use LMS adaptive filter to process the monitoring image; Step 3: extract continuous frames from the monitored image to be processed through a continuous frame extraction module TFEM, and construct a spatiotemporal image sequence; Step 4: Train the 3D-UNet water level detection model based on the spatiotemporal image sequence; Step 5: Output the final water level result through the 3D-UNet water level detection model.
2. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 1 is characterized in that: The specific implementation method of step 2 is: y(n)=w T (n)x(n) Where y(n) is the output of the filter, x(n) is the pixel value vector within the window, and w(n) is the filter coefficient vector; The filter coefficients are updated as: w(n+1)=w(n)+με(n)x(n) ε(n)=d(n)-y(n) Where μ is the step size factor, ε(n) is the error signal, and d(n) is the true or estimated value of the center pixel of a local window of the image.
3. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 1 is characterized in that: The specific implementation method of step 3 is: Step 3.1, frame selection is performed through the continuous frame extraction module TFEM; Step 3.2, stack the selected frames; Step 3.3, preprocessing the stacked frames; Step 3.4: Convert the data format of the preprocessed frame.
4. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 3 is characterized in that: The specific implementation method of step 3.1 is: select continuous frames from the video stream to form a time window, the video sequence v contains T frames, denoted as V = {v1, v2, ..., v t+(n-1)τ ,}, where each v t Represents the tth frame, extracting n consecutive frames as a set of data, denoted as F: F={v t ,v t+τ ,v t+2τ ,…,v t+(n-1)τ } Where t is the start index of the frame, τ is the frame interval, and n is the frame window size.
5. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 4 is characterized in that: The specific implementation method of step 3.2 is: stack the selected consecutive frames together to form a three-dimensional array D: D={v t ,v t+τ ,v t+2τ ,…,v t+(n-1)τ } The shape of D is (n,H,W), where H and W are the height and width of the frame respectively.
6. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 5 is characterized in that: The specific implementation method of step 3.3 is: resizing and normalizing the height and width H×W of the frame.
7. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 6 is characterized in that: The specific implementation method of step 3.4 is: converting the processed frame data into a four-dimensional tensor format suitable for 3D convolutional network input, with a shape of (N, n, H, W), where N is the batch size, n is the frame window size, and H and W are the height and width of the frame.
8. The method for detecting water level based on multi-frame water-rule-free anti-watermark according to claim 1 is characterized in that: The step 4 comprises the following steps: Step 4.1, trim the 3D-UNet network to achieve a balance between the model detection effect and detection speed; Step 4.2, iteratively train the data set constructed using the spatiotemporal image sequence to obtain the model; after obtaining the model, take the reference point as the center in the image, expand the image width to the left and right by 5% to obtain the left and right boundaries of the water-free ruler, and keep the upper and lower boundaries consistent with the image. After obtaining the boundary of the water-free ruler, cut the water-free ruler out of the image and send it to the model for detection to obtain the water level line area.