A non-aqueous rod water level identification method, a terminal device and a storage medium

CN117036780BActive Publication Date: 2026-11-03POWERCHINA ZHONGNAN ENG
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310881053.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-18
Publication Date
2026-11-03
Estimated Expiration
2043-07-18

AI Technical Summary

Technical Problem

Existing water level monitoring methods have low accuracy and poor anti-interference ability when there is no water gauge, and cannot accurately identify the water level when the camera position is off, thus limiting their applicability.

Method used

A semantic segmentation model is used to identify the waterfront boundary line. Local area images are captured, and features are extracted through a lightweight backbone network and linear mapping or binary classification calculation is performed to obtain the absolute water level value. This method is suitable for scenarios where the camera is moving.

Benefits of technology

It improves the accuracy and anti-interference ability of water level identification, adapts to automatic monitoring under various conditions, is suitable for scenarios without water level gauges and with moving cameras, and has high identification accuracy and fast processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117036780B_ABST
    Figure CN117036780B_ABST
Patent Text Reader

Abstract

The application provides a water level recognition method without a water gauge, a terminal device and a storage medium. A river video image is input into a semantic segmentation model to recognize a water bank boundary line in the image, which is used as a water level line, and m local area images containing the water level line are intercepted. Image features (h, w) of a single local area image are extracted, divided into n parts along the width w direction, and the feature dimension of each part is h. Water level recognition is performed on the height h of each part to obtain y1, y2,..., y n n water level values, and an absolute water level value H of a single local area is calculated as H = [(y1+y2+...+y n )‑(y + y max + y min )] / (n‑2). Absolute water level values H1, H2,..., H m m water level values of the m local area images are obtained, and an absolute water level value H' of the video image is calculated as H' = [(H1+H2+...+H m )] / m. The application does not need to install a water gauge, is suitable for a camera moving scene, has high universality, splits an entire body into several parts for absolute water level value calculation, has high recognition accuracy, can effectively exclude interference factors, has strong robustness, and greatly improves the accuracy of water level recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water level detection, specifically to a water level identification method, terminal device, and storage medium without a water gauge. Background Technology

[0002] In recent years, the development of water conservancy informatization has been continuously advancing, and water level monitoring has played an important role in ecological flow and flood control early warning. Traditional water level monitoring methods use various devices based on acoustic principles, radar, infrared, etc., to identify water levels. However, these methods generally suffer from poor anti-interference capabilities, low automation, and high operation and maintenance costs.

[0003] Existing water level monitoring methods generally employ image processing based on water gauges. Typically, target detection algorithms are first used to detect the location of the water gauge, and then image processing algorithms are used to further obtain the water gauge values. However, as the water level changes, the surface of the water gauge, which is submerged in water, will adhere to dirt such as silt and algae, causing the scale on the water gauge to be obscured when the water level drops, affecting the accuracy of water level monitoring. Furthermore, the water gauge is prone to damage due to prolonged contact with the water surface, leading to increased maintenance costs. In addition, this method is not suitable for observation stations that are not equipped with water gauges.

[0004] Chinese invention patent application number 201911349545.2 discloses a video-based method for reading water levels without a water gauge. The method includes manual calibration, where workers use a laser pointer to mark points between the water level line and the shore, and then mark the positions of these laser points on a video image. Using the laser points at the current water level as reference points, the video image is expanded outwards to the left and right of these reference points to obtain the boundaries of a virtual water gauge. The virtual water gauge is then extracted from the video image, and a deep learning model is used to detect the water level region. Finally, regression analysis is performed on the water level region, which is then extracted from the video image and regressed using a deep learning regression model to calculate the water level reading. However, this method requires manual determination of marker points, which is cumbersome and inefficient. Furthermore, manual measurement is prone to errors and interference. When regressing the water level, the coordinate information of laser scatter points is used to perform regression calculations on the entire image. An error in any coordinate point directly affects the accuracy of water level identification, resulting in weak anti-interference capabilities and low recognition precision. Moreover, the construction of the virtual water level gauge relies heavily on laser scatter points. When the camera angle shifts due to external factors, the acquired video image changes, and the initially set reference point's position in the image also shifts, potentially even falling outside the lens. This makes it impossible to accurately identify the water area and riverbank in the video after the camera shifts. Therefore, this method requires a fixed camera position. When the camera is displaced by external factors, it causes a reference point shift, leading to a large deviation in water level readings and making it impossible to accurately monitor the water level. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of the prior art by providing a water level identification method without a water gauge. Another purpose of this invention is to provide a terminal device for this water level identification method without a water gauge. Yet another purpose of this invention is to provide a storage medium capable of executing the above method on a computer, thus adapting to scenarios with moving cameras and observation stations without water gauges, and improving the accuracy of water level identification.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0007] A method for identifying water levels without a water gauge, characterized by comprising the following steps:

[0008] S1. Obtain the river image and input it into the trained semantic segmentation model to identify the water-bank boundary line in the image. The training process of the trained semantic segmentation model includes annotating the water area and riverbank background of the training sample river image, and then inputting the annotated training sample image into the semantic segmentation model for training.

[0009] S2. Select the waterfront boundary line as the water level line, and extract m local area images, wherein the local area images include the water level line;

[0010] S3. Extract the image features (h, w) of a single local region image, divide it into n parts along the width w, and obtain the feature dimension h of each sub-part. Perform water level identification on the height h of each sub-part to obtain y1, y2, ..., y n Given a total of n absolute water level values, the absolute water level value of a single local area is obtained as H = [(y1 + y2 + ... + y...]. n )-(y max +y min )] / (n-2), where y max =max(y1, y2, ..., y n ), y min =min(y1, y2, ..., y n );

[0011] S4. Obtain the absolute water level values ​​H1, H2, ..., Hm of m local region images. m There are m absolute water level values ​​in total. Calculate the absolute water level value H′ of the video image as H′=[(H1+H2+...+H m )] / m.

[0012] Furthermore, the specific implementation process of extracting image features (h, w) of a single local region image in step S2 includes: inputting the local region image into the backbone network to obtain image features (c, h, w); using a 1*1 convolution kernel to map the c dimension to 1 to obtain image features (1, h, w); and then compressing the c channel to obtain image features (h, w).

[0013] Preferably, the backbone network is a lightweight backbone, which includes three blocks with identical structures. Each block includes two convolutional layers, one pooling layer, two batch normalization layers, and one ReLU layer.

[0014] Backbone networks typically employ commonly used feature extraction networks such as VGG and ResNet. However, VGG and ResNet have a larger number of parameters and layers, resulting in slower training. Furthermore, they perform average pooling in the feature height h direction, which is detrimental to subsequent water level numerical regression. This invention uses a lightweight backbone that can reduce computational load while maintaining accuracy, thereby improving the efficiency of image feature extraction and processing.

[0015] Preferably, the specific implementation method for water level identification of the height h of each sub-part in step S2 includes using a linear mapping layer to map each sub-part feature h along the width w direction to a water level value, specifically represented as y. i =Wh i Then, along the width w direction, there are n features, resulting in y1, y2, ..., y n There are a total of n absolute water level values;

[0016] Among them, y i Let h be the absolute water level value of the i-th feature detection, W be the parameters of a trainable linear mapping layer used to map the feature to a single water level value, and h be the absolute water level value of the i-th feature detection. i This represents the i-th feature along the width w direction.

[0017] Traditional methods for regression calculation of water levels typically rely on the coordinate information of laser scatter points and perform calculations on the entire image. This invention, however, divides the whole into several parts and performs regression calculations on the absolute water level values ​​of individual local image regions. This allows for the determination of the central tendency of the distribution of units within the whole, effectively eliminating interference factors and preventing excessive fluctuations in the calculated data that could affect the accuracy of water level identification. When performing regression calculations on large amounts of data, this invention is simple to implement, fast in processing, and produces clearer and more intuitive model outputs. It offers better flexibility and accuracy in image recognition, exhibits considerable robustness and scalability to outliers, strong resistance to noise interference, and high recognition accuracy, thus significantly improving the accuracy of water level identification.

[0018] Preferably, the specific implementation method for water level identification of the height h of each sub-part in step S2 includes using a linear mapping method to map the feature h of each sub-part along the width w direction to k binary classification sub-tasks, specifically represented as p ij =softmax(W j h i If p ij If the value is greater than 0.5, then the current water level of the current subtask is higher than the corresponding critical water level, and the current subtask is classified as 1. Count the number of subtasks classified as 1 among the k binary subtasks, denoted as s, and obtain the absolute water level value y of the i-th region along the width w direction. i =r min +s*(r max -r min If y = y1, y2, ..., yk, then along the width w direction there are n features, resulting in y1, y2, ..., yk. n There are a total of n absolute water level values;

[0019] The specific implementation method of the k binary classification sub-tasks includes, r max -r min The water level is uniformly divided into k-1 intervals, resulting in k critical water level values ​​r1, r2, ... r. k Each sub-part is configured with k binary classification sub-tasks, each sub-task having a feature dimension of h, and the critical water levels corresponding to the k sub-tasks are r1, r2, ..., r k Each subtask determines whether its current water level is higher than the corresponding critical water level. If the current water level of the current subtask is higher than the corresponding critical water level, the current subtask is classified as 1; if the current water level of the current subtask is lower than the corresponding critical water level, the current subtask is classified as 0. Where r min The lowest water level, r max This represents the maximum water level.

[0020] Where, p ij W represents the probability that the i-th feature along the width w is classified as 1 in the j-th binary sub-task. j Let h be a trainable linear mapping layer, representing mapping features to the j-th binary classification subtask. i This represents the i-th feature along the width w direction.

[0021] Traditional methods for regressing water levels typically rely on the coordinates of laser scatter points and perform calculations on the entire image. This invention divides the whole into several parts and uses a binary classification method to calculate the absolute water level value of individual local image regions. This method can determine the central tendency of the distribution of each unit in the whole, effectively eliminate interference factors, and prevent excessive fluctuations in the calculated data from affecting the accuracy of water level identification. When classifying large amounts of data, this method is simple to implement, fast in processing, and produces clearer and more intuitive model outputs. It offers better flexibility and accuracy in image recognition, exhibits considerable robustness and scalability to outliers, strong resistance to noise interference, and high recognition accuracy, thus greatly improving the accuracy of water level identification.

[0022] As an inventive concept, the present invention also provides a terminal device, comprising:

[0023] One or more processors;

[0024] A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to implement the steps of the method described above.

[0025] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.

[0026] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0027] (1) By acquiring river image data through a camera, the water level can be identified. Without the need to install a water gauge or markers, the water level can be effectively detected. It has the characteristics of non-contact and can adapt to automatic water level monitoring under various conditions, with high versatility.

[0028] (2) Traditional water level image recognition requires adjusting the video reference point, constructing a virtual water level gauge, and then detecting the water level area. This invention extracts a large number of labeled sample image features and trains the semantic segmentation model. In multiple iterations, the semantic segmentation model continuously fits and learns the feature distribution to obtain a water area segmentation model that meets the expected accuracy. After inputting the video image to be detected into the trained semantic segmentation model, when the camera shifts, the machine can still identify the water area in the video image through the learned sample images. There is no need to re-label the video reference point to construct a virtual water level gauge. It can automatically identify the water area in multiple images and realize the function of automatically focusing on the water surface position. It is suitable for scenarios where the camera moves.

[0029] (3) Extract multiple local image regions and calculate the absolute water level value of each local image region. By dividing a whole into several parts for absolute water level value calculation, the central tendency of the distribution of each unit in the whole can be determined, effectively eliminating interference factors and preventing the calculation data from fluctuating too much, which would affect the accuracy of water level identification. It is robust. At the same time, it uses an artificial intelligence algorithm model and adopts numerical regression or binary classification methods to convert the relative water level into the absolute water level. When classifying a large amount of data, this invention is simple to implement, fast to process, more flexible and accurate in image recognition, and has higher recognition accuracy, which can greatly improve the accuracy of water level identification. Attached Figure Description

[0030] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a flowchart of the water level identification method without a water gauge according to an embodiment of the present invention;

[0032] Figure 2 This is a schematic diagram of local region image acquisition according to an embodiment of the present invention;

[0033] Figure 3 This is a network framework diagram of the water level recognition image regression model according to an embodiment of the present invention;

[0034] Figure 4 This is a diagram of a lightweight backbone network framework according to an embodiment of the present invention;

[0035] Figure 5 This is a network framework diagram of the water level recognition image classification model according to an embodiment of the present invention. Detailed Implementation

[0036] Example 1

[0037] like Figure 1 As shown, Embodiment 1 of the present invention provides a method for identifying water levels without a water gauge, comprising the following steps:

[0038] S1: Obtain river images and input them into the trained semantic segmentation model to identify the water-bank boundary line in the image. The training process of the trained semantic segmentation model includes annotating the water area and riverbank background of the training sample river images, and then inputting the annotated training sample images into the semantic segmentation model for training.

[0039] Before step S1, the image can be preprocessed, including cropping the river image and enhancing the color of the cropped image. In Embodiment 1 of this invention, only the areas around the image related to water level changes are retained. Then, the brightness, contrast, saturation, and hue of the image are randomly changed using the ColorJitter function of the transforms module in the PyTorch framework to achieve color enhancement, enabling the subsequent segmentation model to better process the image and achieve better processing results.

[0040] The preprocessed image is input into the trained semantic segmentation model to identify the water area in the image and select the water-shore boundary line as the water level line. The semantic segmentation model used in Embodiment 1 of this invention is PSPNet.

[0041] It should be noted that in Embodiment 1 of the present invention, labelme is used to annotate the water area and background of the training sample river images, and then the annotated training sample images are used to train the segmentation model PSPNet.

[0042] S2: Select the waterfront boundary line as the water level line, and extract m local area images, wherein the local area images include the water level line;

[0043] Based on the segmentation results of the semantic segmentation model, the waterfront boundary line is selected as the water level line, and m local region images are extracted. In this embodiment of the invention, m=3. All extracted local region images include the water level line, and the image size must be consistent with the training samples. The specific value depends on the scene size. In Embodiment 1 of the invention, a 224*224 local region is extracted at positions 5, 10, and 15 pixels below the water level line, as shown in the schematic diagram. Figure 2 .

[0044] S3: Extract image features (h, w) from a single local region image, divide it into n parts along the width w, and obtain the feature dimension h of each sub-part. Perform water level identification on the height h of each sub-part to obtain y1, y2, ..., y n Given a total of n absolute water level values, the absolute water level value of a single local area is obtained as H = [(y1 + y2 + ... + y...]. n )-(y max +y min )] / (n-2), where y max =max(y1, y2, ..., y n ), y min =min(y1, y2, ..., y n ).

[0045] Embodiment 1 of this invention uses an image regression model to identify water levels. The network framework diagram is as follows: Figure 3 As shown. The image regression model uses numerical regression to identify water levels. The specific implementation process includes:

[0046] S31. Input the local region image into the backbone network, extract the image features (c, h, w), and then use a 1*1 convolution kernel to map the c dimension to 1, resulting in a feature size of (1, h, w). Compress the c channel to obtain the image features (h, w). Then, use the AdaptiveAvgPool2d method under the PyTorch framework to divide the width w direction into n parts. In this embodiment of the invention, n=10, and the feature dimension of each sub-part is h. Water level identification is performed on the height h of each sub-part.

[0047] In this embodiment, the lightweight backbone used includes three identical blocks. Each block includes two 3x3 convolutional layers, one pooling layer, two batch normalization layers, and one ReLU layer. In this embodiment, the number of channels in the three blocks are 64, 128, and 256, respectively. A detailed explanation of the network structure is provided in the appendix. Figure 4 .

[0048] In practice, network models such as VGG and ResNet can be used, or the lightweight backbone network model used in Embodiment 1 of this invention can be used.

[0049] S32. Using a linear mapping layer, each subset feature h along the width w is mapped to a water level value, specifically represented as y. i =Wh i Then, along the width w direction, there are 10 features, resulting in y1, y2, ..., y 10 There are 10 water level values ​​in total. The maximum and minimum values ​​are removed, and the average of the remaining values ​​is taken to obtain the final water level identification value H = [(y1+y2+...+y...]]. 10 )-(y max +y min )] / 8, where y max =max(y1, y2, ..., y 10 ), y min =min(y1, y2, ..., y 10 ).

[0050] Among them, y i Let h be the water level value detected by the i-th feature, W be the parameters of a trainable linear mapping layer used to map the feature to a single water level value, and h be the water level value detected by the i-th feature. i This represents the i-th feature along the width w direction.

[0051] It should be noted that in Embodiment 1 of the present invention, the L2 loss function is used to train the image regression network based on the predicted water level value along the width w direction for each subset, specifically expressed as follows: Where m is the number of training samples, y i G represents the predicted water level value in the sample image. i This represents the actual water level value in the sample image.

[0052] S4: Obtain the absolute water level values ​​H1, H2, and H3 identified from the three local area images, and calculate the absolute water level value H′ of the above video image as [(H1+H2+H3)] / 3.

[0053] Example 2

[0054] like Figure 1 As shown, Embodiment 2 of the present invention provides a method for identifying water levels without a water gauge, comprising the following steps:

[0055] Steps S1 and S2 of Embodiment 2 of the present invention are completely consistent with those of Embodiment 2 of the present invention, except for step S3.

[0056] S3': Extract image features (h, w) from a single local region image, divide it into n parts along the width w direction, obtain the feature dimension h of each sub-part, and perform water level identification on the height h of each sub-part to obtain y1, y2, ..., y n Given a total of n absolute water level values, the absolute water level value of a single local area is obtained as H = [(y1 + y2 + ... + y...]. n )-(y max +y min )] / (n-2), where y max =max(y1, y2, ..., y n ), y min =min(y1, y2, ..., y n ).

[0057] Embodiment 2 of this invention uses an image classification model to identify water levels. The network framework diagram is as follows: Figure 5 As shown. The image classification model uses a binary classification method to identify water levels. The specific implementation process includes:

[0058] S31' Input the local region image into the backbone network, extract image features (c, h, w), and then use a 1*1 convolution kernel to map the c dimension to 1, resulting in a feature size of (1, h, w). Compress the c channel to obtain image features (h, w). Then, use the AdaptiveAvgPool2d method under the PyTorch framework to divide the width w direction into n parts. In embodiment 2 of this invention, n=10 is taken, and the feature dimension of each sub-part is h. Water level identification is performed on the height h of each sub-part.

[0059] In this embodiment, the lightweight backbone used includes three identical blocks. Each block includes two convolutional layers with a kernel size of 3*3, one pooling layer, two batch normalization layers, and one ReLU layer. In this embodiment, the number of channels in the three blocks are 64, 128, and 256, respectively. For a detailed explanation of the network structure, please refer to the appendix. Figure 4 .

[0060] In practice, network models such as VGG and ResNet can be used, or the lightweight backbone network model used in Embodiment 2 of this invention can be used.

[0061] S32', Record the lowest water level as r min The maximum water level is denoted as r. max , will r max -r min Divide the water level into k-1 intervals evenly to obtain k critical water level values ​​r1, r2, ..., r k In Embodiment 2 of this invention, k = 10; each sub-part is assigned k binary classification sub-tasks, and the feature dimension of each sub-task is h. Since k = 10, the critical water levels corresponding to the 10 sub-tasks are r1, r2, ..., r 10 Each subtask determines whether the current water level is higher than the corresponding critical water level. If the current water level of the current subtask is higher than the corresponding critical water level, the current subtask is classified as 1. If the current water level of the current subtask is lower than the corresponding critical water level, the current subtask is classified as 0.

[0062] S33' Using a linear mapping method, the feature h of each subset along the width w direction is mapped to 10 binary classification sub-tasks, specifically represented as p ij =softmax(W j h i If p ijIf the value is greater than 0.5, then the current water level of the current subtask is higher than the corresponding critical water level, and the current subtask is classified as 1. Count the number of subtasks classified as 1 out of the 10 binary subtasks, denoted as s, and obtain the absolute water level value y of the i-th region along the width w direction. i =r min +s*(r max -r min If y = 10, then there are 10 features along the width w direction, resulting in y1, y2, ..., y 10 There are 10 absolute water level values. The maximum and minimum values ​​are removed, and the average of the remaining values ​​is taken to obtain the final water level identification value H = [(y1+y2+...+y...]. 10 )-(y max +y min )] / 8, where y max =max(y1, y2, ..., y 10 ), y min =min(y1, y2, ..., y 10 ).

[0063] Where, p ij W represents the probability that the i-th feature along the width w is classified as 1 in the i-th binary sub-task. j Let h be a trainable linear mapping layer, representing mapping features to the j-th binary classification subtask. i Represents the i-th feature along the width w direction, y i This represents the water level identified in the i-th region along the width w direction.

[0064] It should be noted that in Embodiment 2 of this invention, the cross-entropy loss function is used to train each classification sub-network of the image classification model. The loss function of each sub-network is expressed as follows: Where g i p represents the true class of sample image i, with 1 for positive class and 0 for negative class. i This represents the probability that the subnetwork predicts the class as positive.

[0065] S4': Obtain the absolute water level values ​​H1, H2, and H3 identified from the three local area images, and calculate the absolute water level value H′ of the video image as [(H1+H2+H3)] / 3.

[0066] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not limiting. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the scope of protection of the present invention.

[0067] Example 3

[0068] Embodiment 3 of the present invention provides a terminal device corresponding to Embodiment 1 or Embodiment 2 above. The terminal device can be a processing device for a client, such as a mobile phone, a laptop, a tablet computer, a desktop computer, etc., to execute the method of the above embodiments.

[0069] The terminal device of this embodiment 3 includes a memory, a processor, and a computer program stored in the memory; the processor executes the computer program in the memory to implement the steps of the method of embodiment 1 or embodiment 2 described above.

[0070] In some implementations, the memory may be high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.

[0071] In other implementations, the processor can be any type of general-purpose processor, such as a central processing unit (CPU) or a digital signal processor (DSP), and there is no limitation here.

[0072] Example 4

[0073] Embodiment 4 of the present invention provides a computer-readable storage medium corresponding to Embodiment 1 or Embodiment 2 above, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, they implement the steps of the method of Embodiment 1 or Embodiment 2 above.

[0074] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.

[0075] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0076] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0077] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0078] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0079] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for identifying water level without a water gauge, characterized in that, Includes the following steps: S1. Obtain the river image and input it into the trained semantic segmentation model to identify the water-bank boundary line in the image. The training process of the trained semantic segmentation model includes annotating the water area and riverbank background of the training sample river image, and then inputting the annotated training sample image into the semantic segmentation model for training. S2. Select the waterfront boundary line as the water level line, and extract m local area images, wherein the local area images include the water level line; S3. Extract the image features (h, w) of a single local region image, divide it into n parts along the width w direction, and obtain the feature dimension h of each sub-part. Perform water level identification on the height h of each sub-part to obtain y1, y2, ..., y n Given a total of n absolute water level values, the absolute water level value of a single local area is obtained as H = [(y1 + y2 + ... + y...]. n )-(y max +y min )] / (n-2), where y max =max(y1, y2, ..., y n ), y min =min(y1, y2, ..., y n ); S4. Obtain the absolute water level values ​​H1, H2, ..., Hm of m local region images. m There are m absolute water level values ​​in total. Calculate the absolute water level value H′ of the video image as follows: H′ = [(H1 + H2 + ... + H...] m )] / m; The specific implementation method for water level identification of the height h of each sub-part in step S3 includes using a linear mapping method to map the feature h of each sub-part along the width w direction to k binary classification sub-tasks, specifically represented as p ij =softmax(W j h i If p ij If the value is greater than 0.5, then the current water level of the current subtask is higher than the corresponding critical water level, and the current subtask is classified as 1. Count the number of subtasks classified as 1 among the k binary subtasks, denoted as s, and obtain the absolute water level value y of the i-th region along the width w direction. i =r min +s*(r max -r min If y = y1, y2, ..., yk, then along the width w direction there are n features, resulting in y1, y2, ..., yk. n There are a total of n absolute water level values; The specific implementation method of the k binary classification sub-tasks includes, r max -r min Divide the water level into k-1 intervals evenly to obtain k critical water level values ​​r1, r2, ..., r k Each sub-part is configured with k binary classification sub-tasks, each sub-task having a feature dimension of h, and the critical water levels corresponding to the k sub-tasks are r1, r2, ..., r k Each subtask determines whether its current water level is higher than the corresponding critical water level. If the current water level of the current subtask is higher than the corresponding critical water level, the current subtask is classified as 1; if the current water level of the current subtask is lower than the corresponding critical water level, the current subtask is classified as 0. Where r min The lowest water level, r max This represents the maximum water level. Where, p ij W represents the probability that the i-th feature along the width w is classified as 1 in the j-th binary sub-task. j Let h be a trainable linear mapping layer, representing mapping features to the j-th binary classification subtask. i This represents the i-th feature along the width w direction.

2. The method for identifying water level without a water gauge according to claim 1, characterized in that, The specific implementation process of extracting image features (h, w) of a single local region image in step S3 includes: inputting the local region image into the backbone network to obtain image features (c, h, w); then using a 1*1 convolution kernel to map the c dimension to 1 to obtain image features (1, h, w); and compressing the c channel to obtain image features (h, w).

3. The method for identifying water level without a water gauge according to claim 2, characterized in that, The backbone network is a lightweight backbone, which includes three blocks with identical structures. Each block includes two convolutional layers, one pooling layer, two batch normalization layers, and one ReLU layer.

4. A terminal device, characterized in that, include: One or more processors; A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to perform the steps of the water level identification method according to any one of claims 1-3.

5. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the water level identification method without a water gauge as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Video-based waterless ruler water level reading method

    CN111008614A

  • Video water level identification method based on space-time averaging

    CN114359841A

  • Method for identifying water level without scale by using machine vision

    CN115760850A