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

By using computer vision algorithms to detect water levels in real time, the problem of traditional water level identification methods being labor-intensive, costly, and susceptible to interference has been solved, achieving efficient and accurate water level monitoring.

CN115100654BActive Publication Date: 2025-10-21JINGYING SHUZHI TECH HLDG CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210710152.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2025-10-21
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

Existing water level identification methods are labor-intensive and financially costly, and are susceptible to interference, making it impossible to accurately and in real time determine water level changes.

Method used

Computer vision algorithms are used to capture images of the reservoir's water level gauge using a camera, and target recognition algorithms are used to extract the relationship between the water level gauge markings and the water surface position, thereby calculating the water level height in real time.

Benefits of technology

It achieves efficient and accurate water level identification, reduces manpower consumption, lowers management complexity, adapts to changes in water bodies, and has a high identification accuracy rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115100654B_ABST
    Figure CN115100654B_ABST
Patent Text Reader

Abstract

The application relates to a water level recognition method and device based on a computer vision algorithm. The scheme provided by the application collects a reservoir water gauge area image through an existing camera, extracts key information features of the water gauge, that is, water gauge scales, through a target recognition algorithm, combines the water gauge scales with the geometric position relationship of the water surface, sets an algorithm for the current water level actual value, and realizes real-time and efficient judgment. Compared with ordinary artificial monitoring, a large amount of manpower is saved, and real-time monitoring is ensured. Moreover, the algorithm only needs to install a camera on site and deploy a server. The management complexity is reduced, the algorithm has certain pertinence in judging water, liquid or irregular and flowable objects, has high recognition accuracy, strong generalization ability and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a water level recognition method and device based on computer vision algorithm. Background Art

[0002] Affected by factors such as climate and environment, the water level of the reservoir is changing at any time, which may cause the water level to exceed the maximum upper limit at a certain moment.

[0003] Currently, water level identification methods are usually more traditional, such as manual observation or detection using sensors. However, this method consumes too much manpower and financial resources, and is often interfered with by various factors, making it impossible to accurately determine the current water level. Since the water level is changing in real time, manual monitoring may also cause the status to deteriorate due to long-term repetitive work, and problems may not be discovered in time. Summary of the Invention

[0004] In order to overcome the problems existing in the related art, the present invention provides a water level recognition method and device based on computer vision algorithm, which can detect the height of the current water level in real time.

[0005] According to a first aspect of an embodiment of the present invention, a water level recognition method based on a computer vision algorithm is provided, comprising:

[0006] Collect images of the reservoir water gauge area;

[0007] Use target recognition algorithm to extract water ruler scale in the image;

[0008] The water level is obtained according to the positional relationship between the water gauge scale and the water surface.

[0009] Furthermore, the method of extracting the water ruler scale in the image by using the target recognition algorithm specifically includes:

[0010] The target recognition algorithm is used to extract the first recognition frame of the water gauge as a whole, the second recognition frame of the main scale of the water gauge, the third recognition frame of the secondary scale of the water gauge and the number;

[0011] extracting the number in the first recognition frame;

[0012] Obtaining a main scale reading of a water gauge according to the number within the second identification frame;

[0013] The sub-scale reading of the water gauge is obtained according to the number in the third identification frame.

[0014] Furthermore, obtaining the water level according to the positional relationship between the water gauge scale and the water surface specifically includes:

[0015] Select the main scale reading with the smallest vertical coordinate as the reference main scale reading m;

[0016] Select the subscale reading with the smallest vertical coordinate as the base subscale reading n;

[0017] If the vertical coordinate of the reference secondary scale reading is less than the reference main scale reading, then the water level height = m-1 + n / 10;

[0018] If the vertical coordinate of the reference secondary scale reading is greater than or equal to the reference main scale reading, the water level height = m + n / 10.

[0019] Furthermore, obtaining the water level according to the positional relationship between the water gauge scale and the water surface specifically includes:

[0020] Extract all contours within the horizontal coordinate range of the first recognition frame, and select the bottom contour as the horizontal plane;

[0021] Obtaining a corrected distance based on a pixel distance between the vertical coordinate of the lower edge of the third identification frame with the smallest vertical coordinate and the vertical coordinate of the horizontal plane, and a ratio of the pixel distance to the actual distance;

[0022] The actual water level is obtained by subtracting the correction distance from the water level.

[0023] According to a second aspect of an embodiment of the present invention, a water level recognition device based on a computer vision algorithm is provided, characterized by comprising:

[0024] Image acquisition module, used to collect images of the reservoir water gauge area;

[0025] The scale extraction module is used to extract the water ruler scale in the image using the target recognition algorithm;

[0026] The water level determination module is used to obtain the water level according to the positional relationship between the water gauge scale and the water surface.

[0027] Furthermore, the scale extraction module specifically includes:

[0028] A target recognition unit is used to extract a first recognition frame of the entire water gauge, a second recognition frame of the main scale of the water gauge, a third recognition frame of the secondary scale of the water gauge and numbers in the image using a target recognition algorithm;

[0029] a digit extraction unit, configured to extract the digit in the first recognition frame;

[0030] a main scale reading extraction unit, configured to obtain a main scale reading of the water gauge according to the number within the second identification frame;

[0031] The sub-scale reading extraction unit is used to obtain the sub-scale reading of the water gauge according to the number in the third identification frame.

[0032] Furthermore, the water level determination module specifically includes:

[0033] a reference main scale reading determination unit, configured to select the main scale reading with the smallest ordinate as the reference main scale reading m;

[0034] a reference subscale reading determination unit, configured to select the subscale reading with the smallest ordinate as the reference subscale reading n;

[0035] a water level height determination unit, configured to determine, if the ordinate of the reference secondary scale reading is less than the reference main scale reading, the water level height = m-1 + n / 10; and

[0036] If the vertical coordinate of the reference secondary scale reading is greater than or equal to the reference main scale reading, the water level height = m + n / 10.

[0037] Furthermore, the water level determination module specifically includes:

[0038] a horizontal plane determining unit, configured to extract all contours within the horizontal coordinate range of the first recognition frame and select the bottommost contour as the horizontal plane;

[0039] a correction distance calculation unit, configured to obtain a correction distance based on a pixel distance between the vertical coordinate of the lower edge of the third identification frame with the smallest vertical coordinate and the vertical coordinate of the horizontal plane, and a ratio of the pixel distance to the actual distance;

[0040] The actual water level calculation unit is used to subtract the correction distance from the water level to obtain the actual water level.

[0041] According to a third aspect of an embodiment of the present invention, a terminal device is provided, including:

[0042] processor; and

[0043] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method described above.

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

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

[0046] Using existing cameras to capture images of the reservoir's water gauge area, an object recognition algorithm extracts key water gauge features, namely the scale. Combining the geometric relationship between the scale and the water surface, an algorithm is developed to identify the actual current water level, enabling real-time and efficient determination. Compared to conventional manual monitoring, this algorithm saves significant manpower and ensures real-time monitoring. Furthermore, the algorithm requires only on-site camera installation and server deployment. This reduces management complexity and offers specific advantages in identifying water, liquids, or irregular, fluid objects, with high recognition accuracy and strong generalization capabilities.

[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.

[0049] Figure 1 is a flow chart illustrating a water level recognition method based on a computer vision algorithm according to an exemplary embodiment of the present invention;

[0050] Figure 2 It is the framework structure of the yolov3 algorithm;

[0051] Figure 3 This is a schematic diagram of using the yolov3 algorithm to identify the water gauge scale;

[0052] Figure 4 is a structural block diagram of a water level recognition device based on a computer vision algorithm according to an exemplary embodiment of the present invention;

[0053] Figure 5 FIG. 1 is a schematic diagram showing the structure of a computing device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0054] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to make the present invention more thorough and complete and to fully convey the scope of the present invention to those skilled in the art.

[0055] The terms used in this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The singular forms "a," "the," and "the" used in this invention and the appended claims are also intended to include 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.

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

[0057] The hardware devices involved in this invention include cameras and GPU servers. The cameras can be selected from existing network cameras on the mine site and are responsible for image acquisition. The GPU server performs algorithm inference and is located in the on-site computer room. The following describes the technical solutions of the embodiments of the present invention in detail with reference to the accompanying drawings.

[0058] Figure 1 The figure is a flow chart showing a water level recognition method based on a computer vision algorithm according to an exemplary embodiment of the present invention.

[0059] See also Figure 1 , the method comprising:

[0060] 110. Collect images of the reservoir water gauge area;

[0061] Specifically, the camera is installed opposite the water gauge and ensures that it can see the limit of the water surface on the water gauge, and can ensure full detection when the water level rises or falls.

[0062] 120. Use target recognition algorithm to extract water ruler scale in image;

[0063] Specifically, the target recognition algorithm can be implemented using an existing algorithm. In this embodiment, taking yolov3 as an example, the framework structure of the algorithm is as follows: Figure 2 As shown in the figure, based on the trained yolov3 model, the target category, quantity, spatial position and size in the video image can be obtained.

[0064] In this embodiment, the water ruler scale in the image can be extracted using the target recognition algorithm, such as Figure 3As shown, the water gauge scale includes a secondary scale on the left and a main scale on the right. In this step, the readings of the secondary scale and the main scale in the water gauge scale need to be extracted respectively.

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

[0066] 1201. Extracting a first recognition frame of the entire water gauge, a second recognition frame of the main scale of the water gauge, a third recognition frame of the secondary scale of the water gauge, and numbers from the image using an object recognition algorithm;

[0067] 1202. Extract the number in the first recognition frame;

[0068] Specifically, according to the coordinate range of the first recognition frame, all numbers whose coordinates are within the range can be obtained. In addition, all information with a confidence level lower than a certain threshold (such as 60%) can be filtered out.

[0069] 1203. Obtain a main scale reading of the water gauge according to the number within the second identification frame;

[0070] Specifically, if the main scale includes more than two digits, the digits within the second identification frame of the water gauge main scale area are arranged in a manner such that the horizontal axis becomes larger, thereby obtaining the reading of the water gauge main scale.

[0071] In addition, to avoid misidentification, the parameters of the upper and lower limits of the water level can be manually set. If the recognized main scale reading is not within the upper and lower limits of the water level, it will be filtered.

[0072] 1204. Obtain the sub-scale reading of the water gauge according to the number within the third identification frame.

[0073] Specifically, the reading of the sub-scale generally has only one digit, so the recognized digit can be directly used as the reading of the water level sub-scale.

[0074] 130. The water level is obtained according to the positional relationship between the water gauge scale and the water surface.

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

[0076] 1301. Select the main scale reading with the smallest ordinate as the reference main scale reading m;

[0077] 1302. Select the subscale reading with the smallest vertical coordinate as the base subscale reading n;

[0078] 1303. If the ordinate of the reference sub-scale reading is less than the reference main scale reading, the water level height = m-1 + n / 10; if the ordinate of the reference sub-scale reading is greater than or equal to the reference main scale reading, the water level height = m + n / 10.

[0079] Specifically, such as Figure 3 As shown, the main scale reading with the smallest vertical coordinate is 22 (21 was not successfully recognized because it was blocked by the water surface), that is, the benchmark main scale reading is 22m, and the sub-scale reading with the smallest vertical coordinate is 1, that is, the benchmark sub-scale reading is 1dm, and the vertical coordinate of 1 is less than 22, so the water level height = 22-1+1 / 10=21.1m.

[0080] In the above solution, when the sub-scale reading with the smallest vertical coordinate is a certain distance away from the water surface, the identified water level may have a certain deviation. To further improve the recognition accuracy, optionally, in this embodiment, step 130 further includes:

[0081] 1304. Extract all contours within the horizontal coordinate range of the first recognition frame, and select the bottom contour as the horizontal plane.

[0082] Specifically, the left and right horizontal coordinates of the first recognition frame are used to intercept the information within the coordinate range of the entire image. The newly obtained image is used to extract all contours using Gaussian blur and Canny algorithm, and contours with a length of less than 6 pixels are filtered out. The bottom contour is selected as the horizontal plane, and the vertical coordinate of the first point is selected as the vertical coordinate of the current horizontal plane.

[0083] 1305. Obtain a corrected distance based on a pixel distance between the vertical coordinate of the lower edge of the third identification frame with the smallest vertical coordinate and the vertical coordinate of the horizontal plane, and a ratio of the pixel distance to the actual distance;

[0084] like Figure 3 As shown, through the above steps, each third identification frame can be identified, and the third identification frame with the smallest vertical coordinate can be determined, and then the pixel distance between the lower edge of the third identification frame and the horizontal plane determined in step 1304 can be obtained.

[0085] The ratio of pixel distance to actual distance can be obtained by image calibration. In a preferred embodiment, two upper and lower points with known actual distances can be manually marked near the water surface as pixel ratio mapping comparison points. Combined with the actual distance between the two points, the actual distance of each pixel can be obtained.

[0086] The specific calculation process is shown in the following formula:

[0087] rate=0.5 / (bottom y -topy )

[0088] last=(index y -cm y )*rate

[0089] Among them, bottom y Indicates the manually set lower point vertical coordinate, top y Indicates the manually set upper point vertical coordinate, rate indicates the pixel ratio, index y Indicates the vertical coordinate of the horizontal plane, cm y Indicates the vertical coordinate of the third identification box at the bottom.

[0090] 1306. Subtract the correction distance from the water level to obtain the actual water level.

[0091] That is, the actual water level weight height =height-last.

[0092] This solution uses existing cameras to capture images of the reservoir's water gauge area. Using object detection algorithms like YOLOv3, it extracts key information features from the water gauge. By combining the geometric relationships between the various scale areas on the gauge, it develops an algorithm tailored to the actual current water level, enabling real-time and efficient determination. Compared to conventional manual monitoring, this approach saves significant manpower and ensures real-time monitoring. Furthermore, the algorithm requires only on-site camera installation and server deployment, reducing management complexity. This solution offers advantages such as high recognition accuracy and generalization capabilities for identifying water, liquids, or irregular, fluid objects.

[0093] Optionally, in this embodiment, the method further includes:

[0094] 140. When the water level continuously exceeds the set height threshold for a preset time, the alarm state is triggered and the video stream recording the current time is saved; when the water level continuously falls below the height threshold for a preset time, the alarm state is lifted.

[0095] Figure 4 4 is a structural block diagram of a water level recognition device based on a computer vision algorithm according to an exemplary embodiment of the present invention.

[0096] See also Figure 4 , the system comprises:

[0097] Image acquisition module, used to collect images of the reservoir water gauge area;

[0098] The scale extraction module is used to extract the water ruler scale in the image using the target recognition algorithm;

[0099] The water level determination module is used to obtain the water level according to the positional relationship between the water gauge scale and the water surface.

[0100] Optionally, in this embodiment, the scale extraction module specifically includes:

[0101] A target recognition unit is used to extract a first recognition frame of the entire water gauge, a second recognition frame of the main scale of the water gauge, a third recognition frame of the secondary scale of the water gauge and numbers in the image using a target recognition algorithm;

[0102] a digit extraction unit, configured to extract the digit in the first recognition frame;

[0103] a main scale reading extraction unit, configured to obtain a main scale reading of the water gauge according to the number within the second identification frame;

[0104] The sub-scale reading extraction unit is used to obtain the sub-scale reading of the water gauge according to the number in the third identification frame.

[0105] Optionally, in this embodiment, the water level determination module specifically includes:

[0106] a reference main scale reading determination unit, configured to select the main scale reading with the smallest ordinate as the reference main scale reading m;

[0107] a reference subscale reading determination unit, configured to select the subscale reading with the smallest ordinate as the reference subscale reading n;

[0108] a water level height determination unit, configured to determine, if the ordinate of the reference secondary scale reading is less than the reference main scale reading, the water level height = m-1 + n / 10; and

[0109] If the vertical coordinate of the reference secondary scale reading is greater than or equal to the reference main scale reading, the water level height = m + n / 10.

[0110] Optionally, in this embodiment, the water level determination module further includes:

[0111] a horizontal plane determining unit, configured to extract all contours within the horizontal coordinate range of the first recognition frame and select the bottommost contour as the horizontal plane;

[0112] a correction distance calculation unit, configured to obtain a correction distance based on a pixel distance between the vertical coordinate of the lower edge of the third identification frame with the smallest vertical coordinate and the vertical coordinate of the horizontal plane, and a ratio of the pixel distance to the actual distance;

[0113] The actual water level calculation unit is used to subtract the correction distance from the water level to obtain the actual water level.

[0114] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.

[0115] Figure 5 FIG. 4 is a schematic structural diagram of a computing device according to an exemplary embodiment of the present invention.

[0116] See also Figure 5 , the computing device 500 includes a memory 510 and a processor 520 .

[0117] The processor 520 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0118] The memory 510 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 520 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. The system memory may store some or all instructions and data required by the processor during operation. In addition, the memory 510 may 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 magnetic disks and / or optical disks may also be used. In some embodiments, the memory 510 may include a readable and / or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0119] The memory 510 stores executable codes. When the executable codes are processed by the processor 520 , the processor 520 may execute part or all of the above-mentioned methods.

[0120] The scheme of the present invention has been described in detail above with reference to the accompanying drawings. In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. Those skilled in the art should also be aware that the actions and modules involved in the description are not necessarily required by the present invention. In addition, it can be understood that the steps in the method of the embodiment of the present invention can be adjusted in order, merged and deleted according to actual needs, and the modules in the device of the embodiment of the present invention can be merged, divided and deleted according to actual needs.

[0121] In addition, the method according to the present invention may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present invention.

[0122] 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) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or computing device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present invention.

[0123] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.

[0124] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems and methods according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0125] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not 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 selected to best explain the principles of the embodiments, their practical applications, or improvements to existing technologies, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A water level recognition method based on computer vision algorithm, characterized in that: include: Collect images of the reservoir water gauge area; Use target recognition algorithm to extract water ruler scale in the image; Obtaining the water level according to the positional relationship between the water gauge scale and the water surface; The method of extracting the water ruler scale in the image by using the target recognition algorithm specifically includes: The target recognition algorithm is used to extract the first recognition frame of the water gauge as a whole, the second recognition frame of the main scale of the water gauge, the third recognition frame of the secondary scale of the water gauge and the number; extracting the number in the first recognition frame; Obtaining a main scale reading of a water gauge according to the number within the second identification frame; Obtaining a sub-scale reading of the water gauge according to the number within the third identification frame; The step of obtaining the water level according to the positional relationship between the water gauge scale and the water surface specifically includes: Select the main scale reading with the smallest vertical coordinate as the reference main scale reading m; Select the subscale reading with the smallest vertical coordinate as the base subscale reading n; If the vertical coordinate of the reference secondary scale reading is less than the reference main scale reading, the water level height = m-1 + n / 10; If the vertical coordinate of the reference secondary scale reading is greater than or equal to the reference main scale reading, then the water level height = m + n / 10; Extract all contours within the horizontal coordinate range of the first recognition frame, and select the bottom contour as the horizontal plane; Obtaining a corrected distance based on a pixel distance between the vertical coordinate of the lower edge of the third identification frame with the smallest vertical coordinate and the vertical coordinate of the horizontal plane, and a ratio of the pixel distance to the actual distance; Subtract the correction distance from the water level to obtain the actual water level; Extracting all contours within the horizontal coordinate range of the first recognition frame and selecting the bottom contour as the horizontal plane specifically includes: Using the left and right horizontal coordinates of the first recognition frame, we intercept the information within the coordinate range of the entire image. We use Gaussian blur and Canny algorithm to extract all contours from the newly obtained image, filter out contours with a length of less than 6 pixels, select the bottom contour as the horizontal plane, and select the vertical coordinate of the first point as the vertical coordinate of the current horizontal plane.

2. A water level recognition device based on computer vision algorithm, characterized in that: include: Image acquisition module, used to collect images of the reservoir water gauge area; The scale extraction module is used to extract the water ruler scale in the image using the target recognition algorithm; A water level determination module, configured to determine the water level based on the positional relationship between the water gauge scale and the water surface; The scale extraction module specifically includes: A target recognition unit is used to extract a first recognition frame of the entire water gauge, a second recognition frame of the main scale of the water gauge, a third recognition frame of the secondary scale of the water gauge and numbers in the image using a target recognition algorithm; a digit extraction unit, configured to extract the digit in the first recognition frame; a main scale reading extraction unit, configured to obtain a main scale reading of the water gauge according to the number within the second identification frame; A sub-scale reading extraction unit is used to obtain the sub-scale reading of the water gauge according to the number in the third identification frame; The water level determination module specifically includes: a reference main scale reading determination unit, configured to select the main scale reading with the smallest ordinate as the reference main scale reading m; a reference subscale reading determination unit, configured to select the subscale reading with the smallest ordinate as the reference subscale reading n; a water level height determination unit, configured to determine the water level height as m-1+n / 10 if the ordinate of the reference secondary scale reading is less than the reference main scale reading; and If the vertical coordinate of the reference secondary scale reading is greater than or equal to the reference main scale reading, then the water level height = m + n / 10; a horizontal plane determining unit, configured to extract all contours within the horizontal coordinate range of the first recognition frame and select the bottommost contour as the horizontal plane; a correction distance calculation unit, configured to obtain a correction distance based on a pixel distance between the vertical coordinate of the lower edge of the third identification frame with the smallest vertical coordinate and the vertical coordinate of the horizontal plane, and a ratio of the pixel distance to the actual distance; an actual water level calculation unit, configured to obtain an actual water level by subtracting the correction distance from the water level; The horizontal plane determination unit is specifically used to use the left and right horizontal coordinates of the first identification frame to intercept the information within the coordinate range of the entire image, use Gaussian blur and Canny algorithm to extract all contours of the newly obtained image, filter contours with contour point length less than 6 pixels, select the bottom contour as the horizontal plane, and select the vertical coordinate of the first point as the vertical coordinate of the current horizontal plane.

3. A terminal device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to perform the method according to claim 1.

4. A non-transitory machine-readable storage medium having executable code stored thereon, characterized in that: When the executable code is executed by a processor of an electronic device, the processor is caused to perform the method according to claim 1 .

Citation Information

Patent Citations

  • Intelligent water gauge reading method and system and equipment

    CN108073905A

  • Water level acquisition method and device based on image recognition and electronic equipment

    CN114543930A

  • Device and method for measuring water level using correlation coefficient analysis

    KR101355466B1