A step-shaped water gauge water level identification method

By using the YOLOv5 target detection algorithm and pixel reference point fitting parameter calculation, intelligent identification of stepped water level gauges was achieved, solving the problems of large errors and poor environmental adaptability of traditional methods, and improving the accuracy and stability of water level measurement.

CN115294522BActive Publication Date: 2026-03-03QINGHAI ZHONGSHUI DIGITAL INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210898819.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2026-03-03
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

Existing water level measurement methods suffer from problems such as large human error, unstable equipment accuracy, significant impact from environmental factors, and inability to achieve all-weather monitoring. Furthermore, traditional water level identification algorithms cannot adapt to segmented, stepped water gauge environments.

Method used

The YOLOv5 target detection algorithm is used to acquire water level images through a camera and perform target detection. The water level depth is calculated by combining pixel reference points and fitting parameters, thereby achieving intelligent and accurate water level identification.

Benefits of technology

It improves the stability and accuracy of water level identification, can identify segmented stepped water gauges, controls the error within ±2cm, has an identification speed of less than 20ms, and an accuracy rate of over 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115294522B_ABST
    Figure CN115294522B_ABST
Patent Text Reader

Abstract

The application discloses a kind of ladder-shaped water gauge water level identification methods, comprising: building ladder-shaped water gauge environment, and the configuration of water gauge step number and water gauge range;Real-time water gauge image is obtained by camera;And water gauge image is input into the water gauge target detection model trained, obtains water gauge image target area;Water gauge image target area is analyzed, obtains total water gauge number in water gauge image target area, water level line and water gauge pixel information at water level line;Based on the water gauge pixel information at water level line, the fitting parameter between water gauge pixel reference point and corresponding water gauge scale is combined, and the water gauge scale at water level line is calculated;According to water gauge step number, water gauge range, total water gauge number and the water gauge scale at water level line, the actual water level depth in water gauge image is calculated;Through the method, the problem that water level recognition is unstable due to the influence of environment and other factors in traditional water level recognition algorithm can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of machine vision and deep learning technology, and in particular, a method for identifying water levels using a stepped water gauge. Background Technology

[0002] Currently, my country primarily uses two methods for measuring water levels: manual reading from water level gauges and automatic data acquisition using sensors. Manual reading from gauges cannot obtain real-time water level data, requires significant manpower, and is susceptible to human error. Furthermore, commercially available water level sensors generally suffer from short lifespans, inaccurate measurements, and unstable performance. Their complex operating mechanisms and susceptibility to environmental factors also preclude all-weather monitoring. In addition, some monitoring stations using video surveillance for water level observation mostly only utilize real-time playback and replay functions, still requiring manual viewing and recording, which presents limitations.

[0003] Since the beginning of the 21st century, significant breakthroughs have been achieved in artificial intelligence and computer vision technologies, leading to their widespread application in various fields. From facial recognition to intelligent transportation, many applications have matured, improving efficiency in daily life and accelerating the digitalization of industries. However, the application of these technologies in water level monitoring is still in its early research stages.

[0004] Therefore, how to apply machine vision technology to water level measurement, improve measurement accuracy, and realize intelligent water level measurement has become a key research issue. Summary of the Invention

[0005] In view of the above problems, the present invention provides a method for identifying water levels using a stepped water gauge, which at least solves some of the above-mentioned technical problems. The method uses the YOLOv5 target detection algorithm to identify the water gauge and water level line areas in the image, and calculates the water level depth based on the mapping relationship between image pixels and water level. This solves the problem of unstable water level identification caused by environmental and other factors in traditional water level identification algorithms.

[0006] This invention provides a method for identifying water levels using a stepped water gauge, comprising:

[0007] S1. Set up a stepped water gauge environment and configure the water gauge steps and water gauge range;

[0008] S2. Acquire water level images in real time using a camera; and input the water level images into a trained water level target detection model to obtain the target region of the water level image;

[0009] S3. Analyze the target area of ​​the water gauge image to obtain the total number of water gauges, water level lines, and water gauge pixel information at the water level lines in the target area of ​​the water gauge image.

[0010] S4. Based on the water level pixel information at the water level line, and combined with the fitting parameters between the water level pixel reference point and the corresponding water level scale, calculate the water level scale at the water level line.

[0011] S5. Calculate the actual water level depth in the water gauge image based on the water gauge order and range obtained in S1, the total number of water gauges obtained in S3, and the water gauge scale at the water level line obtained in S4.

[0012] Furthermore, in S1, the construction of the stepped water level environment specifically includes:

[0013] Install water level gauges and cameras at predetermined locations along the channel;

[0014] The water gauges are distributed in a segmented, stepped manner;

[0015] The camera is able to capture each of the water gauges completely and clearly.

[0016] Furthermore, in S2, the water level target detection model is trained using the following method:

[0017] A stepped water gauge environment is constructed; based on the stepped water gauge environment, a large number of water gauge image datasets under different lighting conditions and time periods are acquired through cameras; the water gauge image datasets are divided into image training set, image verification set and image test set according to a preset ratio;

[0018] The LabelImg annotation tool was used to annotate different water level regions of each water level indicator image in the image training set, image validation set, and image test set, respectively, to generate corresponding training label files, validation label files, and test label files.

[0019] The image training set, image verification set, training label file and verification label file are imported into the YOLOV5 model for training to obtain the water level target detection model.

[0020] The image test set is loaded into the water level target detection model as input, and the output of the water level target detection model is compared with the verification label file to test the recognition accuracy of the water level target detection model.

[0021] Furthermore, in step S4, multiple points within the water gauge's range are selected as the water gauge pixel reference points in the image.

[0022] Furthermore, in step S4, the method for calculating the fitting parameters between the water level gauge pixel reference point and the corresponding water level gauge scale includes:

[0023] A polynomial fitting algorithm is used to calculate the mapping relationship between the water gauge pixel reference point and the water gauge scale. That is, the water gauge pixel reference point and the corresponding water gauge scale are used as the input and output of the polynomial fitting algorithm, respectively, and the fitting parameters between the water gauge pixel reference point and the corresponding water gauge scale are obtained by calculation.

[0024] Furthermore, S5 specifically includes:

[0025] Based on the water gauge order and water gauge range obtained in S1, and the total number of water gauges obtained in S3, the number of water gauges that were completely submerged is calculated.

[0026] Based on the number of water gauges that are completely submerged, and combined with the water gauge scale at the water level line obtained in S4, the actual water level depth in the water gauge image is calculated.

[0027] Compared with the prior art, the step-shaped water level identification method described in this invention has the following beneficial effects:

[0028] 1. Traditional water level identification algorithms are only applicable to identifying single water gauge environments, while the method described in this invention can be used to identify environments where the water gauge is installed in a segmented, stepped shape due to factors such as installation environment and water gauge range, thus increasing the diversity of recognizable scenarios.

[0029] 2. This invention calculates the water level gauge reading by setting pixel reference points, which can eliminate the problem of water level gauge reading recognition errors caused by interference factors such as floating objects on the water surface, light, dirt on the water level gauge, and obstruction by surrounding objects, thereby improving recognition stability and recognition accuracy.

[0030] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0031] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0032] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0033] Figure 1 This is a schematic diagram of the step-shaped water level identification method provided in an embodiment of the present invention. Detailed Implementation

[0034] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0035] See Figure 1 As shown, this embodiment of the invention provides a method for identifying water levels using a stepped water gauge, specifically including the following steps:

[0036] S1. Set up a stepped water gauge environment and configure the water gauge steps and water gauge range;

[0037] S2. Acquire water level images in real time using a camera; and input the water level images into a trained water level target detection model to obtain the target region of the water level image;

[0038] S3. Analyze the target area of ​​the water gauge image to obtain the total number of water gauges, water level lines, and water gauge pixel information at the water level lines in the target area of ​​the water gauge image.

[0039] S4. Based on the water level pixel information at the water level line, and combined with the fitting parameters between the water level pixel reference point and the corresponding water level scale, calculate the water level scale at the water level line.

[0040] S5. Calculate the actual water level depth in the water gauge image based on the water gauge order and range obtained in S1, the total number of water gauges obtained in S3, and the water gauge scale at the water level line obtained in S4.

[0041] The following sections will provide a detailed explanation of each of the above steps.

[0042] In step S1 above, the construction of a stepped water gauge environment specifically includes: installing a water gauge and a camera at a preset location in the channel; wherein, the water gauge is a water level gauge; the water gauge is distributed in a segmented stepped manner, and in the actual installation process, the number of steps of the water gauge can be set to one step or multiple sections according to the actual situation; the installation position and height of the camera need to ensure that the camera can completely and clearly capture all the water gauges; in this embodiment of the invention, a three-step water gauge is constructed, and the measuring range of each step of the water gauge is 1m.

[0043] In step S2 above, the water level target detection model is trained using the following method:

[0044] A stepped water level gauge environment was constructed. Based on the stepped water level gauge environment, a large number of water level gauge image datasets were acquired through cameras under different lighting conditions and time periods. During the acquisition of water level gauge images, video streams from webcams were obtained through Python code, and one frame was captured every minute to form the water level gauge image dataset. The water level gauge image dataset was divided into an image training set, an image validation set, and an image test set according to a preset ratio (e.g., 7:2:1).

[0045] The LabelImg annotation tool was used to annotate different water level regions of each water level indicator image in the image training set, image validation set, and image test set, generating corresponding training label files, validation label files, and test label files.

[0046] The image training set, image validation set, training label file, and validation label file are imported into the YOLOv5 model for training. After repeated training, the model converges to obtain the water level target detection model. The image test set is loaded into the water level target detection model as input, and the output of the water level target detection model is compared with the validation label file to test the recognition accuracy of the water level target detection model. The YOLOv5 model selected in this embodiment is an improved version of the YOLOv3 model, and its performance, flexibility, and speed are all superior to the YOLOv3 model.

[0047] By inputting the water level gauge image into the trained water level gauge target detection model, the region of interest in the water level gauge image, i.e. the target region of the water level gauge image, can be obtained.

[0048] In step S3 above, the target area of ​​the water gauge image is analyzed. Specifically, the total number of target areas of the water gauge image is the total number of water gauges contained in the image. By comparing the coordinate positions of each target area of ​​the water gauge image in the image, the water gauges and water level lines located on the water surface can be obtained. Based on this analysis, the total number of water gauges, water level lines, and water gauge pixel information at the water level lines in the target area of ​​the water gauge image can be obtained. The total number of water gauges is the number of water gauges that can be directly observed in the target area of ​​the water gauge image.

[0049] In step S4 above, since there is a fixed positional relationship between the camera and the water gauge in the stepped water gauge environment built above, after the positions of the on-site camera and the water gauge are arranged, multiple points within the water gauge range can be selected as water gauge pixel reference points in the image according to preset rules; observe and record the water gauge scale corresponding to each water gauge pixel reference point.

[0050] In real-world environments, due to factors such as camera installation angle, water level gauge tilt, and lens distortion, the relationship between the water level gauge pixel reference point and the water level gauge scale is not a simple linear one. Therefore, in this embodiment of the invention, a polynomial fitting algorithm is used to calculate the mapping relationship between the water level gauge pixel reference point and the water level gauge scale. Specifically, the water level gauge pixel reference point and the corresponding water level gauge scale are used as the input and output of the polynomial fitting algorithm, respectively. The fitting parameters between the water level gauge pixel reference point and the corresponding water level gauge scale are calculated. Finally, based on these fitting parameters and combined with the water level gauge pixel information obtained in step S3 above, the water level gauge scale at the water level line is calculated. The calculation formula is: y = ax³ + bx² + cx + d; where y represents the water level gauge scale, x represents the pixel value, and a, b, c, and d are coefficients.

[0051] In step S5 above, the number of water gauges that are completely submerged is calculated based on the water gauge order and range obtained in S1 and the total number of water gauges obtained in S3. The total range of the number of completely submerged water gauges is added to the water gauge scale at the water level line obtained in step S4 to obtain the actual water level depth in the water gauge image.

[0052] Using the stepped water level identification method provided in this embodiment of the invention, the identification error can be controlled within ±2cm; the identification speed for each image is less than 20ms; and the identification accuracy is higher than 90%. The method provided in this embodiment of the invention can also be used to identify single water level markings that are not stepped. In other scenarios except those of the invention, using this method only requires configuring the relevant parameters.

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

Claims

1. A method for identifying water levels using a stepped water gauge, characterized in that, include: S1. Set up a stepped water gauge environment and configure the water gauge steps and water gauge range; S2. Acquire water level images in real time using a camera; and input the water level images into a trained water level target detection model to obtain the target region of the water level image; S3. Analyze the target area of ​​the water gauge image to obtain the total number of water gauges, water level lines, and water gauge pixel information at the water level lines in the target area of ​​the water gauge image. S4. Based on the water level pixel information at the water level line, and combined with the fitting parameters between the water level pixel reference point and the corresponding water level scale, calculate the water level scale at the water level line. S5. Based on the water gauge order and water gauge range obtained in S1, the total number of water gauges obtained in S3, and the water gauge scale at the water level line obtained in S4, calculate the actual water level depth in the water gauge image. In step S4, multiple points within the water gauge range are selected as the water gauge pixel reference points in the image. S5 specifically includes: Based on the water gauge order and water gauge range obtained in S1, and the total number of water gauges obtained in S3, the number of water gauges that were completely submerged is calculated. Based on the number of water gauges that are completely submerged, and combined with the water gauge scale at the water level line obtained in S4, the actual water level depth in the water gauge image is calculated.

2. The method for identifying water levels using a stepped water gauge as described in claim 1, characterized in that, In S1, the construction of the stepped water level environment specifically includes: Install water level gauges and cameras at predetermined locations along the channel; The water gauges are distributed in a segmented, stepped manner; The camera is able to capture each of the water gauges completely and clearly.

3. The method for identifying water levels using a stepped water gauge as described in claim 1, characterized in that, In S2, the water level target detection model is trained using the following method: A stepped water gauge environment is constructed; based on the stepped water gauge environment, a large number of water gauge image datasets under different lighting conditions and time periods are acquired through cameras; the water gauge image datasets are divided into image training set, image verification set and image test set according to a preset ratio; Different water level regions of each water level indicator image in the image training set, image verification set, and image test set are labeled respectively to generate corresponding training label files, verification label files, and test label files; The image training set, image verification set, training label file and verification label file are imported into the YOLOV5 model for training to obtain the water level target detection model. The image test set is loaded into the water level target detection model as input, and the output of the water level target detection model is compared with the verification label file to test the recognition accuracy of the water level target detection model.

4. The method for identifying water levels using a stepped water gauge as described in claim 3, characterized in that, The LabelImg annotation tool was used to annotate different water level regions of each water level indicator image in the image training set, image validation set, and image test set.

5. The method for identifying water levels using a stepped water gauge as described in claim 1, characterized in that, In step S4, the method for calculating the fitting parameters between the water level gauge pixel reference point and the corresponding water level gauge scale includes: A polynomial fitting algorithm is used to calculate the mapping relationship between the water gauge pixel reference point and the water gauge scale. That is, the water gauge pixel reference point and the corresponding water gauge scale are used as the input and output of the polynomial fitting algorithm, respectively, and the fitting parameters between the water gauge pixel reference point and the corresponding water gauge scale are obtained by calculation.

Citation Information

Patent Citations

  • Water level identification method based on YOLOv3

    CN112215125A