Water level measurement method and system based on image recognition technology
Through the water level measurement method based on image recognition technology, the water ruler and image acquisition equipment are used to solve the problems of low accuracy and large error in harsh environments, and high-precision and automated water level measurement are achieved.
Patent Information
- Application Number
- CN202411519835.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-18
AI Technical Summary
The existing water level measurement methods can easily lead to sensor failure or low measurement accuracy and large errors in harsh environments. In addition, traditional water ruler measurement requires manual reading, which has problems with operational troubles.
The water level measurement method based on image recognition technology is adopted to measure the water level through the water ruler, and the image acquisition equipment is used to remotely collect the water ruler image, and the water level data is obtained through image preprocessing and recognition technology, and dynamic batch data is summarized to form hydrological data.
In harsh environments, the water ruler is not easy to be damaged. The image acquisition equipment can be set away from the water ruler to reduce the risk of damage. Through image recognition technology, it improves the accuracy of water level measurement, reduces errors, and realizes automated and intelligent water level measurement.
Smart Images

Figure CN119478909A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level measurement, and in particular to a water level measurement method and a measurement system based on image recognition technology. Background Art
[0002] In the reservoir regulation project, the pump station generally has a front pool and a back pool. During the water delivery process, the pump station pumps water from the front pool into the back pool, and the water in the back pool is delivered to the front pool of the next pump station. If the water delivery between pump stations is not coordinated, the water level between pump stations will overflow the channel, resulting in a waste of water resources, and even worse, the dam will be overwhelmed and damaged, causing large economic losses or safety accidents. Since the free water level in the channel section is easy to measure, and the water level directly affects the flow, the method of measuring the flow of the pump station is to measure the water level of the front and back pools of the pump station. At present, the most commonly used method for measuring water level is to use a float or immersion water level gauge to obtain water level data. Because the setting environment of the sensor is relatively harsh, it is usually immersed in water or exposed to the sun. For the above sensors, it is easy to affect their hardware structure and electrical components, resulting in low accuracy and large errors of float sensors, and immersion sensors are prone to failure, which is not conducive to the acquisition of water level data. As for the basic water gauge measurement method, manual reading is required every time, and some river water gauges are located in remote areas, so the traditional water gauge method of measuring water level is more troublesome. Summary of the invention
[0003] Based on this, it is necessary to provide a water level measurement method and measurement system based on image recognition technology to address the problems that existing water level measurement methods are susceptible to harsh environments, such as easy sensor failure or low measurement accuracy and large errors.
[0004] A water level measurement method based on image recognition technology uses a water gauge to measure the water level, and remotely collects original images containing the entire length of the water gauge at intervals through an image acquisition device, and then batch processes the collected multiple original images to obtain dynamic batch data; the method for batch processing the original images includes the following steps:
[0005] S1, converting the original image into a variable image P1, wherein the variable image P1 comprises a three-dimensional matrix of x×y×3, wherein x and y are the number of longitudinal pixel points and the number of transverse pixel points of the variable image P1 respectively;
[0006] S2, preprocessing the variable image P1 to obtain a black-and-white binary water gauge contour image P6, wherein the white pixel portion of the water gauge contour image P6 represents the portion of the water gauge located above the horizontal plane; obtaining the upper, lower, left, and right four dividing lines of the white pixel portion of the water gauge contour image P6, and intercepting the corresponding area on the variable image P1 according to the dividing lines to obtain a position image P7 of the portion of the water gauge exposed above the water surface;
[0007] S3, convert the position image P7 into a two-dimensional matrix X0, wherein the RGB value of the pixel point is the value of the G component of the corresponding pixel point in the variable image P1, and then grayscale is obtained to obtain the gray-white image P8; the pixel points with RGB values greater than 120 in the gray-white image P8 are set to white, and the pixel points with RGB values less than 120 are set to black, to obtain the binary water gauge image P9;
[0008] S4, obtaining the number of rows and columns of pixel points in the water gauge image P9; counting the sum of pixel values of each row in the adjacent 10 columns in the area to the right of the vertical center line of the water gauge image P9, and defining a boundary when the sum of pixel values of two adjacent rows differs by 10, and recording it as the number of boundaries a;
[0009] S5. Count the number of boundaries a; when the number of boundaries a is not a multiple of 6, the current water level S is directly obtained through the numbers on the water ruler and the scales on the right; when the number of boundaries a is a multiple of 6, the current water level S is calculated through the numbers on the water ruler and the scales on the left and right; the current water level S obtained from each original image is summarized to form dynamic batch data.
[0010] As a preferred example, the preprocessing includes graying, edge detection, corrosion processing, closing operation processing and critical object removal processing.
[0011] As a preferred example, the critical object removal process includes removing all white objects whose area is less than 2500 in the image after graying, edge detection, corrosion processing and closing operation processing.
[0012] As a preferred example, in the water ruler contour image P6, the number of white pixels in each row is defined as the sum of all pixel values in the row; the number of white pixels in each column is the sum of all pixel values in the column; if row n satisfies that the sum of pixel values in the nth row is greater than 15 but the sum of pixel values in the n-1 row is less than 15, then the nth row with the smallest sum of pixel values in the n-1 row is selected as the upper dividing line; if row n satisfies that the sum of pixel values in the nth row is greater than 15 but the sum of pixel values in the n+1 row is less than 15, then the nth row with the smallest sum of pixel values in the n+1 row is selected as the lower dividing line; if column m satisfies that the sum of pixel values in the mth column is greater than 50 but the sum of pixel values in the m-1 column is less than 50, then the mth column with the smallest sum of pixel values in the m-1 column is selected as the left dividing line; if column m satisfies that the sum of pixel values in the mth column is greater than 50 but the sum of pixel values in the m+1 column is less than 50, then the mth column with the smallest sum of pixel values in the m+1 column is selected as the right dividing line.
[0013] As a preferred example, in S4, 10 symmetrically distributed columns located in the middle of the water gauge image P9 are counted, and the sum of the pixel values of each row in the 10 columns is calculated, and it is defined that when the sum of the pixel values of two adjacent rows differs by 5, it is a boundary, which is recorded as the boundary number c; the boundary number c is multiplied by the graduation value of the scale on the water gauge to obtain the current water level S.
[0014] As a preferred example, when the boundary number a is a multiple of 6, the sum of the pixel values of each row in the 10 adjacent columns in the area to the left of the vertical center line of the water gauge image P9 is counted, and it is defined below the bottom right boundary that when the sum of the pixel values of two adjacent rows differs by 10, it is a boundary and is recorded as the boundary number b; the current water level S is calculated based on the values of the boundary number a and the boundary number b.
[0015] As a preferred example, the columns selected from the right side of the vertical center line of the water gauge image P9 include the columns at 65% of the left side of the water gauge image P9; the columns selected from the left side of the vertical center line of the water gauge image P9 include the columns at 35% of the left side of the water gauge image P9.
[0016] As a preferred example, the data of the current water level S is uploaded to the monitoring system of the pump station via a communication protocol.
[0017] As a preferred example, the image acquisition device includes a river monitoring camera, a drone, or a special camera for taking water level measurements.
[0018] A water level measurement system based on image recognition technology, which uses the water level measurement method as described above, comprises:
[0019] An image acquisition module, which is used to acquire an original image containing the entire length of the water gauge;
[0020] An image preprocessing module, which is used to preprocess the original image;
[0021] A capture module is used to generate a dividing line and capture the area of the water gauge exposed above the water surface in the original image according to the dividing line to form a position image P7, thereby completing the recognition of the water gauge position;
[0022] The water level recognition module is used to calculate the water level value according to the number of boundaries of the scale on the position image P7, and complete the recognition of the water gauge reading.
[0023] The beneficial effects of the present invention are:
[0024] 1. The water gauge used in the present invention is made of metal or non-metallic materials, and it does not have a complex electrical structure, so it can be used in harsh environments and is generally not damaged. As for the image acquisition device used, it is two independent components from the water gauge. The image acquisition device can be far away from the water gauge and set up high, as long as it can clearly capture the water gauge. At the same time, it can be equipped with an appropriate sunshade structure to avoid contact between the image acquisition device and water and exposure to the sun, thereby reducing the possibility of damage.
[0025] 2. The present invention performs video monitoring on the water gauge and obtains water gauge images at regular intervals, and converts the obtained water gauge images into water level data through batch processing, thereby dynamically obtaining hydrological data. The water level data calculated from the image data is not affected by the underwater environment, so the water level data obtained by image recognition technology has high accuracy and small errors.
[0026] 3. The present invention obtains water level data through image recognition technology, and is associated with water conservancy informationization, river monitoring system, low-altitude economy-drone aerial photography and other technologies. It realizes automation and intelligent upgrades based on existing water gauge measurement, thereby realizing remote measurement of water gauge and dynamically obtaining hydrological data. The present invention provides a new way to obtain water level data in addition to obtaining water level data through sensors. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Flow chart of a water level measurement method based on image recognition technology in an embodiment;
[0028] Figure 2 is the variable image P1 mentioned in the embodiment;
[0029] Figure 3 is the two-dimensional matrix P2 mentioned in the embodiment;
[0030] Figure 4 is the processing result P3 mentioned in the embodiment;
[0031] Figure 5 is the corrosion image P4 mentioned in the embodiment;
[0032] Figure 6 The preliminary contour image P5 mentioned in the embodiment;
[0033] Figure 7 The water gauge contour image P6 mentioned in the embodiment;
[0034] Figure 8 is the position image P7 mentioned in the embodiment;
[0035] Fig. 9 The gray-white image P8 mentioned in the embodiment;
[0036] Fig.10 It is the water gauge image P9 mentioned in the embodiment. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "or / and" used herein includes any and all combinations of one or more of the related listed items.
[0039] Please refer to Figure 1 , this embodiment provides a water level measurement method based on image recognition technology, which uses a water gauge to measure the water level. The "E"-shaped scale on the water gauge used is the traditional red color. When in use, it is set at a designated location in a river, lake or other water body. And the original image containing the entire length of the water gauge is remotely collected at intervals through an image acquisition device (the interval time can be set to 1 hour, that is, one original image is collected every hour), and then the multiple original images collected are batch processed, and all the batch processed results are summarized to obtain dynamic batch data. Among them, the method for batch processing of the original images mainly includes two steps: namely, the identification of the water gauge position and the identification of the water gauge reading. The batch processing method specifically includes the following steps:
[0040] S1, based on MATLAB mathematical software to achieve digital image recognition processing. The original image is converted into variable image P1 using imread function, such as Figure 2 As shown. At this time, the variable image P1 is a x×y×3 . x and y are the number of vertical and horizontal pixels of variable image P1 respectively. This three-dimensional matrix requires the size function to return the values of x and y. Due to the mechanism of the size function, the return value y is three times the number of pixel columns. It is necessary to add a sentence y=y / 3 to get the actual number of pixel columns, which also paves the way for creating a two-dimensional matrix of the same size as the variable image P1.
[0041] S2. Preprocess the variable image P1 to obtain a black-and-white binary water gauge contour image P6, wherein the white pixel portion of the water gauge contour image P6 represents the portion of the water gauge located above the horizontal plane; obtain the upper, lower, left, and right four dividing lines of the white pixel portion of the water gauge contour image P6, and intercept the corresponding area on the variable image P1 according to the dividing lines to obtain the position image P7 of the portion of the water gauge exposed above the water surface.
[0042] In this step, the identification of the water gauge position is based on the difference between the water gauge surface color and the background color. If you want to get a grayscale image with a significant difference between the water gauge surface brightness and the background brightness, the grayscale processing of the original image is very important. Therefore, you can use the grayscale processing function built into MATLAB to grayscale the variable image P1 to obtain a two-dimensional matrix P2, such as Figure 3 As shown. Then edge detection is performed on the two-dimensional matrix P2. After setting the threshold to 0.08, a suitable processing result P3 is obtained, as shown Figure 4 The processing result P3 is then corroded, and the structural element se=[1; 1; 1] is selected as the structural operator for corrosion, and the corroded image P4 is obtained, as shown in Figure 5 Then, a square with a side length of 100 is created on the eroded image P4 as a structural operator for closing operation to obtain a preliminary contour image P5, as shown in Figure 6 As shown. At this time, the rough outline of the water ruler can be seen in the preliminary contour image P5, but there is still a small part of the white object outside the water ruler outline. In order to remove these small parts of the white objects, use the bwareaopen function, set to remove all white objects with an area greater than 2500, so as to convert the preliminary contour image P5 into the water ruler contour image P6, as shown Figure 7As shown. After obtaining the water ruler outline image P6, use a loop statement to count the number of white pixels in each row and column. Since the water ruler outline image P6 is a black and white binary image at this time, the number of white pixels in each row is the sum of all pixel values in the row. In order to determine the boundary, it is stipulated that if row n satisfies that the sum of the pixel values of the nth row is greater than 15 but the sum of the pixel values of the n-1 row is less than 15, then the nth row with the smallest sum of the pixel values of the n-1 row is selected as the upper dividing line. If row n satisfies that the sum of the pixel values of the nth row is greater than 15 but the sum of the pixel values of the n+1 row is less than 15, then the nth row with the smallest sum of the pixel values of the n+1 row is selected as the lower dividing line. If column m satisfies that the sum of the pixel values of the mth column is greater than 50 but the sum of the pixel values of the m-1 column is less than 50, then the mth column with the smallest sum of the pixel values of the m-1 column is selected as the left dividing line. If column m satisfies the condition that the sum of pixel values in column m is greater than 50 but the sum of pixel values in column m+1 is less than 50, then the column m with the smallest sum of pixel values in column m+1 is selected as the right boundary line. After obtaining the four boundary lines, the corresponding area is intercepted on the variable image P1 according to the boundary lines to obtain the position image P7 of the part of the water gauge exposed above the water surface, as shown in Figure 8 As shown. So far, the identification and acquisition of the water gauge position has been completed.
[0043] S3. Define the position image P7 as a two-dimensional matrix X0, in which the RGB values of the pixels are the values of the G components of the corresponding pixels in the variable image P1, and obtain the gray-white image P8; set the pixels with RGB values greater than 120 in the gray-white image P8 to white, and set the pixels with RGB values less than 120 to black, and obtain the binarized water gauge image P9.
[0044] In this step, the identification of the water gauge reading begins. In the identification of the water gauge reading, in order to identify the scale on the water gauge, it is necessary to successfully distinguish the red and white colors on the surface of the water gauge. According to the RGB industrial standard, the G and B component values of red are low, while the G and B values of white are high. Therefore, in order to distinguish the color of the scale on the water gauge, the water gauge image P9 is converted into a new two-dimensional matrix X0 based on the MATLAB mathematical software. The RGB value of the pixel point of the two-dimensional matrix X0 takes the value of the G component on the corresponding pixel point in the variable image P1. After the two-dimensional matrix X0 is grayed, a gray-white image P8 is obtained, as shown Fig. 9 Then, the pixels with RGB values greater than 120 in the gray-white image P8 are set to white, and the pixels with RGB values less than 120 are set to black (that is, the white part of the water ruler is still white, but the red part is adjusted to black), and the black-and-white water ruler image P9 is obtained, as shown in FIG. Fig.10 shown.
[0045] S4. Obtain the number of rows and columns of pixel points in the water level image P9; count the sum of the pixel values of each row in the 10 adjacent columns in the area to the right of the vertical center line of the water level image P9, and define a boundary when the sum of the pixel values of two adjacent rows differs by 10, and record it as the number of boundaries a.
[0046] The scale on the surface of the water gauge is represented by 'E'-shaped stripes. Two 'E' shapes make up 10 stripes, making the reading concise and clear. When identifying, just read the number of times the red and white colors of the water gauge above the water level are alternating, and the current water level can be calculated. To this end, in this embodiment, the number of rows and columns of pixel points in the water gauge image P9 is first obtained. Take 10 columns in sequence at 65% of the left side of the water gauge image P9, and count the sum of the pixel values of each row in these 10 columns. Then define the boundary as a time when the sum of the pixel values of two adjacent rows differs by 10, and record it as the number of boundaries a.
[0047] S5. Count the number of boundaries a. When the statistical result a is not a multiple of 6, it means that the water level has submerged part of the right side of 'E' (the difference between the water level and the currently displayed minimum number is less than 5cm), and the current water level S can be directly calculated through the numbers on the water gauge and the scale on the right. However, when the statistical result a is a multiple of 6, it means that the current water level still needs to use the 'E' on the left to calculate the current water level S. Specifically, when the statistical result a is a multiple of 6, take 10 columns at 35% of the left side of the water gauge image P9, and count the sum of the pixel values of each row in these 10 columns. Then define below the bottom right boundary that when the sum of the pixel values of two adjacent rows differs by 10, it is a boundary, which is recorded as the number of boundaries b. The current water level S is calculated based on the values of the boundary times a and the boundary times b, and the data of the current water level S is uploaded to the pump station monitoring system through the standard industrial OPC communication protocol to obtain the water gauge reading in real time.
[0048] In another embodiment, the number of columns used to record the number of boundaries can also be selected in the middle of the water gauge. Specifically, 10 symmetrically distributed columns located in the middle of the water gauge image P9 are counted, and the sum of the pixel values of each row in the 10 columns is calculated, and it is defined that when the sum of the pixel values of two adjacent rows differs by 5, it is a boundary, which is recorded as the number of boundaries c. At this time, the current water level S can be obtained by directly multiplying the number of boundaries c by the graduation value of the scale on the water gauge. The current water level S obtained from each original image is aggregated into dynamic batch data, so as to dynamically obtain hydrological data.
[0049] In some other embodiments, a water level measurement system based on image recognition technology is also proposed, which uses the water level measurement method as described above. The water level measurement system includes:
[0050] An image acquisition module, which is used to acquire an original image containing the entire length of the water gauge;
[0051] An image preprocessing module, which is used to preprocess the original image;
[0052] A capture module is used to generate a dividing line and capture the area of the water gauge exposed above the water surface in the original image according to the dividing line to form a position image P7, thereby completing the recognition of the water gauge position;
[0053] The water level recognition module is used to calculate the water level value according to the number of boundaries of the scale on the position image P7, and complete the recognition of the water gauge reading.
[0054] In some other embodiments, an intelligent pumping station is also proposed, which uses the water level measurement method as described above to measure the water level of a water pool, and then adjusts the water delivery flow of the pumping station according to the measured water level value.
[0055] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0056] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A water level measurement method based on image recognition technology, characterized in that: The water level is measured by a water gauge, and an original image containing the entire length of the water gauge is remotely collected at intervals by an image acquisition device, and then multiple collected original images are batch processed to obtain dynamic batch data; the method for batch processing the original images includes the following steps: S1, converting the original image into a variable image P1, wherein the variable image P1 comprises a three-dimensional matrix of x×y×3, wherein x and y are the number of longitudinal pixel points and the number of transverse pixel points of the variable image P1 respectively; S2, preprocessing the variable image P1 to obtain a black-and-white binary water gauge contour image P6, wherein the white pixel portion of the water gauge contour image P6 represents the portion of the water gauge located above the horizontal plane; obtaining the upper, lower, left, and right four dividing lines of the white pixel portion of the water gauge contour image P6, and intercepting the corresponding area on the variable image P1 according to the dividing lines to obtain a position image P7 of the portion of the water gauge exposed above the water surface; S3, convert the position image P7 into a two-dimensional matrix X0, wherein the RGB value of the pixel point is the value of the G component of the corresponding pixel point in the variable image P1, and then grayscale is obtained to obtain the gray-white image P8; the pixel points with RGB values greater than 120 in the gray-white image P8 are set to white, and the pixel points with RGB values less than 120 are set to black, to obtain the binary water gauge image P9; S4, obtaining the number of rows and columns of pixel points in the water gauge image P9; counting the sum of pixel values of each row in the adjacent 10 columns in the area to the right of the vertical center line of the water gauge image P9, and defining a boundary when the sum of pixel values of two adjacent rows differs by 10, and recording it as the number of boundaries a; S5. Count the number of boundaries a; when the number of boundaries a is not a multiple of 6, the current water level S is directly obtained through the numbers on the water ruler and the scales on the right; when the number of boundaries a is a multiple of 6, the current water level S is calculated through the numbers on the water ruler and the scales on the left and right; the current water level S obtained from each original image is summarized to form dynamic batch data.
2. The water level measurement method based on image recognition technology according to claim 1, characterized in that: The preprocessing includes graying, edge detection, corrosion processing, closing operation processing and critical object removal processing.
3. The water level measurement method based on image recognition technology according to claim 2 is characterized in that: The critical object removal process includes removing all white objects whose areas are less than 2500 in the image after graying, edge detection, corrosion processing and closing operation processing.
4. The water level measurement method based on image recognition technology according to claim 1, characterized in that: In the water ruler contour image P6, the number of white pixels in each row is defined as the sum of all pixel values in the row; the number of white pixels in each column is the sum of all pixel values in the column; if row n satisfies that the sum of pixel values in the nth row is greater than 15 but the sum of pixel values in the n-1th row is less than 15, then the nth row with the smallest sum of pixel values in the n-1th row is selected as the upper dividing line; if row n satisfies that the sum of pixel values in the nth row is greater than 15 but the sum of pixel values in the n+1th row is less than 15, then the nth row with the smallest sum of pixel values in the n+1th row is selected as the lower dividing line; if column m satisfies that the sum of pixel values in the mth column is greater than 50 but the sum of pixel values in the m-1th column is less than 50, then the mth column with the smallest sum of pixel values in the m-1th column is selected as the left dividing line; if column m satisfies that the sum of pixel values in the mth column is greater than 50 but the sum of pixel values in the m+1th column is less than 50, then the mth column with the smallest sum of pixel values in the m+1th column is selected as the right dividing line.
5. The water level measurement method based on image recognition technology according to claim 1, characterized in that: In S4, 10 symmetrically distributed columns located in the middle of the water gauge image P9 are counted, and the sum of the pixel values of each row in the 10 columns is calculated. It is defined that when the sum of the pixel values of two adjacent rows differs by 5, it is a boundary, which is recorded as the boundary number c; the boundary number c is multiplied by the graduation value of the scale on the water gauge to obtain the current water level S.
6. The water level measurement method based on image recognition technology according to claim 1, characterized in that: When the boundary number a is a multiple of 6, the sum of the pixel values of each row in the 10 adjacent columns in the area to the left of the vertical center line of the water gauge image P9 is counted, and it is defined below the bottom right boundary that when the sum of the pixel values of two adjacent rows differs by 10, it is a boundary and is recorded as the boundary number b. The current water level S is calculated based on the values of the boundary number a and the boundary number b.
7. The water level measurement method based on image recognition technology according to claim 6, characterized in that: The columns selected from the right side of the vertical center line of the water gauge image P9 include the columns at 65% of the left side of the water gauge image P9; the columns selected from the left side of the vertical center line of the water gauge image P9 include the columns at 35% of the left side of the water gauge image P9.
8. The water level measurement method based on image recognition technology according to claim 1, characterized in that: The data of the current water level S is uploaded to the monitoring system of the pump station through the communication protocol.
9. The water level measurement method based on image recognition technology according to claim 1, characterized in that: The image acquisition equipment includes a river monitoring camera, a drone or a special camera for taking water level measurements.
10. A water level measurement system based on image recognition technology, characterized in that: It uses the water level measurement method according to any one of claims 1 to 8, and the water level measurement system comprises: An image acquisition module, which is used to acquire an original image containing the entire length of the water gauge; An image preprocessing module, which is used to preprocess the original image; A capture module is used to generate a dividing line and capture the area of the water gauge exposed above the water surface in the original image according to the dividing line to form a position image P7, thereby completing the recognition of the water gauge position; The water level recognition module is used to calculate the water level value according to the number of boundaries of the scale on the position image P7, and complete the recognition of the water gauge reading.