CN113392846A - Water gauge water level monitoring method and system based on deep learning - Google Patents

Water gauge water level monitoring method and system based on deep learning Download PDF

Info

Publication number
CN113392846A
CN113392846A CN202110664815.XA CN202110664815A CN113392846A CN 113392846 A CN113392846 A CN 113392846A CN 202110664815 A CN202110664815 A CN 202110664815A CN 113392846 A CN113392846 A CN 113392846A
Authority
CN
China
Prior art keywords
water gauge
image
gauge image
water
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110664815.XA
Other languages
Chinese (zh)
Inventor
何卓彦
陈洋臣
缪明宝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Guanbida Data Technology Co ltd
Original Assignee
Guangzhou Guanbida Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Guanbida Data Technology Co ltd filed Critical Guangzhou Guanbida Data Technology Co ltd
Priority to CN202110664815.XA priority Critical patent/CN113392846A/en
Publication of CN113392846A publication Critical patent/CN113392846A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a water gauge water level monitoring method and system based on deep learning, wherein the method comprises the following steps: collecting a water gauge image; extracting video frame data of the water gauge image and processing the video frame data by adopting a deep learning model to obtain a first water gauge image; carrying out binarization processing, edge detection and morphological processing on the first water gauge image to obtain a target water gauge image; and measuring and calculating to obtain water level data based on the target water gauge image. According to the method, the water gauge image is obtained through the camera, the water gauge image is processed through a depth learning model based on semantic segmentation, and a target water gauge image converted from an image of an area where the water gauge is located is obtained through color conversion and morphological processing, so that the current water gauge data is measured and calculated according to a historical mapping relation. Because manual intervention interpretation is not needed, various sensors are not needed to be deployed, and only the camera and the logic operation unit with the basic operation function are adopted, the deployment is convenient and fast, and the applicability is wide.

Description

Water gauge water level monitoring method and system based on deep learning
Technical Field
The invention relates to the technical field of deep learning, in particular to a water gauge water level monitoring method and system based on deep learning.
Background
Hydrological observation concerns aspects such as water resource management, environmental safety, water management and the like, wherein water level monitoring is carried out by observing a water gauge, which is the most traditional and widely-applied observation method, but the real-time property of observation is low, and reading is difficult in severe weather. Nowadays, sensor monitoring equipment is generally adopted to automatically acquire analog quantity of water level, wherein a float type water level meter needs to be separately built into a well logging room; the pressure type water level gauge needs frequent maintenance; the ultrasonic water level meter is easy to be interfered to generate the phenomenon of measuring the water level drift. Therefore, the water level monitoring method in the prior art has the problems of high construction/monitoring cost, low monitoring efficiency, inaccurate monitoring data and the like.
Disclosure of Invention
The embodiment of the invention discloses a water gauge water level monitoring method and system based on deep learning. Because manual intervention interpretation is not needed, various sensors are not needed to be deployed, and only the camera and the logic operation unit with the basic operation function are adopted, the deployment is convenient and fast, and the applicability is wide.
The embodiment of the invention discloses a water gauge water level monitoring method based on deep learning in a first aspect, which comprises the following steps:
collecting a water gauge image;
extracting video frame data of the water gauge image;
processing the video frame data by adopting a deep learning model to obtain a first water gauge image;
carrying out binarization processing on the first water gauge image to obtain a second water gauge image;
detecting the edge of the second water gauge image to obtain a third water gauge image;
performing morphological processing on the third water gauge image to obtain a target water gauge image;
and measuring and calculating to obtain water level data based on the target water gauge image.
Preferably, the extracting the video frame data of the water gauge image includes:
intercepting a plurality of frame images in the water gauge image in unit time based on a video frame intercepting function;
performing pixel point analysis on the plurality of frame images by adopting a frame processing function to obtain the trace point data of each frame image;
and averaging a plurality of trace point data in unit time to obtain the video frame data.
Preferably, the processing the video frame data by using the deep learning model to obtain the first water gauge image includes:
training by adopting a deep learning model based on semantic segmentation and matching with a full convolution neural network to obtain a video frame processing model;
analyzing the video frame data by adopting the video frame processing model to obtain the data of the boundary line between the water gauge and the water surface;
and extracting the image of the region above the water surface excluding the water surface region in the video frame data based on the boundary line data to obtain the first water gauge image not including the water surface region.
Preferably, the binarizing the first water gauge image to obtain a second water gauge image includes:
processing the first water gauge image by adopting a BGR2HSV color space conversion general algorithm, and converting the first water gauge image into an HSV color space format, wherein H is hue, S is saturation and V is lightness;
based on a preset color characteristic range, carrying out color partition on the first water gauge image in the HSV color space format by adopting an inRange method to obtain a target area and a background area;
setting the color of the target region to be [255, 255, 255], that is, setting the color of the target region to be white, and setting the color of the background region to be [0, 0, 0], that is, setting the color of the background region to be black, so as to obtain the binarized second water gauge image.
Preferably, the performing morphological processing on the third water gauge image to obtain the target water gauge image includes:
performing expansion processing on the third water gauge image based on the following formula to obtain an expanded image:
Figure BDA0003116410920000031
wherein, X is the image set of the third water gauge image, S is the image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is the abscissa of the pixel point during the expansion processing, and y is the ordinate of the pixel point during the expansion processing;
and carrying out corrosion treatment on the expansion image based on the following formula to obtain a corrosion image:
Figure BDA0003116410920000032
wherein S is the image set of the expansion image, T is the image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is the abscissa of the pixel point during the expansion treatment, and k is the ordinate of the pixel point during the expansion treatment;
and expanding the corrosion image again, and transversely extending the scale mark of the corrosion image to obtain the target water gauge image.
The second aspect of the embodiment of the invention discloses a water gauge water level monitoring system based on deep learning, which comprises:
the acquisition unit is used for acquiring a water gauge image;
the extraction unit is used for extracting video frame data of the water gauge image;
the model processing unit is used for processing the video frame data by adopting a deep learning model to obtain a first water gauge image;
a binarization unit, configured to perform binarization processing on the first water gauge image to obtain a second water gauge image;
the edge detection unit is used for detecting the second water gauge image to obtain a third water gauge image;
the form processing unit is used for performing form processing on the third water gauge image to obtain a target water gauge image;
and the water level measuring and calculating unit is used for measuring and calculating water level data based on the target water gauge image.
Preferably, the extraction unit includes:
the intercepting subunit is used for intercepting a plurality of frame images in the water gauge image in unit time based on a video frame intercepting function;
the trace point analysis subunit is used for carrying out pixel point analysis on the plurality of frame images by adopting a frame processing function to obtain trace point data of each frame image;
and the average subunit is used for averaging the plurality of trace point data in unit time to obtain the video frame data.
Preferably, the model processing unit includes:
the model construction subunit is used for training by adopting a deep learning model based on semantic segmentation and matching with a full convolution neural network to obtain a video frame processing model;
the boundary analysis subunit is used for analyzing the video frame data by adopting the video frame processing model to obtain boundary line data of the water gauge and the water surface;
and the extraction subunit is used for extracting the image of the region above the water surface excluding the water surface region in the video frame data based on the boundary line data to obtain the first water gauge image without the water surface region.
Preferably, the binarization unit includes:
the format conversion subunit is used for processing the first water gauge image by adopting a BGR2HSV color space conversion general algorithm and converting the first water gauge image into an HSV color space format, wherein H is hue, S is saturation and V is lightness;
the partitioning subunit is used for performing color partitioning on the first water gauge image in the HSV color space format by adopting an inRange method based on a preset color characteristic range to obtain a target area and a background area;
and the binarization subunit is used for setting the color of the target region to [255, 255, 255], that is, setting the color of the target region to white, and setting the color of the background region to [0, 0, 0], that is, setting the color of the background region to black, so as to obtain the binarized second water gauge image.
Preferably, the form processing unit includes:
a primary expansion subunit, configured to perform expansion processing on the third water gauge image based on the following formula to obtain an expanded image:
Figure BDA0003116410920000041
wherein, X is the image set of the third water gauge image, S is the image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is the abscissa of the pixel point during the expansion processing, and y is the ordinate of the pixel point during the expansion processing;
and the erosion subunit is used for carrying out erosion processing on the expansion image based on the following formula to obtain an erosion image:
Figure BDA0003116410920000051
wherein S is the image set of the expansion image, T is the image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is the abscissa of the pixel point during the expansion treatment, and k is the ordinate of the pixel point during the expansion treatment;
and the secondary expansion subunit is used for performing expansion treatment on the corrosion image again, and transversely extending the scale mark of the corrosion image to obtain the target water gauge image.
The third aspect of the embodiment of the invention discloses a water gauge water level monitoring system based on deep learning, which comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the deep learning-based water gauge water level monitoring method disclosed by the first aspect of the embodiment of the invention.
A fourth aspect of the embodiments of the present invention discloses a computer-readable storage medium storing a computer program, where the computer program causes a computer to execute the deep learning-based water level monitoring method disclosed in the first aspect of the embodiments of the present invention.
A fifth aspect of embodiments of the present invention discloses a computer program product, which, when run on a computer, causes the computer to perform some or all of the steps of any one of the methods of the first aspect.
A sixth aspect of the present embodiment discloses an application publishing platform, where the application publishing platform is configured to publish a computer program product, where the computer program product is configured to, when running on a computer, cause the computer to perform part or all of the steps of any one of the methods in the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the method comprises the steps of obtaining a water gauge image through a camera, processing the water gauge image by adopting a depth learning model based on semantic segmentation, obtaining a target water gauge image only converted from an image of an area where the water gauge is located through color conversion and morphological processing, and measuring current water gauge data according to a historical mapping relation. Because manual intervention interpretation is not needed, various sensors are not needed to be deployed, and only the camera and the logic operation unit with the basic operation function are adopted, the deployment is convenient and fast, and the applicability is wide.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a deep learning-based water level monitoring method for a water gauge according to an embodiment of the present invention;
fig. 2 is a second water gauge image after binarization processing in a deep learning-based water gauge water level monitoring method disclosed in an embodiment of the present invention;
FIG. 3 is a schematic diagram of an expansion process in a deep learning-based water level monitoring method for a water gauge according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of corrosion treatment in a deep learning-based water level monitoring method of a water gauge according to an embodiment of the present invention;
fig. 5 is a target water gauge image after morphological processing in a deep learning-based water gauge water level monitoring method disclosed in an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a deep learning-based water level monitoring system for a water gauge according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another deep learning-based water level monitoring system for a water gauge according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first", "second", "third", "fourth", and the like in the description and the claims of the present invention are used for distinguishing different objects, and are not used for describing a specific order. The terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the invention discloses a water gauge water level monitoring method and system based on deep learning, wherein a high-precision and high-efficiency water supply pipe network pressure prediction model is constructed through machine learning based on historical pressure data and is used for accurately predicting the pressure conditions of a specific time point and a specific monitoring point, so that a response plan can be prepared in advance to cope with the possible special conditions, stable water supply is ensured, and the pressure prediction requirement on a water supply pipe network system is effectively met.
Example one
Referring to fig. 1, fig. 1 is a schematic flow chart of a water gauge water level monitoring method based on deep learning according to an embodiment of the present invention. As shown in fig. 1, the deep learning-based water gauge water level monitoring method may include the following steps.
101. And collecting a water gauge image.
In the embodiment of the invention, the camera is arranged above the water surface of each water gauge, the camera is aligned with the water gauge and shoots to obtain the whole water gauge image, and the water gauge image is transmitted to the terminal equipment for processing in a wired/wireless mode and the like.
102. And extracting video frame data of the water gauge image.
In the embodiment of the invention, irrelevant interferents may appear in the water gauge image during shooting, and the water gauge image is extracted due to the fact that the external interference is caused to the quality of the water gauge image during transmission.
As an optional implementation manner, intercepting a plurality of frame images in the water gauge image in unit time based on a video frame interception function; analyzing the pixel points of the plurality of frames of images by adopting a frame processing function to obtain the trace point data of each frame of image; and averaging the plurality of trace point data in unit time to obtain video frame data. Specifically, based on an opencv (open Source video library) video frame capture function and an msdn (microsoft development network) frame processing function, each pixel point on a plurality of frame images extracted at the same interval time can be identified, and the gray value and coordinate information of each pixel point are obtained as trace point data; here, assuming that a float exists in the shot water gauge video and floats over the water gauge on the water surface, a plurality of frames of images with the position of the water gauge unchanged and the position of the float changed are obtained through interval extraction, and the gray values of the above frames of images are averaged, so that the color of the float in the video frame data becomes light due to the different positions of the float in each frame of image, and if the number of the frames of images is large enough, abnormal interference such as the float can be completely eliminated theoretically, and accordingly, video frame data with high precision can be obtained.
103. And processing video frame data by adopting a deep learning model to obtain a first water gauge image.
In the embodiment of the invention, only the part of the water gauge on the water surface is needed for interpreting the water gauge data.
As an optional implementation mode, a deep learning model based on semantic segmentation is adopted, and a full convolution neural network is matched for training to obtain a video frame processing model; analyzing video frame data by adopting a video frame processing model to obtain boundary line data of the water gauge and the water surface; and extracting the image of the area above the water surface excluding the water surface area in the video frame data based on the boundary line data to obtain a first water gauge image without the water surface area. Specifically, a deep learning model is constructed based on semantic segmentation, a historical water gauge image and historical water level data are adopted to be matched with a full convolution neural network for training, a video frame output model is obtained, boundary line data of a water gauge and a water surface in video frame data are identified accordingly, a first water gauge image not including a sleep area is extracted, and the first water gauge image only includes the water gauge and a background, so that the water surface and water surface reflection can be effectively eliminated, and image noise is reduced.
104. And carrying out binarization processing on the first water gauge image to obtain a second water gauge image.
In the embodiment of the invention, the water gauge adopts the outer coating with high color identification degree so as to be beneficial to identification and observation, and the binaryzation treatment is carried out on the water gauge according to the identification and observation.
As an optional implementation manner, a BGR2HSV color space conversion general algorithm is adopted to process the first water ruler image, and the first water ruler image is converted into an HSV color space format, where H is hue, S is saturation, and V is lightness; based on a preset color characteristic range, carrying out color partition on a first water gauge image in an HSV color space format by adopting an inRange method to obtain a target area and a background area; setting the color of the target area to be [255, 255, 255], that is, setting the color of the target area to be white, and setting the color of the background area to be [0, 0, 0], that is, setting the color of the background area to be black, to obtain a binarized second water gauge image. Specifically, assuming that the scales and the indices on the water gauge are coated with bright colors X [ a, b, c ] and only the color X in the first water gauge image is within the preset color feature range, the target area is the area where the scales and the indices coated with the colors X [ a, b, c ] are located, the color of the target area is set to be white [255, 255, 255], and further the color of the background area except the target area in the first water gauge image is set to be black [0, 0, 0], so as to obtain the binarized second water gauge image which is clear in outline, clear in color and easy to identify as shown in fig. 2.
105. And detecting the second water gauge image at the edge to obtain a third water gauge image.
In the embodiment of the invention, the edge detection is carried out on the binarized second water gauge image, and the scales and the number indicating contours on the second water gauge image are clear, so that the scales and the number indicating contours can be easily identified and obtained, and the third water gauge image is obtained, therefore, redundant graphs which are useless for identification and monitoring are removed from the scales and the number indicating contours in the second water gauge image, the calculated amount is further reduced, the calculation efficiency is improved, and the invalid redundancy is reduced.
106. And performing morphological processing on the third water gauge image to obtain a target water gauge image.
In the embodiment of the invention, the scales and the readings for manual interpretation are converted into a single-form image which is convenient for machine interpretation.
As an alternative embodiment, as shown in fig. 3, the third water gauge image is subjected to an expansion process based on the following formula to obtain an expanded image:
Figure BDA0003116410920000091
wherein, X is an image set of the third water gauge image, S is an image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is an abscissa of a pixel point during the expansion processing, and y is an ordinate of the pixel point during the expansion processing; the boundary of the graph in the third water gauge image expands outwards, and the cavity and the small particle noise in the target area are expanded and filled, so that the phenomenon of non-uniformity of most color blocks is eliminated;
as shown in fig. 4, the dilated image is then subjected to erosion processing based on the following formula to obtain an eroded image:
Figure BDA0003116410920000092
wherein T is an image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is an abscissa of a pixel point during expansion treatment, and k is an ordinate of the pixel point during expansion treatment; therefore, the color block which is too small in area and has no practical significance and exists in the third water gauge image is eliminated.
And expanding the erosion image again, and transversely extending the scale marks of the erosion image to obtain the target water gauge image shown in fig. 5.
107. And measuring and calculating to obtain water level data based on the target water gauge image.
In the embodiment of the invention, the historical mapping relation between the pixel value and the height of the water gauge is established based on the historical water gauge image and the corresponding historical water level data, namely, the corresponding historical water level data can be judged and read out through the pixel value data of the water gauge region on the historical target water gauge image, so that the corresponding water level data can be measured and calculated based on the target region image converted from the water gauge in the target water gauge image and according to the historical mapping data.
In summary, the water gauge image is obtained through the camera, the depth learning model based on semantic segmentation is adopted to process the water gauge image, and color conversion and morphological processing are performed to obtain the target water gauge image converted from the image of the area where the water gauge is located, so that the current water gauge data is measured according to the historical mapping relationship. The process does not need manual intervention interpretation, does not need to deploy various sensors, and can be realized only by adopting a camera and a logic operation unit with a basic operation function, so that the deployment is convenient and fast, and the applicability is wide.
Example two
Referring to fig. 6, fig. 6 is a schematic structural diagram of a water level monitoring system based on deep learning according to an embodiment of the present invention. As shown in fig. 6, the deep learning based water gauge water level monitoring system may include the following.
The acquisition unit 601 is used for acquiring a water gauge image;
an extracting unit 602, configured to extract video frame data of the water gauge image;
a model processing unit 603, configured to process the video frame data by using a deep learning model to obtain a first water gauge image;
a binarization unit 604, configured to perform binarization processing on the first water gauge image to obtain a second water gauge image;
an edge detection unit 605, configured to perform edge detection on the second water gauge image to obtain a third water gauge image;
a morphology processing unit 606, configured to perform morphology processing on the third water gauge image to obtain a target water gauge image;
and the water level measuring and calculating unit 607 is used for measuring and calculating water level data based on the target water gauge image.
Wherein, the extracting unit 602 includes:
an intercepting subunit 6021, configured to intercept a plurality of frame images in the water gauge image in unit time based on the video frame intercepting function;
a trace point analyzing subunit 6022, configured to perform pixel point analysis on the multiple frames of images by using a frame processing function, so as to obtain trace point data of each frame of image;
the average subunit 6023 is configured to average the plurality of trace point data in the unit time to obtain video frame data.
In addition, the model processing unit 603 includes:
a model construction subunit 6031, configured to perform training by using a deep learning model based on semantic segmentation in cooperation with a full convolution neural network to obtain a video frame processing model;
a boundary analysis subunit 6032, configured to analyze the video frame data using the video frame processing model to obtain data of a boundary between the water gauge and the water surface;
an extraction subunit 6033, configured to extract, based on the boundary line data, an image of a region above the water surface excluding the water surface region in the video frame data, and obtain a first water gauge image that does not include the water surface region.
And, the binarization unit 604 includes:
a format conversion subunit 6041, configured to process the first water ruler image by using a BGR2HSV color space conversion general algorithm, and convert the first water ruler image into an HSV color space format, where H is hue, S is saturation, and V is lightness;
a partitioning subunit 6042, configured to perform color partitioning on the first water gauge image in the HSV color space format by using an inRange method based on a preset color feature range, so as to obtain a target area and a background area;
a binarization sub-unit 6043 for setting the color of the target region to [255, 255, 255], that is, setting the color of the target region to white, and setting the color of the background region to [0, 0, 0], that is, setting the color of the background region to black, to obtain a binarized second water gauge image.
Further, the modality processing unit 606 includes:
a primary expansion subunit 6061, configured to perform expansion processing on the third water gauge image based on the following formula, to obtain an expanded image:
Figure BDA0003116410920000111
wherein, X is an image set of the third water gauge image, S is an image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is an abscissa of a pixel point during the expansion processing, and y is an ordinate of the pixel point during the expansion processing;
an erosion subunit 6062, configured to perform erosion processing on the expanded image based on the following formula, to obtain an erosion image:
Figure BDA0003116410920000112
wherein T is an image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is an abscissa of a pixel point during expansion treatment, and k is an ordinate of the pixel point during expansion treatment;
and a secondary expansion subunit 6063, configured to perform expansion processing on the erosion image again, and extend the scale lines of the erosion image laterally to obtain the target water gauge image.
As an optional implementation manner, the capturing subunit 6021 captures a plurality of frame images in the water gauge image in unit time based on the video frame capturing function; the trace point analysis subunit 6022 performs pixel point analysis on the plurality of frames of images by adopting a frame processing function to obtain trace point data of each frame of image; the average subunit 6023 averages several trace point data in unit time to obtain video frame data. Specifically, based on an opencv (open Source video library) video frame capture function and an msdn (microsoft development network) frame processing function, each pixel point on a plurality of frame images extracted at the same interval time can be identified, and the gray value and coordinate information of each pixel point are obtained as trace point data; here, assuming that a float exists in the shot water gauge video and floats over the water gauge on the water surface, a plurality of frames of images with the position of the water gauge unchanged and the position of the float changed are obtained through interval extraction, and the gray values of the above frames of images are averaged, so that the color of the float in the video frame data becomes light due to the different positions of the float in each frame of image, and if the number of the frames of images is large enough, abnormal interference such as the float can be completely eliminated theoretically, and accordingly, video frame data with high precision can be obtained.
As an optional implementation manner, the model construction subunit 6031 performs training by using a deep learning model based on semantic segmentation in cooperation with a full convolution neural network to obtain a video frame processing model; the boundary analysis subunit 6032 analyzes the video frame data by using the video frame processing model to obtain the boundary data between the water gauge and the water surface; the extraction subunit 6033 extracts, based on the boundary line data, an image of a region above the water surface excluding the water surface region in the video frame data, and obtains a first water gauge image not including the water surface region. Specifically, a deep learning model is constructed based on semantic segmentation, a historical water gauge image and historical water level data are adopted to be matched with a full convolution neural network for training, a video frame output model is obtained, boundary line data of a water gauge and a water surface in video frame data are identified accordingly, a first water gauge image not including a sleep area is extracted, and the first water gauge image only includes the water gauge and a background, so that the water surface and water surface reflection can be effectively eliminated, and image noise is reduced.
As an alternative implementation, the format conversion subunit 6041 processes the first water ruler image by using a BGR2HSV color space conversion general algorithm, and converts the first water ruler image into an HSV color space format, where H is hue, S is saturation, and V is lightness; the partitioning subunit 6042 performs color partitioning on the first water gauge image in the HSV color space format by using an inRange method based on a preset color feature range to obtain a target area and a background area; the binarization sub-unit 6043 sets the color of the target region to [255, 255, 255], that is, the color of the target region to white, and sets the color of the background region to [0, 0, 0], that is, the color of the background region to black, to obtain a binarized second water gauge image. Specifically, assuming that the scales and the indices on the water gauge are coated with bright colors X [ a, b, c ] and only the color X in the first water gauge image is within the preset color feature range, the target area is the area where the scales and the indices coated with the colors X [ a, b, c ] are located, the color of the target area is set to be white [255, 255, 255], and further the color of the background area except the target area in the first water gauge image is set to be black [0, 0, 0], so as to obtain the binarized second water gauge image which is clear in outline, clear in color and easy to identify as shown in fig. 2.
As an alternative embodiment, as shown in fig. 3, the primary expansion subunit 6061 performs expansion processing on the third water gauge image based on the following formula to obtain an expanded image:
Figure BDA0003116410920000131
wherein, X is an image set of the third water gauge image, S is an image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is an abscissa of a pixel point during the expansion processing, and y is an ordinate of the pixel point during the expansion processing; the boundary of the graph in the third water gauge image expands outwards, and the cavity and the small particle noise in the target area are expanded and filled, so that the phenomenon of non-uniformity of most color blocks is eliminated;
as shown in fig. 4, the erosion subunit 6062 performs erosion processing on the expansion image based on the following formula to obtain an erosion image:
Figure BDA0003116410920000132
wherein T is an image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is an abscissa of a pixel point during expansion treatment, and k is an ordinate of the pixel point during expansion treatment; therefore, the color block which is too small in area and has no practical significance and exists in the third water gauge image is eliminated.
The secondary expansion subunit 6063 performs expansion processing on the erosion image again, and extends the scale lines of the erosion image laterally to obtain the target water gauge image shown in fig. 5.
In summary, the water gauge image is obtained through the camera, the depth learning model based on semantic segmentation is adopted to process the water gauge image, and color conversion and morphological processing are performed to obtain the target water gauge image converted from the image of the area where the water gauge is located, so that the current water gauge data is measured according to the historical mapping relationship. Because manual intervention interpretation is not needed, various sensors are not needed to be deployed, and only the camera and the logic operation unit with the basic operation function are adopted, the deployment is convenient and fast, and the applicability is wide.
EXAMPLE III
Referring to fig. 7, fig. 7 is a schematic structural diagram of another deep learning-based water level monitoring system of a water gauge according to an embodiment of the present invention. As shown in fig. 7, the deep learning-based water gauge water level monitoring system may include:
a memory 701 in which executable program code is stored;
a processor 702 coupled to the memory 701;
the processor 702 calls the executable program code stored in the memory 701 to execute the deep learning-based water gauge water level monitoring method of fig. 1.
The embodiment of the invention discloses a computer-readable storage medium which stores a computer program, wherein the computer program enables a computer to execute the deep learning-based water gauge water level monitoring method in the figure 1.
Embodiments of the present invention also disclose a computer program product, wherein, when the computer program product is run on a computer, the computer is caused to execute part or all of the steps of the method as in the above method embodiments.
It will be understood by those skilled in the art that all or part of the steps in the methods of the embodiments described above may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), or other Memory, such as a magnetic disk, or a combination thereof, A tape memory, or any other medium readable by a computer that can be used to carry or store data.
The above detailed description is made on the deep learning-based water gauge water level monitoring method and system disclosed in the embodiments of the present invention, and a specific example is applied in the description to explain the principle and implementation manner of the present invention, and the description of the above embodiments is only used to help understanding the method and core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A water gauge water level monitoring method based on deep learning is characterized by comprising the following steps:
collecting a water gauge image;
extracting video frame data of the water gauge image;
processing the video frame data by adopting a deep learning model to obtain a first water gauge image;
carrying out binarization processing on the first water gauge image to obtain a second water gauge image;
detecting the edge of the second water gauge image to obtain a third water gauge image;
performing morphological processing on the third water gauge image to obtain a target water gauge image;
and measuring and calculating to obtain water level data based on the target water gauge image.
2. The deep learning based water gauge water level monitoring method according to claim 1, wherein the extracting video frame data of the water gauge image comprises:
intercepting a plurality of frame images in the water gauge image in unit time based on a video frame intercepting function;
performing pixel point analysis on the plurality of frame images by adopting a frame processing function to obtain the trace point data of each frame image;
and averaging a plurality of trace point data in unit time to obtain the video frame data.
3. The method for monitoring the water gauge water level based on the deep learning of claim 1, wherein the processing the video frame data by using the deep learning model to obtain the first water gauge image comprises:
training by adopting a deep learning model based on semantic segmentation and matching with a full convolution neural network to obtain a video frame processing model;
analyzing the video frame data by adopting the video frame processing model to obtain the data of the boundary line between the water gauge and the water surface;
and extracting the image of the region above the water surface excluding the water surface region in the video frame data based on the boundary line data to obtain the first water gauge image not including the water surface region.
4. The deep learning-based water gauge water level monitoring method according to claim 1, wherein the binarizing the first water gauge image to obtain a second water gauge image comprises:
processing the first water gauge image by adopting a BGR2HSV color space conversion general algorithm, and converting the first water gauge image into an HSV color space format, wherein H is hue, S is saturation and V is lightness;
based on a preset color characteristic range, carrying out color partition on the first water gauge image in the HSV color space format by adopting an inRange method to obtain a target area and a background area;
setting the color of the target region to be [255, 255, 255], that is, setting the color of the target region to be white, and setting the color of the background region to be [0, 0, 0], that is, setting the color of the background region to be black, so as to obtain the binarized second water gauge image.
5. The deep learning-based water gauge water level monitoring method according to claim 1, wherein the morphological processing of the third water gauge image to obtain a target water gauge image comprises:
performing expansion processing on the third water gauge image based on the following formula to obtain an expanded image:
Figure FDA0003116410910000021
wherein, X is the image set of the third water gauge image, S is the image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is the abscissa of the pixel point during the expansion processing, and y is the ordinate of the pixel point during the expansion processing;
and carrying out corrosion treatment on the expansion image based on the following formula to obtain a corrosion image:
Figure FDA0003116410910000022
wherein T is an image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is an abscissa of a pixel point during expansion treatment, and k is an ordinate of the pixel point during expansion treatment;
and expanding the corrosion image again, and transversely extending the scale mark of the corrosion image to obtain the target water gauge image.
6. A water gauge water level monitoring system based on deep learning, the system comprising:
the acquisition unit is used for acquiring a water gauge image;
the extraction unit is used for extracting video frame data of the water gauge image;
the model processing unit is used for processing the video frame data by adopting a deep learning model to obtain a first water gauge image;
a binarization unit, configured to perform binarization processing on the first water gauge image to obtain a second water gauge image;
the edge detection unit is used for detecting the second water gauge image to obtain a third water gauge image;
the form processing unit is used for performing form processing on the third water gauge image to obtain a target water gauge image;
and the water level measuring and calculating unit is used for measuring and calculating water level data based on the target water gauge image.
7. The deep learning based water gauge water level monitoring system of claim 6, wherein the extraction unit comprises:
the intercepting subunit is used for intercepting a plurality of frame images in the water gauge image in unit time based on a video frame intercepting function;
the trace point analysis subunit is used for carrying out pixel point analysis on the plurality of frame images by adopting a frame processing function to obtain trace point data of each frame image;
and the average subunit is used for averaging the plurality of trace point data in unit time to obtain the video frame data.
8. The deep learning based water gauge water level monitoring system of claim 6, wherein the model processing unit comprises:
the model construction subunit is used for training by adopting a deep learning model based on semantic segmentation and matching with a full convolution neural network to obtain a video frame processing model;
the boundary analysis subunit is used for analyzing the video frame data by adopting the video frame processing model to obtain boundary line data of the water gauge and the water surface;
and the extraction subunit is used for extracting the image of the region above the water surface excluding the water surface region in the video frame data based on the boundary line data to obtain the first water gauge image without the water surface region.
9. The deep learning based water gauge water level monitoring system according to claim 6, wherein the binarization unit comprises:
the format conversion subunit is used for processing the first water gauge image by adopting a BGR2HSV color space conversion general algorithm and converting the first water gauge image into an HSV color space format, wherein H is hue, S is saturation and V is lightness;
the partitioning subunit is used for performing color partitioning on the first water gauge image in the HSV color space format by adopting an inRange method based on a preset color characteristic range to obtain a target area and a background area;
and the binarization subunit is used for setting the color of the target region to [255, 255, 255], that is, setting the color of the target region to white, and setting the color of the background region to [0, 0, 0], that is, setting the color of the background region to black, so as to obtain the binarized second water gauge image.
10. The deep learning based water gauge water level monitoring system of claim 6, wherein the form processing unit comprises:
a primary expansion subunit, configured to perform expansion processing on the third water gauge image based on the following formula to obtain an expanded image:
Figure FDA0003116410910000041
wherein, X is the image set of the third water gauge image, S is the image set of the expanded image after expansion processing, A is a structural element adopted by the expansion processing, X is the abscissa of the pixel point during the expansion processing, and y is the ordinate of the pixel point during the expansion processing;
and the erosion subunit is used for carrying out erosion processing on the expansion image based on the following formula to obtain an erosion image:
Figure FDA0003116410910000042
wherein T is an image set of the corrosion image after corrosion treatment, B is a structural element adopted by the corrosion treatment, j is an abscissa of a pixel point during expansion treatment, and k is an ordinate of the pixel point during expansion treatment;
and the secondary expansion subunit is used for performing expansion treatment on the corrosion image again, and transversely extending the scale mark of the corrosion image to obtain the target water gauge image.
CN202110664815.XA 2021-06-16 2021-06-16 Water gauge water level monitoring method and system based on deep learning Pending CN113392846A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110664815.XA CN113392846A (en) 2021-06-16 2021-06-16 Water gauge water level monitoring method and system based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110664815.XA CN113392846A (en) 2021-06-16 2021-06-16 Water gauge water level monitoring method and system based on deep learning

Publications (1)

Publication Number Publication Date
CN113392846A true CN113392846A (en) 2021-09-14

Family

ID=77621372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110664815.XA Pending CN113392846A (en) 2021-06-16 2021-06-16 Water gauge water level monitoring method and system based on deep learning

Country Status (1)

Country Link
CN (1) CN113392846A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554004A (en) * 2021-09-18 2021-10-26 三一汽车制造有限公司 Detection method and detection system for material overflow of mixer truck, electronic equipment and mixing station
CN114118754A (en) * 2021-11-19 2022-03-01 河南省鹤壁水文水资源勘测局 Hydrology and water resource monitoring method and system based on machine learning
CN115359430A (en) * 2022-10-19 2022-11-18 煤炭科学研究总院有限公司 Water pump protection method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107131925A (en) * 2017-04-28 2017-09-05 南京邮电大学 A kind of water level real-time monitoring method based on image procossing
CN108318101A (en) * 2017-12-26 2018-07-24 北京市水利自动化研究所 Water gauge water level video intelligent monitoring method based on deep learning algorithm and system
CN108764229A (en) * 2018-05-29 2018-11-06 广东技术师范学院 A kind of water gauge automatic distinguishing method for image based on computer vision technique
CN110598712A (en) * 2019-08-28 2019-12-20 万维科研有限公司 Object position identification method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107131925A (en) * 2017-04-28 2017-09-05 南京邮电大学 A kind of water level real-time monitoring method based on image procossing
CN108318101A (en) * 2017-12-26 2018-07-24 北京市水利自动化研究所 Water gauge water level video intelligent monitoring method based on deep learning algorithm and system
CN108764229A (en) * 2018-05-29 2018-11-06 广东技术师范学院 A kind of water gauge automatic distinguishing method for image based on computer vision technique
CN110598712A (en) * 2019-08-28 2019-12-20 万维科研有限公司 Object position identification method and device, computer equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554004A (en) * 2021-09-18 2021-10-26 三一汽车制造有限公司 Detection method and detection system for material overflow of mixer truck, electronic equipment and mixing station
CN113554004B (en) * 2021-09-18 2022-08-05 三一汽车制造有限公司 Detection method and detection system for material overflow of mixer truck, electronic equipment and mixing station
CN114118754A (en) * 2021-11-19 2022-03-01 河南省鹤壁水文水资源勘测局 Hydrology and water resource monitoring method and system based on machine learning
CN115359430A (en) * 2022-10-19 2022-11-18 煤炭科学研究总院有限公司 Water pump protection method and device and electronic equipment
CN115359430B (en) * 2022-10-19 2023-02-28 煤炭科学研究总院有限公司 Water pump protection method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN113392846A (en) Water gauge water level monitoring method and system based on deep learning
CN108759973B (en) Water level measuring method
CN109766886B (en) Water level identification method based on image identification
CN108921165B (en) Water level identification method based on water gauge image
CN112907506B (en) Water gauge color information-based variable-length water gauge water level detection method, device and storage medium
CN110909640A (en) Method and device for determining water level line, storage medium and electronic device
CN107798293A (en) A kind of crack on road detection means
CN109472261A (en) A kind of quantity of stored grains in granary variation automatic monitoring method based on computer vision
CN111723821A (en) Detection and identification method and device for power plant instrument image
CN111220235B (en) Water level monitoring method and device
CN114067095A (en) Water level identification method based on water gauge character detection and identification
CN111325164A (en) Pointer indication number identification method and device and electronic equipment
CN112036409A (en) Reading identification method and device of liquid level meter
CN114627461A (en) Method and system for high-precision identification of water gauge data based on artificial intelligence
CN116071692A (en) Morphological image processing-based water gauge water level identification method and system
CN111724403A (en) Accumulated snow depth monitoring method based on machine vision
CN112991342B (en) Water level line detection method, device and system based on water level gauge image
CN115909151A (en) Method for identifying serial number of motion container under complex working condition
CN114742849A (en) Leveling instrument distance measuring method based on image enhancement
CN114998194A (en) Product defect detection method, system and storage medium
CN108509845B (en) Visual inspection method for transformer substation instrument equipment inspection based on feature fitting
CN110930447A (en) Android-based unattended snow depth measurement method
CN117036313B (en) Computer vision-based infrared intelligent detection method and equipment for power equipment
CN113538350B (en) Method for identifying depth of foundation pit based on multiple cameras
CN111210403B (en) Soil body infiltration line monitoring method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210914