A reservoir water level recognition method and device based on a computer vision algorithm

By using computer vision algorithm instance segmentation technology, the reservoir water level can be detected in real time, solving the problems of high manpower consumption and poor accuracy of traditional detection methods, and achieving efficient and accurate water level monitoring.

CN115112199BActive Publication Date: 2026-03-31JINGYING SHUZHI TECH HLDG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing water level detection methods are labor-intensive and financially costly, and are susceptible to interference. They cannot accurately and in real time determine water level changes, especially when the water surface in a reservoir fluctuates irregularly, leading to untimely monitoring.

Method used

Using computer vision algorithms, images of the reservoir's water level gauge area are captured by a camera. Instance segmentation algorithms are used to extract features of the water surface and water level gauge readings. Combined with geometric relationships, the water level is calculated to achieve real-time detection.

Benefits of technology

It achieves efficient and accurate water level judgment, reduces manpower consumption, and has real-time performance and high generalization ability, with an error of less than 1cm and a delay of less than 1 second.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115112199B_ABST
    Figure CN115112199B_ABST
Patent Text Reader

Abstract

The application relates to a reservoir water level recognition method and device based on a computer vision algorithm. The method comprises the following steps: collecting a picture of a reservoir water gauge area; fitting a characteristic function of a water surface according to a contour of the water surface in the picture; recognizing each reading area of the water gauge and water gauge readings in the reading area in the picture by using instance segmentation; calculating an actual distance between a reading area closest to the water surface and the water surface; and calculating a reservoir water level according to water gauge readings in the reading area closest to the water surface and the actual distance. Compared with a traditional manual detection method, the scheme provided by the application can greatly save manpower, improve accuracy and reduce management difficulty by using an instance segmentation algorithm. The scheme does not need additional auxiliary equipment and does not need to increase costs. The scheme has the advantages of low generalization difficulty, strong ability, strong pertinence, high recognition rate and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, mainly to scenarios involving height detection of reservoirs, water gauges, etc., and to real-time detection of the current water level. Specifically, it relates to a method and device for reservoir water level recognition based on computer vision algorithms. Background Technology

[0002] With the development of artificial intelligence and 5G technologies, artificial intelligence is being used more and more widely in intelligent detection. Affected by environmental and other factors, the water level of reservoirs is constantly changing, which may cause the water level to exceed the maximum limit at a certain moment. In order to prevent this situation, we have invented a method that uses a strength segmentation algorithm to detect the current water level in real time.

[0003] Current methods for identifying water levels are typically traditional, such as manual observation or sensor detection. However, these methods are too resource-intensive and often susceptible to interference from various factors, making accurate judgment of the current water level impossible. Since water levels change in real time, manual monitoring can also become less efficient due to repetitive work over extended periods, failing to detect problems promptly. Because water is a flowing liquid with an irregular shape and frequently generates waves, resulting in an uneven water surface, this invention employs a strength segmentation algorithm for water level detection. This method can detect the actual current water level in real time, triggering an alarm when the water level exceeds a predetermined threshold. Summary of the Invention

[0004] To overcome the problems existing in related technologies, the present invention provides a method and apparatus for reservoir water level identification based on computer vision algorithms.

[0005] According to a first aspect of the present invention, a method for reservoir water level identification based on computer vision algorithms is provided, comprising:

[0006] Capture images of the reservoir's water level gauge area;

[0007] Fit a characteristic function of the water surface based on the outline of the water surface in the image;

[0008] The instance segmentation algorithm is used to identify each reading area of ​​the water gauge in the image and the water gauge reading in that area;

[0009] Calculate the actual distance between the reading area closest to the water surface and the water surface;

[0010] The reservoir water level is calculated based on the water gauge reading in the reading area closest to the water surface and the actual distance.

[0011] According to a second aspect of the present invention, a reservoir water level identification device based on a computer vision algorithm is provided, comprising:

[0012] The image acquisition module is used to acquire images of the reservoir's water level gauge area.

[0013] The water surface fitting module is used to fit the feature function of the water surface based on the contour of the water surface in the image.

[0014] The reading recognition module is used to identify each reading area of ​​the water gauge in the image and the water gauge reading in that area using an instance segmentation algorithm;

[0015] The first calculation module is used to calculate the actual distance between the reading area closest to the water surface and the water surface;

[0016] The second calculation module is used to calculate the reservoir water level based on the water gauge reading in the reading area closest to the water surface and the actual distance.

[0017] According to a third aspect of the present invention, a terminal device is provided, comprising:

[0018] Processor; and

[0019] A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.

[0020] According to a fourth aspect of the present invention, a non-transitory machine-readable storage medium is provided, on which executable code is stored, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.

[0021] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0022] By capturing images of the reservoir's water level gauge area using existing cameras, and extracting key information features of the water surface, water level gauge readings, and reading areas using computer vision algorithms, and combining the geometrical positional relationships of the water surface, reading areas, and water level gauge readings, an algorithm is developed specifically for the current water level to achieve real-time and efficient judgment. Compared to traditional manual monitoring, this method saves significant manpower and ensures real-time monitoring. Furthermore, this algorithm only requires the installation of cameras and the deployment of a server on-site, reducing management complexity. This solution offers advantages such as specificity in judging water, liquids, or irregular, flowing objects, high accuracy, and strong generalization ability.

[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0024] The above and other objects, features and advantages of the present invention will become more apparent from the more detailed description of exemplary embodiments of the invention in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the invention.

[0025] Figure 1 This is a flowchart illustrating a reservoir water level identification method based on a computer vision algorithm according to an exemplary embodiment of the present invention;

[0026] Figure 2 It is the yolact_edge framework;

[0027] Figure 3 This is an example of on-site feature point recognition;

[0028] Figure 4 This is a schematic diagram of the principle framework of the reservoir water level identification model provided in the embodiment of the present invention. Detailed Implementation

[0029] Preferred embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0030] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms “a,” “the,” and “the” used in this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0031] It should be understood that although the terms "first," "second," "third," etc., may be used in this invention to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, features defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0032] The hardware devices involved in this invention include cameras and GPU servers. The cameras can be existing network cameras in the mining farm, which are responsible for image acquisition. The GPU server performs algorithm inference and is located in the machine room above the mine.

[0033] In this invention, the water surface, water level reading, and reading region are first trained using an instance segmentation algorithm. This instance segmentation algorithm can be as follows: Figure 2 The yolact_edge algorithm implementation shown can obtain the water surface, water level readings, category and quantity of reading regions, as well as their spatial location and size, from the trained yolact_edge model in the video. Figure 3 As shown.

[0034] The technical solutions of the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0035] Figure 1 This is a flowchart illustrating a reservoir water level identification method based on a computer vision algorithm according to an exemplary embodiment of the present invention.

[0036] See Figure 1 The method includes:

[0037] 110. Capture images of the reservoir's water level gauge area;

[0038] Specifically, a camera can be installed opposite the water level gauge, ensuring that the water level boundary on the gauge is visible, and that it can detect the entire process of water level rise or fall.

[0039] 120. Fit a characteristic function of the water surface based on the outline of the water surface in the picture;

[0040] Optionally, in this embodiment, step 120 specifically includes:

[0041] 1201. Identify the water surface outline using an edge recognition algorithm;

[0042] 1202. Collect multiple points from the water surface profile, and use linear regression to fit the optimal linear function as the function of the current water surface.

[0043] Specifically, since the captured water surface features are irregular curves, the water surface contour cannot be fitted using a manually set function. Therefore, a linear fitting method is adopted. The coordinates of the uppermost part of the water surface identified by the yoloact_edge algorithm are used as the horizontal line of the water surface. The width of the water surface can be divided into 11 equal parts. The coordinates of each endpoint are used as the x-values ​​for fitting coordinates, and the minimum y-value corresponding to that point is used as the y-value of the fitted coordinates, as shown in the following formula. The twelve points are fitted with the optimal linear function using linear regression as the function of the current water surface.

[0044]

[0045] x1 = (1*d), x2 = (2*d)

[0046] In the formula, width represents the width of the water surface, d represents the length of each part of the water surface width, and x1 and x2 represent the x-coordinates of each point.

[0047] 130. Use instance segmentation to identify each reading area of ​​the water gauge in the image and the water gauge reading in that area;

[0048] Specifically, instance segmentation is used to identify the numbers in the image as the current water level in meters. Since the identified numbers belong to the category between 0 and 9, they need to be recombine. The recombination method is based on the fact that the center coordinate difference of all numbers does not exceed 50 pixels, and the categories are arranged in ascending order according to their x-axis coordinates. A set of actual values ​​is obtained, and all combinations in the image are extracted for subsequent use.

[0049] The reading area can be identified by recognizing the background color of the area. In this embodiment, the reading area is obtained by extracting all the reading background colors in the image using an instance segmentation algorithm. All reading background colors are then bound to the meter value. The binding rule is that the center coordinates of the meter value should be in the middle of the reading background color range.

[0050] Optionally, in this embodiment, step 130 specifically includes:

[0051] 1301. Use instance segmentation algorithms to identify numbers and reading areas in the image;

[0052] 1302. Arrange the numbers whose center coordinate difference does not exceed a set number of pixels according to their x-axis coordinates from smallest to largest to obtain the water level reading;

[0053] 1303. Bind the reading area to the water gauge reading in the middle of the reading area, with the center coordinates as the binding point.

[0054] 140. Calculate the actual distance between the reading area closest to the water surface and the water surface;

[0055] Specifically, in this embodiment, step 140 includes:

[0056] The actual distance is obtained by using the pixel distance between the reading area closest to the water surface and the characteristic function of the water surface, as well as the ratio of the pixel distance in the image to the actual distance.

[0057] Specifically, in this embodiment, the coordinates of the first pixel in the bottom row of the bottommost reading area are used to determine the distance from the point to the line by fitting the water surface feature function. This allows for the calculation of the pixel distance between the reading area closest to the water surface and the feature function of the water surface. Using the actual height of the reading area and the pixel value of the identified reading area height, the ratio of the actual distance to the pixel distance is obtained. This allows for the final calculation of the actual distance between the bottommost reading area and the water surface, as shown in the following formula:

[0058]

[0059] last_cm = last / heignt

[0060] water_height = meter - last_cm

[0061] In the formula, k represents the water surface slope, b represents the water surface intercept, x and y represent the coordinates of the point below the reading background, height represents the height of the reading background, and meter represents the lowest meter value.

[0062] 150. The reservoir water level is calculated based on the water gauge reading in the reading area closest to the water surface and the actual distance.

[0063] Specifically, the reservoir water level is calculated by subtracting the actual distance between the calculated reading area closest to the water surface from the water gauge reading. An alarm can be triggered when the water level exceeds the threshold.

[0064] Figure 4 This is a schematic diagram illustrating the principle framework of the reservoir water level identification model provided in an embodiment of the present invention.

[0065] This invention provides a reservoir water level identification method based on computer vision algorithms. It acquires images of the reservoir's water level gauge area using existing cameras, extracts key information features of the water surface, water level gauge readings, and the reading area using computer vision algorithms, and combines these with the geometrical positional relationships of the water surface, reading area, and water level gauge readings to set an algorithm for the current actual water level value. This achieves real-time and efficient judgment, saving significant manpower compared to traditional manual monitoring and ensuring real-time monitoring. Furthermore, this algorithm only requires the installation of cameras and the deployment of a server on-site, reducing management complexity. This solution is particularly effective in identifying water, liquids, or irregular, flowing objects, offering high accuracy and strong generalization ability. Under suitable environmental conditions, the error is within 1 cm and the delay is within 1 second.

[0066] An exemplary embodiment of the present invention discloses a reservoir water level identification device based on a computer vision algorithm, the device comprising:

[0067] The image acquisition module is used to acquire images of the reservoir's water level gauge area.

[0068] The water surface fitting module is used to fit the feature function of the water surface based on the contour of the water surface in the image.

[0069] The reading recognition module is used to identify each reading area of ​​the water gauge in the image and the water gauge reading in that area using instance segmentation;

[0070] The first calculation module is used to calculate the actual distance between the reading area closest to the water surface and the water surface;

[0071] The second calculation module is used to calculate the reservoir water level based on the water gauge reading in the reading area closest to the water surface and the actual distance.

[0072] Optionally, in this embodiment, the water surface fitting module specifically includes:

[0073] A contour recognition unit is used to identify the contour of the water surface through an edge recognition algorithm;

[0074] The linear fitting unit is used to collect multiple points from the water surface profile and use linear regression to fit the optimal linear function as the function of the current water surface.

[0075] Optionally, in this embodiment, the reading recognition module specifically includes:

[0076] The instance segmentation unit is used to identify numbers and reading areas in the image using an instance segmentation algorithm;

[0077] The arrangement unit is used to arrange numbers whose center coordinate difference does not exceed a set number of pixels according to their x-axis coordinates from smallest to largest, so as to obtain the water level reading;

[0078] The binding unit is used to bind the reading area to the water gauge reading with the center coordinate in the middle of the reading area.

[0079] Optionally, in this embodiment, the first computing module is specifically used for:

[0080] The actual distance is obtained by using the pixel distance between the reading area closest to the water surface and the characteristic function of the water surface, as well as the ratio of the pixel distance in the image to the actual distance.

[0081] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.

[0082] A computing device according to an exemplary embodiment of the present invention includes a memory and a processor.

[0083] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0084] Memory can include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM can store static data or instructions required by the processor or other modules of the computer. Permanent storage devices can be read-write storage devices. Permanent storage devices can be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use high-capacity storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices can be removable storage devices (e.g., floppy disks, optical drives). System memory can be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory can store some or all of the instructions and data required by the processor during operation. Furthermore, memory can include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks can also be used. In some implementations, the memory may include removable storage devices that are readable and / or writable, such as laser discs (CDs), read-only digital versatile optical discs (e.g., DVD-ROMs, dual-layer DVD-ROMs), read-only Blu-ray discs, ultra-high density optical discs, flash memory cards (e.g., SD cards, mini SD cards, Micro-SD cards, etc.), magnetic floppy disks, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.

[0085] The memory stores executable code, which, when processed by the processor, can cause the processor to execute some or all of the methods described above.

[0086] The present invention has been described in detail above with reference to the accompanying drawings. In the above embodiments, the descriptions of each embodiment have their own emphasis; for parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Those skilled in the art should also understand that the actions and modules involved in the specification are not necessarily essential to the present invention. Furthermore, it is understood that the steps in the method of the embodiments of the present invention can be adjusted, combined, and deleted according to actual needs, and the modules in the device of the embodiments of the present invention can be combined, divided, and deleted according to actual needs.

[0087] Furthermore, the method according to the present invention can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the above-described method of the present invention.

[0088] Alternatively, the present invention can also be implemented as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) storing executable code (or computer program, or computer instruction code) that, when executed by a processor of an electronic device (or computing device, server, etc.), causes the processor to perform some or all of the steps of the method described above according to the present invention.

[0089] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both.

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0091] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A reservoir water level recognition method based on a computer vision algorithm, characterized by, The method comprises: collecting a picture of a water level gauge area of a reservoir; fitting a characteristic function of a water surface according to a contour of the water surface in the picture; identifying each colored reading area of the water level gauge and the water level gauge reading in the reading area in the picture by using an instance segmentation algorithm; calculating an actual distance of a reading area closest to the water surface from the water surface; calculating a water level of the reservoir according to the water level gauge reading in the reading area closest to the water surface and the actual distance. The identification of each colored reading area of the water level gauge and the water level gauge reading in the reading area in the picture by using the instance segmentation algorithm specifically comprises: identifying numbers and reading areas in the picture by using the instance segmentation algorithm; arranging the numbers with a center coordinate difference of no more than a set pixel in ascending order of x-axis coordinates to obtain the water level gauge reading; binding the reading area and the water level gauge reading with a center coordinate in the middle of the reading area; The calculation of the actual distance of the reading area closest to the water surface from the water surface specifically comprises: obtaining the actual distance according to a pixel distance of the reading area closest to the water surface from the characteristic function of the water surface and a ratio of a pixel distance to an actual distance in the picture.

2. The method of claim 1, wherein, The fitting of the characteristic function of the water surface according to the contour of the water surface in the picture specifically comprises: identifying the contour of the water surface by using an edge recognition algorithm; collecting a plurality of points from the contour of the water surface and fitting an optimal linear function as a function of the current water surface by using linear regression.

3. A reservoir water level recognition device based on computer vision algorithm, characterized in that, The method comprises: a picture collecting module configured to collect a picture of a water level gauge area of a reservoir; a water surface fitting module configured to fit a characteristic function of a water surface according to a contour of the water surface in the picture; a reading identifying module configured to identify each colored reading area of the water level gauge and the water level gauge reading in the reading area in the picture by using an instance segmentation algorithm; a first calculating module configured to calculate an actual distance of a reading area closest to the water surface from the water surface; a second calculating module configured to calculate a water level of the reservoir according to the water level gauge reading in the reading area closest to the water surface and the actual distance. The reading identifying module specifically comprises: an instance segmentation unit configured to identify numbers and reading areas in the picture by using the instance segmentation algorithm; an arranging unit configured to arrange the numbers with a center coordinate difference of no more than a set pixel in ascending order of x-axis coordinates to obtain the water level gauge reading; a binding unit configured to bind the reading area and the water level gauge reading with a center coordinate in the middle of the reading area. The first calculating module is specifically configured to: obtain the actual distance according to a pixel distance of the reading area closest to the water surface from the characteristic function of the water surface and a ratio of a pixel distance to an actual distance in the picture.

4. The apparatus of claim 3, wherein, The water surface fitting module specifically comprises: a contour identifying unit configured to identify the contour of the water surface by using an edge recognition algorithm; a linear fitting unit configured to collect a plurality of points from the contour of the water surface and fit an optimal linear function as a function of the current water surface by using linear regression.

5. A terminal device, characterized by, The method comprises: a processor; and a memory having stored executable codes thereon, which, when executed by the processor, causes the processor to perform the method according to claim 1 or 2. ​ 6. A non-transitory machine-readable storage medium having stored thereon executable code to: When the executable code is executed by a processor of an electronic device, the processor is caused to perform the method of claim 1 or 2.

Citation Information

Patent Citations

  • Ship water gauge image automatic number reading method based on deep learning algorithm

    CN108549894A

  • Ship water gauge positioning method

    CN112487985A