A water level real-time monitoring method based on computer vision

By using U-net convolutional neural network and computer vision technology, the automation and intelligence of water level monitoring have been realized, solving the accuracy problem in bright light and improving the accuracy and response speed of water level monitoring.

CN116259008BActive Publication Date: 2026-05-29CHINA THREE GORGES UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA THREE GORGES UNIV
Filing Date
2023-02-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing water level monitoring methods are difficult to guarantee accuracy in bright light and require precise projection of marker points, leading to unstable measurements.

Method used

A real-time water level monitoring method based on U-net convolutional neural network is adopted. The water level is monitored by multiple cameras, the computer automatically recognizes the water level scale of the camera and pops up an alarm when the water level is abnormal, and the water level is analyzed by combining image processing algorithms and deep learning technology.

Benefits of technology

It has achieved automation and intelligence in water level monitoring, improved measurement accuracy and response speed, saved manpower, and met the monitoring needs during flood season operation and off-season.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116259008B_ABST
    Figure CN116259008B_ABST
Patent Text Reader

Abstract

A water level real-time monitoring method based on computer vision, comprising the following steps: step S1: collecting images of a plurality of water level labels, and making a water level label data set; step S2: preprocessing the image data set to obtain a data set after distortion correction and data enhancement; step S3: establishing a U-net convolutional neural network model to segment the scene, segmenting the label and the water surface, and finding the adjacent boundary of the label and the water surface; step S4: visual calibration, calculating the numerical correspondence between the image pixels and the actual size; step S5: calculating the water level value corresponding to the boundary of the label and the water level in step S3; step S6: considering water wave interference, using a video method to detect the water level corresponding to each frame of video; step S7: using the data obtained in step S6, and using the least squares method to estimate the final predicted water level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, and particularly relates to the field of deep learning technology in artificial intelligence, specifically to a real-time water level monitoring method based on computer vision. Background Technology

[0002] Natural disasters have a significant impact on human life and property safety and the economic and ecological development of society. Among them, floods and flash floods occur frequently, making real-time monitoring of dam water levels particularly crucial in the prevention of these disasters.

[0003] Patent document CN113390485A discloses a novel method for measuring reservoir water levels. This method uses a camera to capture water level images containing marker points, then predicts the water level line using a pre-set deep learning-based U-net convolutional neural network algorithm and identifies the pixel coordinates of the marker points using image processing algorithms. The water level value is calculated by referring to the relative elevation of the marker points and their pixel coordinates. This type of technology heavily relies on the identification of image marker points, so accurate measurement becomes more difficult when ambient light is too bright. Furthermore, this method requires very precise projection of the marker points, making it difficult to guarantee measurement accuracy.

[0004] Currently, with the rapid development of neural networks in various fields, the application of water level monitoring combined with neural networks is also gradually developing. However, in the early stages of development, various problems always exist that need to be addressed. Based on these existing problems, this paper proposes a real-time water level monitoring method based on the U-net convolutional neural network. A monitoring center can use multiple cameras to monitor multiple locations. The computer automatically identifies the water level readings on the cameras and triggers an alarm when the water level is abnormal. Monitoring personnel can view the camera footage and report promptly. This greatly saves manpower and shortens the response time for safety precautions. Summary of the Invention

[0005] The purpose of this invention is to propose a real-time water level monitoring method based on U-net convolutional neural network. Through a monitoring center, multiple cameras can be used to monitor multiple locations. The computer automatically identifies the water level scale on the camera and pops up an alarm when the water level is abnormal. Monitoring personnel can view the camera footage and report in a timely manner, which greatly saves manpower and shortens the response time for safety precautions.

[0006] A real-time water level monitoring method based on computer vision, characterized by comprising the following steps:

[0007] Step S1: Collect images of several water level labels and create a water level label dataset;

[0008] Step S2: Preprocess the image dataset to obtain a data augmentation dataset after distortion correction;

[0009] Step S3: Establish a U-net convolutional neural network model to segment the scene, segment the labels and water surface, and find the adjacent boundaries between the labels and the water surface;

[0010] Step S4: Visual calibration, calculating the numerical correspondence between image pixels and actual size;

[0011] Step S5: Calculate the water level value corresponding to the label and water level boundary in step S3;

[0012] Step S6: Considering water wave interference, use video to detect the water level corresponding to each frame of video;

[0013] Step S7: Using the data obtained in step S6, estimate the final predicted water level using the minimum variance method.

[0014] Step S2 includes the following sub-steps:

[0015] Step S201: Create high-resolution photos of a certain size from the images in the dataset acquired in step S1;

[0016] Step S202: Perform distortion correction processing on the water level labels in the image;

[0017] Step S203: Divide the corrected dataset into training set and test set according to a certain ratio. Use the labelme tool in Python to create a label set for the images in the training set. Mark the corresponding labels and background areas on the images. Set the RGB pixel values ​​of the background area to the specified values ​​and the water level label area to the specified values.

[0018] Step S204: Expand the training set sample size by performing image deformation methods such as rotation transformation, perspective transformation, and scaling and cropping on the image.

[0019] Step S3 includes the following sub-steps:

[0020] Step S301: Establish a U-net convolutional neural network model to segment the scene. Input the dataset from step S2 into the U-net model for training and distinguish the regions with water level labels in the image.

[0021] Step S302: Establish water level label regions segmented from the image, obtaining their bottom pixel positions as (x1, y1), (x2, y2)...(x...). n y n Assuming the bottom curve is:

[0022] f 曲(x)=ax 2 +bx+c

[0023] The values ​​of a, b, and c when the error is minimized are calculated using the least squares method, and the adjacent boundary curves between the label and the water level are then fitted.

[0024] Step S303: Establish the U-net convolutional neural network model;

[0025] Step S304: Obtain the segmentation output result using the established U-net convolutional neural network model.

[0026] In step S303, the established U-net convolutional neural network model is as follows:

[0027] Encoding the image, i.e., performing downsampling: extracting features of the image using two identical convolutions (obtaining the feature extraction layer) → activating the feature extraction layer using the ReLU activation function after each convolution → performing max pooling to compress the feature extraction layer (expanding the global receptive field, doubling the number of feature channels, and reducing the size of the feature extraction layer to half of its previous size) → repeating the previous operation for four downsampling operations.

[0028] Decoding the encoded feature extraction layer involves upsampling: performing two identical convolutions on the feature extraction layer → activating it with the ReLU activation function after each convolution → expanding the feature extraction layer with a deconvolution operation (reducing the number of feature channels to half and doubling the size of the feature extraction layer) → repeating the above operation for four upsampling operations → performing two identical convolutions → activating it with the ReLU activation function after each convolution → obtaining the feature extraction layer (the size is the same as the initial convolution at input) → reducing the number of feature channels using a convolution kernel of a specified size (the number depends on the required output image size) → using the sigmoid activation function for prediction and classification → obtaining a high-quality, seamless segmentation output with the same input and output image sizes.

[0029] Step 4 includes the following sub-steps:

[0030] Step S401: Use the LoG operator of edge detection to detect the water level label region segmented in step S3, and obtain the scale edges and number edges on the water level label;

[0031] Step S402: Use edge information to obtain the coordinates of the first few complete 'E' regions on the right half of the water gauge that are closest to the top;

[0032] Step S403: Calculate the pixel height H from the bottom to the top of the last 'E' region among the first few regions. Given the actual size h from the bottom to the top of each of the first few 'E' regions, calculating the ratio yields the numerical correspondence between image pixels and their actual sizes:

[0033] D = h / H.

[0034] Step 5 includes the following sub-steps:

[0035] Step S501: Input the water level label area segmented in step S3 into the EAST text detector for natural scene text detection, and select the position of the complete number.

[0036] Step S502: Convert the selected digital image area into a grayscale image.

[0037] gray = r * 0.3 + g * 0.59 + b * 0.11

[0038] In the formula, r, g, and b represent the values ​​of the corresponding pixels in the three channels of the image, and gray represents the gray value of the corresponding pixel in the grayscale image.

[0039] Step S503: Binarize the image using the OTSU method:

[0040] 1) Assuming the foreground and background segmentation threshold is t, the proportion of foreground points in the image is w0 with a mean of u0, and the proportion of background points in the image is w1 with a mean of u1, then the mean of the entire image is:

[0041] u = w0 * u0 + w1 * u1

[0042] 2) Establish the objective function:

[0043] g(t)=w0*(u0-u) 2 +w1*(u1-u) 2

[0044] g(t) is the inter-class variance expression of the segmentation threshold t. The OTSU algorithm makes g(t) take the global maximum value. When g(t) is the maximum, the corresponding t is the optimal threshold.

[0045] Step S504: Use the MSER algorithm to extract connected components from the binarized image to obtain individual segmented numbers.

[0046] 1) MSER is based on the concept of watershed and binarizes the image, allowing the binarized image to go through a process from all black to all white;

[0047] 2) During the process, the area of ​​some connected regions changes very little as the threshold increases; these regions are called MSERs.

[0048]

[0049] Q iLet v represent the area of ​​the i-th connected region, and Δ represent a small threshold change when v i If the value is less than a given threshold, the region is considered an MSER.

[0050] Step S505: Use the KNN algorithm to recognize digits and locate the region and value of the smallest digit;

[0051] 1) In high-dimensional space, the formula for calculating the distance between points x and y is:

[0052]

[0053] 2) By calculating the distance between the predicted point and all points, saving and sorting the data, the category of the predicted point is determined based on the category of its K nearest points;

[0054] Step S506: From the segmented water level label region, obtain the left and right edge pixel positions. Represent the edge pixel positions with coordinates (x, y), and calculate the average x value when the left and right edge pixels have the same y value:

[0055]

[0056] Suppose that the obtained point (x, y) satisfies:

[0057] f 中 (x) = ax + b

[0058] Then, the least squares method is used to find the value of 'a' when the error is minimized, and the line in the label region is fitted accordingly.

[0059] Step S507: Combine the bottom curve and midline of the region:

[0060]

[0061] Calculate the position (x, y) of the midpoint of the curve, and then the vertical pixel distance from the bottom of the smallest number to the center of the water level curve;

[0062] Step S508: Let the value of the smallest complete number be N, the vertical pixel distance from the bottom of the smallest number to the center of the water level curve be T pixels, and the correspondence between the scale and the numerical value be D. Then the formula for calculating the current water level value W is as follows:

[0063] W = N * 0.1 - D * T.

[0064] Step 7 includes the following sub-steps:

[0065] Step S701: Assuming the water level is predicted at time t, then take all water level prediction data within a certain period before that time point in step S6.

[0066] Step S702: In the obtained data, x1, x2...x n Let x represent the data at each time point, set its average value as the unknown parameter x, and use the calculated variance as the target value y. From this, the following functional relationship can be obtained:

[0067]

[0068] S703: Find the value of x when the variance is minimized. The mean value of this set of data with the smallest dispersion is x. Finally, the value of x is used as the water level value for the final prediction time t.

[0069] Compared with the prior art, the present invention has the following technical effects:

[0070] 1) Employing computer image processing and deep learning model technology, it automatically processes a large number of video and image files to achieve intelligent identification and analysis of water levels, thereby effectively providing services such as automatic monitoring, threshold setting, automatic judgment, intelligent alarm and remote monitoring, ensuring the intuitiveness, verifiability and traceability of water level measurement data results;

[0071] 2) With the application of intelligent water level image recognition systems in hydrology and water conservancy, the system's functions are constantly being improved. In addition to monitoring, it also features operation during the flood season, idle time during the non-flood season, on-demand monitoring, data replenishment, and remote wake-up. This is of great significance for the orderly conduct of local water level monitoring, flood control, and disaster reduction work. Attached Figure Description

[0072] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0073] Figure 1 This is a flowchart of the method;

[0074] Figure 2 This is a picture of the actual water gauge.

[0075] Figure 3 These are training data images;

[0076] Figure 4 It is a labeled data image;

[0077] Figure 5 This is a schematic diagram of the mesh structure of the U-net convolutional neural network in this invention. Detailed Implementation

[0078] A real-time water level monitoring method based on computer vision, such as Figure 1 As shown, the specific method includes the following steps:

[0079] S1: Using, as Figure 2The water gauge shown collects a large number of images of water level labels to create a water level label dataset.

[0080] S2: The image dataset is preprocessed using Zhang's calibration method and image deformation to obtain a data augmentation dataset after distortion correction;

[0081] S3: Establish a U-net convolutional neural network model to segment the scene, separate the labels and the water surface, and find the adjacent boundaries between the labels and the water surface;

[0082] S4: Visual calibration, which calculates the numerical correspondence between image pixels and actual dimensions;

[0083] S5: Calculate the water level value corresponding to the label and water level boundary in S3;

[0084] S6: Considering water wave interference, use video to detect the water level corresponding to each frame of video;

[0085] S7: Using the data obtained in S6, estimate the final predicted water level using the minimum variance method.

[0086] Preferably, in step S1, a dataset is created by using a high-definition camera to periodically capture water level label images under different real-world conditions, ensuring the comprehensiveness of the training data and achieving high accuracy in prediction under different real-world conditions.

[0087] Preferably, step S2 specifically includes:

[0088] S201: A high-resolution photo of 2048*1536 pixels is created from each image in the dataset collected by S1.

[0089] S202: Using Zhang's calibration method to correct the distortion of water level labels in the image;

[0090] S203: Divide the corrected dataset into training and test sets in an 8:2 ratio, and use the labelme tool in Python to analyze the dataset. Figure 3 The images in the training set shown are processed as follows Figure 4 The label set shown is created by marking the corresponding labels and background areas on the image, setting the RGB pixel values ​​of the background area to (0, 0, 0), and setting the water level label area to (0, 0, 255).

[0091] S204: Data augmentation is performed by transforming images through rotation, perspective, scaling, and cropping to increase the sample size of the training set.

[0092] Preferably, step S3 specifically includes:

[0093] S301: Establish a U-net convolutional neural network model to segment the scene. Input the dataset in S2 into the U-net model for training and distinguish the regions with water level labels in the image.

[0094] S302: From the segmented water level label regions in the image, the bottom pixel positions are obtained as (x1, y1), (x2, y2)...(x...). n y n Assuming the bottom curve is:

[0095] f 曲 (x)=ax 2 +bx+c

[0096] The values ​​of a, b, and c when the error is minimized are calculated using the least squares method, and the adjacent boundary curves between the label and the water level are then fitted.

[0097] S303: Establish as follows Figure 5 The U-net convolutional neural network model shown:

[0098] Encoding the image, i.e., performing downsampling: extracting features of the image using two identical convolutions (obtaining the feature extraction layer) → activating the feature extraction layer using the ReLU activation function after each convolution → performing max pooling to compress the feature extraction layer (expanding the global receptive field, doubling the number of feature channels, and reducing the size of the feature extraction layer to half of its previous size) → repeating the previous operation for four downsampling operations.

[0099] Decoding the encoded feature extraction layer involves upsampling: performing two identical convolutions on the feature extraction layer → activating it with the ReLU activation function after each convolution → expanding the feature extraction layer with a deconvolution operation (reducing the number of feature channels to half and doubling the size of the feature extraction layer) → repeating the above operation for four upsampling operations → performing two identical convolutions → activating it with the ReLU activation function after each convolution → obtaining the feature extraction layer (the size is the same as the initial convolution at input) → reducing the number of feature channels using a convolution kernel of a specified size (the number depends on the required output image size) → using the sigmoid activation function for prediction and classification → obtaining a high-quality, seamless segmentation output with the same input and output image sizes.

[0100] Preferably, step S4 specifically includes:

[0101] S401: Use the LoG operator for edge detection to detect the segmented water level label region in S3, and obtain the scale edges and number edges on the water level label;

[0102] S402: Use edge information to obtain the coordinates of the first few complete 'E' regions on the right half of the water gauge that are closest to the top;

[0103] S403: Calculate the pixel height H from the bottom to the top of the last 'E' region among the first few regions. Given the actual dimensions h (in meters) of the first few 'E' regions from bottom to top, calculating the ratio yields the numerical correspondence between image pixels and their actual dimensions:

[0104] D = h / H

[0105] Preferably, step S5 specifically includes:

[0106] S501: Input the water level label region segmented in S3 into the EAST text detector for natural scene text detection, and select the position of the complete number.

[0107] S502: Convert the selected digital image area into a grayscale image.

[0108] gray = r * 0.3 + g * 0.59 + b * 0.11

[0109] In the formula, r, g, and b represent the values ​​of the corresponding pixels in the three channels of the image, and gray represents the gray value of the corresponding pixel in the grayscale image.

[0110] S503: Use the OTSU method to binarize the image:

[0111] 1) Assuming the foreground and background segmentation threshold is t, the proportion of foreground points in the image is w0 with a mean of u0, and the proportion of background points in the image is w1 with a mean of u1, then the mean of the entire image is:

[0112] u = w0 * u0 + w1 * u1

[0113] 2) Establish the objective function:

[0114] g(t)=w0*(u0-u) 2 +w1*(u1-u) 2

[0115] g(t) is the inter-class variance expression for the segmentation threshold t. The OTSU algorithm makes g(t) take the global maximum value. The t corresponding to the maximum value of g(t) is the optimal threshold.

[0116] S504: Use the MSER algorithm to extract connected components from the binarized image to obtain individual segmented numbers:

[0117] 1) MSER is based on the concept of watershed and binarizes the image with a binarization threshold of (0, 255), allowing the binarized image to go through a process from all black to all white;

[0118] 2) During the process, the area of ​​some connected regions changes very little as the threshold increases; these regions are called MSERs.

[0119]

[0120] Q i Let v represent the area of ​​the i-th connected region, and Δ represent a small threshold change when v i If the value is less than a given threshold, the region is considered an MSER.

[0121] S505: Uses the KNN algorithm to recognize digits and locate the region and value of the smallest digit;

[0122] 1) The common KNN algorithm uses Euclidean distance to measure the distance between points in space. In high-dimensional space, the formula for calculating the distance between points x and y is:

[0123]

[0124] 2) By calculating the distance between the predicted point and all points, saving and sorting the data, the category of the predicted point is determined based on the category of its K nearest points.

[0125] S506: From the segmented water level label region, obtain the left and right edge pixel positions. Represent the edge pixel positions with coordinates (x, y), and calculate the average x value when the left and right edge pixels have the same y value:

[0126]

[0127] Suppose that the obtained point (x, y) satisfies:

[0128] f 中 (x) = ax + b

[0129] Then, the least squares method is used to find the value of 'a' when the error is minimized, and the line in the label region is fitted accordingly.

[0130] S507: Bottom curve and midline of the combined area:

[0131]

[0132] Calculate the position (x, y) of the midpoint of the curve, and then the vertical pixel distance from the bottom of the smallest number to the center of the water level curve;

[0133] S508: Let the value of the smallest complete number be N (unit: dm), the vertical pixel distance from the bottom of the smallest number to the center of the water level curve be T pixels, and the correspondence between the scale and the numerical value be D. Then the formula for calculating the current water level value W (unit: m) is as follows:

[0134] W = N * 0.1 - D * T

[0135] Preferably, step S6 is as follows: considering water wave interference, a video method is used for measurement. After acquiring real-time water level monitoring video, it is processed frame by frame into images, and then the water level value of each frame image is obtained using the methods in S2-S5 above.

[0136] Preferably, step S7 specifically includes:

[0137] S701: Assuming the water level is predicted at time t, then take all water level prediction data within 2 seconds before that time point in S6.

[0138] S702: In this set of data, x1, x2...x n Let x represent the data at each time point, set its average value as the unknown parameter x, and use the calculated variance as the target value y. From this, the following functional relationship can be obtained:

[0139]

[0140] S703: Find the value of x when the variance is minimized. The mean value of this set of data with the smallest dispersion is x. Finally, the value of x is used as the water level value for the final prediction time t.

[0141] To facilitate understanding by those skilled in the art, the following embodiments are further provided:

[0142] In S4: Visual calibration, which calculates the numerical correspondence between image pixels and actual dimensions, the specific steps are as follows:

[0143] S401: Use the LoG operator for edge detection to detect the segmented water level label region in S3, and obtain the scale edges and number edges on the water level label;

[0144] S402: Use edge information to obtain the coordinates of the first few complete 'E' regions on the right half of the water gauge that are closest to the top;

[0145] S403: Calculate the vertical pixel height from the bottom to the top of the last 'E' region in the first few regions to be 100px. Given that the actual size from the bottom to the top of the first few 'E' regions is 0.1m, calculating the ratio yields the numerical correspondence between image pixels and actual size:

[0146] D = 0.1 / 100 = 1 × 10 -3 m / px

[0147] Preferably, step S5 specifically includes:

[0148] S501: Input the water level label region segmented in S3 into the EAST text detector for natural scene text detection, and select the position of the complete number.

[0149] S502: Convert the selected digital image region into a grayscale image, and then use the OTSU method to binarize the image;

[0150] S503: The MSER algorithm is used on the binarized image to effectively extract the connected components and obtain a single segmented number;

[0151] S504: Use the KNN algorithm to recognize digits and locate the region and value of the smallest digit;

[0152] S505: By fitting the center line of the segmented water level label region to the left and right edge pixel positions, and combining the bottom curve of the region with the center line, the midpoint position of the curve can be calculated, thus obtaining the vertical pixel distance from the bottom of the minimum number to the center of the water level curve.

[0153] S506: Let the value of the smallest complete number be 5 (unit: dm), the vertical pixel distance from the bottom of the smallest number to the center of the water level curve be 200px, and the correspondence between the scale and the numerical value be D. Then the formula for calculating the current water level value W (unit: m) is as follows:

[0154] W = 5 × 0.1 - 1 × 10 -3 ×200=0.3m

[0155] Preferably, step S6 is as follows: considering water wave interference, a video method is used for measurement. After acquiring real-time water level monitoring video, it is processed frame by frame into images, and then the water level value of each frame image is obtained using the methods in S2-S5 above.

[0156] Preferably, step S7 specifically includes:

[0157] S701: Assuming the water level is predicted at time t, then take all water level prediction data within 2 seconds before that time point in S6.

[0158] S702: In this set of data, assuming 0.2, 0.3, 0.2, 0.5, and 0.3 represent data at various time points, let their average value be set as the unknown parameter x, and let the calculated variance be used as the target value y. From this, the following functional relationship can be obtained:

[0159]

[0160] S703: When x = 0.3, the variance of the target value is minimized, and the mean of this data set with the smallest dispersion is 0.3.

[0161] Finally, the value of 0.3 was used as the final predicted water level value at time t.

[0162] The present invention employs a computer vision-based real-time water level monitoring method, which can greatly improve the speed and accuracy of water level monitoring, and has the advantage of long-term stable operation, eliminating concerns about subsequent equipment maintenance.

Claims

1. A real-time water level monitoring method based on computer vision, characterized in that, It includes the following steps: Step S1: Collect images of several water level labels and create a water level label dataset; Step S2: Preprocess the image dataset to obtain a data augmentation dataset after distortion correction; Step S3: Establish a U-net convolutional neural network model to segment the scene, segment the labels and water surface, and find the adjacent boundaries between the labels and the water surface; Step S4: Visual calibration, calculating the numerical correspondence between image pixels and actual size; Step S5: Calculate the water level value corresponding to the label and water level boundary in step S3; Step S6: Considering water wave interference, use video to detect the water level corresponding to each frame of video; Step S7: Using the data obtained in step S6, estimate the final predicted water level using the minimum variance method; Step S5 includes: Input the water level label area segmented in step S3 into the EAST text detector for natural scene text detection, and select the location of the complete number. The MSER algorithm is used to extract connected components from a binarized image to obtain individual segmented numbers. Perform digit recognition to locate the region and value of the smallest digit; From the segmented water level label region, the left and right edge pixel positions are obtained. These edge pixel positions are represented by coordinates (x, y). The mean x-value is calculated when the left and right edge pixels have the same y-value. ; Assuming the obtained point ( , )satisfy: ; Then use the least squares method to find the error when it is minimized. The value is used to fit the line in the label region; The bottom curve and midline of the combined area: Calculate the position of the midpoint of the curve, and then the vertical pixel distance T from the bottom of the smallest number to the center of the water level curve; Let the value of the smallest complete number be N, the vertical pixel distance from the bottom of the smallest number to the center of the water level curve be T pixels, and the correspondence between the scale and the numerical value be D. Then the formula for calculating the current water level value W is as follows: W=N 0.1-D T。 2. The method according to claim 1, characterized in that, Step S2 includes the following sub-steps: Step S201: Create high-resolution photos of a certain size from the images in the dataset acquired in step S1; Step S202: Perform distortion correction processing on the water level labels in the image; Step S203: Divide the corrected dataset into training set and test set according to a certain ratio. Use the labelme tool in Python to create a label set for the images in the training set. Mark the corresponding labels and background areas on the images. Set the RGB pixel values ​​of the background area to the specified values ​​and the water level label area to the specified values. Step S204: Expand the training set sample size by performing image deformation methods such as rotation transformation, perspective transformation, and scaling and cropping on the image.

3. The method according to claim 1, characterized in that, Step S3 includes the following sub-steps: Step S301: Establish a U-net convolutional neural network model to segment the scene. Input the dataset from step S2 into the U-net model for training and distinguish the regions with water level labels in the image. Step S302: Establish water level label regions segmented from the image, obtaining their bottom pixel positions as (x1, y1), (x2, y2)...(x... n y n Assuming the bottom curve is: ; The error is minimized when calculated using the least squares method. , , The value of is used to fit the adjacent boundary curve between the label and the water level; Step S303: Establish the U-net convolutional neural network model; Step S304: Obtain the segmentation output result using the established U-net convolutional neural network model.

4. The method according to claim 3, characterized in that, In step S303, the established U-net convolutional neural network model is as follows: Encoding the image involves downsampling: using two identical convolutions to extract features from the image to obtain the feature extraction layer → activating the feature extraction layer after each convolution using the ReLU activation function → performing max pooling to compress the feature extraction layer to expand the global receptive field, doubling the number of feature channels and reducing the size of the feature extraction layer to half of its previous size → repeating the previous operation four times for downsampling. Decoding the encoded feature extraction layer involves upsampling: performing two identical convolutions on the feature extraction layer → activating it with the ReLU activation function after each convolution → performing deconvolution to expand the feature extraction layer, reducing the number of feature channels to half and doubling the size of the feature extraction layer → repeating the previous operation for four upsampling cycles → performing two identical convolutions → activating it with the ReLU activation function after each convolution → obtaining the feature extraction layer → using a convolution kernel of a specified size to reduce the number of feature channels → using the sigmoid activation function for prediction and classification → obtaining a high-quality, seamless segmentation output with the same input and output image sizes.

5. The method according to claim 1, characterized in that, Step S4 includes the following sub-steps: Step S401: Use the LoG operator of edge detection to detect the water level label region segmented in step S3, and obtain the scale edges and number edges on the water level label; Step S402: Use edge information to obtain the coordinates of the first few complete 'E' regions on the right half of the water gauge that are closest to the top; Step S403: Calculate the pixel height H from the bottom to the top of the last 'E' region among the first few regions. Given the actual size h from the bottom to the top of each of the first few 'E' regions, calculating the ratio yields the numerical correspondence between image pixels and their actual sizes: D = h / H.

6. The method according to any one of claims 1 to 5, characterized in that, Step S7 includes the following sub-steps: Step S701: Assuming the water level is predicted at time t, then take all water level prediction data within a certain period before that time point in step S6. Step S702: In the obtained data, x1, x2...x n Let x represent the data at each time point, set its average value as the unknown parameter x, and use the calculated variance as the target value y. From this, the following functional relationship can be obtained: ; Step S703: Find the value of x when the variance is minimized. The mean value of this set of data with the smallest dispersion is x. Finally, use the value of x as the water level value for the final prediction time t.