CN115760850B - Method for recognizing water level without scale by utilizing machine vision - Google Patents

Method for recognizing water level without scale by utilizing machine vision Download PDF

Info

Publication number
CN115760850B
CN115760850B CN202310010209.5A CN202310010209A CN115760850B CN 115760850 B CN115760850 B CN 115760850B CN 202310010209 A CN202310010209 A CN 202310010209A CN 115760850 B CN115760850 B CN 115760850B
Authority
CN
China
Prior art keywords
water level
image
river surface
water body
frame
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.)
Active
Application number
CN202310010209.5A
Other languages
Chinese (zh)
Other versions
CN115760850A (en
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.)
Changjiang Institute of Survey Planning Design and Research Co Ltd
Original Assignee
Changjiang Institute of Survey Planning Design and Research 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 Changjiang Institute of Survey Planning Design and Research Co Ltd filed Critical Changjiang Institute of Survey Planning Design and Research Co Ltd
Priority to CN202310010209.5A priority Critical patent/CN115760850B/en
Publication of CN115760850A publication Critical patent/CN115760850A/en
Application granted granted Critical
Publication of CN115760850B publication Critical patent/CN115760850B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/30Assessment of water resources

Landscapes

  • Image Processing (AREA)

Abstract

The invention provides a method for recognizing water level without a scale by utilizing machine vision, which comprises the following steps: acquiring a video image of a river surface water body and a shore base to be detected; a calibration object is arranged on the shore base; filtering a video frame of a video image; graying each frame of image in the filtered video image, and extracting an edge image of river surface water body in each frame of image based on a Sobel operator; dividing an edge image in any frame of image into a plurality of sections of images; and respectively detecting the water level line height of each section of image based on the Haar-like features, and calculating the total water level height of the river surface water body at the corresponding moment of each frame of image based on the water level line height of each section of image. The invention can realize real-time dynamic and multi-domain multi-point recognition and water level measurement under various scenes, provides an accurate and effective solution for the real-time acquisition, long-term monitoring and timely early warning of the water level under extreme conditions such as storm, flood and the like, and has very remarkable social and economic benefits.

Description

Method for recognizing water level without scale by utilizing machine vision
Technical Field
The invention belongs to the technical field of water conservancy and hydropower and artificial intelligence, and particularly relates to a method for recognizing water level without a scale by utilizing machine vision.
Background
In water areas and watercourses related to hydraulic and hydroelectric engineering or engineering, various demands for measuring and reading water levels exist, including upstream dam front water level and downstream tail water level of a hydropower station, water levels of different sections of natural rivers, water level monitoring of reservoirs, main channels and canal, and the like. The water level is measured by a water level meter or a water scale manual and machine vision reading mode. The above modes all need to be provided with a fixed water level gauge (direct measurement) or a scale (indirect measurement of a machine vision recognition scale mark). The water level gauge or the staff gauge cannot change the position of the measuring point after being arranged due to the limitation of the setting of the fixed point, and the fixed measuring device (the water level gauge or the staff gauge) in water is extremely easy to be interfered by external foreign matters such as floaters, waterweeds, sundries and the like, so that the water level reading or recognition error is larger, and even the situation that the water level is not recognized can be avoided.
Disclosure of Invention
The invention aims to solve the defects of the background technology, and provides a method for recognizing water level without a scale by utilizing machine vision, which can realize real-time dynamic multi-domain multi-point recognition and water level measurement in various scenes, provides an accurate and effective solution for real-time acquisition, long-term monitoring and timely early warning of water level under extreme conditions such as storm, flood and the like, and has very remarkable social and economic benefits.
The technical scheme adopted by the invention is as follows: a method for recognizing water level without scale using machine vision, comprising the steps of:
acquiring a video image of a river surface water body and a shore base to be detected; a calibration object is arranged on the shore base;
filtering a video frame of a video image;
graying each frame of image in the filtered video image, and extracting an edge image of river surface water body in each frame of image based on a Sobel operator;
dividing an edge image in any frame of image into a plurality of sections of images; and respectively detecting the water level line height of each section of image based on the Haar-like features, and calculating the total water level height of the river surface water body at the corresponding moment of each frame of image based on the water level line height of each section of image.
In the technical scheme, the W-LSTM prediction model is adopted to predict the water level height of the water surface in the future based on the total water level height of the water body of the river surface at different moments.
In the above technical scheme, the method further comprises the following steps: calculating the total height of the water level of the river surface water body at the corresponding moment of each frame of image in real time, and comparing the total height with a set threshold value; and selecting whether to send out an early warning signal based on the comparison result.
In the above technical scheme, the process of predicting the water level height of the water surface in the future by adopting the W-LSTM prediction model based on the total water level height of the water body of the river surface at different moments comprises the following steps:
according to the water level difference of the water level of the river surface water body to be measured on two or more time sequences and corresponding change rates, outputting the change trend of the water level by a prediction method combining wavelet analysis and a long-short-period memory network, and sending out an early warning signal.
In the above technical solution, the process of filtering the video frame of the video image includes: and performing motion compensation on video frames of the video images by adopting a linear Kalman filter, and performing time update and measurement update on the acquired river water body and shore-based images based on Kalman filtering to obtain stable frame position signals, thereby realizing filtering processing.
In the above technical solution, the process of graying each frame of image includes: and carrying out graying treatment on the water body and the shore-based image of the river surface after each frame is smoothed, and taking the sum of absolute values of horizontal and vertical gray values of each pixel point as a new gray value of the pixel point.
In the above technical scheme, the process of extracting the river surface water body edge image corresponding to each frame of image based on the Sobel operator comprises the following steps: performing weighted average and differential operation on the position influence of the pixels by adopting Sobel operators in the horizontal direction and the vertical direction; taking the maximum value of Sobel operator convolution in the horizontal direction and the vertical direction for each pixel point on the river surface water body and the shore-based image after any frame graying treatment based on the calculation result as the output value of the pixel point, and respectively obtaining the horizontal and longitudinal brightness difference approximate values; and obtaining the gradient size and the gradient direction of the edge image based on the transverse and longitudinal brightness difference approximate values, and converting the gradient size and the gradient direction into a water level line edge image corresponding to the river surface water body and the shore base image of the frame.
In the above technical solution, the process of dividing the edge image into a plurality of segments of images includes: dividing the water line edge image into a plurality of sections of images by adopting different distances, and carrying out distance division according to the water line change rate in the edge image by taking the position of the water line on the left bank of the bank base as an origin and the position of the water line on the right bank of the bank base as a center to obtain an abscissa set of division points.
In the above technical scheme, the process of respectively detecting the water level line height of each section of image based on the Haar-like features and further calculating the total water level height of the river surface water body at the corresponding moment of each frame of image comprises the following steps: summarizing the irregular trapezoid area of the water level line edge image corresponding to the river surface water body representation and the shore-based image in each section of image into a rectangular area; dividing rectangular areas of the river surface water body and the shore-based water line edge image into a characteristic area and a non-characteristic area according to the number of black characteristic points, wherein the black characteristic points of the characteristic area are dense, and the black characteristic points of the non-characteristic area are opposite; respectively calculating the centers of the characteristic region and the non-characteristic region, and then sliding a Haar characteristic target between the two centers to calculate characteristic values of the characteristic region and the non-characteristic region, wherein the position with the maximum characteristic value is the position of a water level line of the river surface water body corresponding to the section of image; the ordinate of the water level line of the river surface water body corresponding to each dividing point is obtained again, and the ordinate of the average water level line is obtained through calculation based on the abscissa of each image dividing point and the ordinate of the water level line of the river surface water body corresponding to the dividing point; and calculating to obtain the water level height according to the ordinate of the obtained average water level line and the ordinate of the calibration object on the shore base.
In the technical scheme, components of specific characteristic differences in data of the overall height of the water level of the river surface water body along with the time change are separated based on wavelet analysis to obtain a stable sequence and a non-stable sequence on different scales; training an LSTM network by adopting historical data of the total height of the water level of the river surface, and adopting a stable sequence and an unstable sequence obtained by decomposition as characteristic analysis results of the historical data to guide the training process of the LSTM network; and inputting the historical data of the total water level height of the river surface water body containing the current moment data into a training completion LSTM network to obtain the predicted total water level height of the river surface water body in the future.
The beneficial effects of the invention are as follows: the invention provides a method for directly reading water level by a machine vision recognition algorithm according to a smooth curve outline of water surface continuity without a fixed scale. Under the method, the water level value of the corresponding observation point can be obtained by combining the ground characteristic identification through the recognition of the water surface edge image and the machine vision deep learning under the condition of not making a water scale through the machine vision algorithm, and the water level value can be dynamically displayed in real time, and the video angle or the picture can be freely moved and switched within the range of the marked point (an elevation reference system). According to the machine vision recognition method, the staff is not required to be arranged in water, so that interference of blocked, floaters or foreign matters on water level recognition of the staff can be avoided. In particular, the shore-based fixed mark point can adopt luminous marks, and the water level can be dynamically identified for 24 hours in all weather under the condition of no special illumination.
According to the method, continuous and smooth edge characteristics of the liquid surface on a shoreline are identified through machine vision, a liquid level profile smooth curve is obtained, continuous and smooth edge profile lines are identified with high precision through algorithms such as machine vision image denoising and edge identification, and a liquid level value is obtained by combining calibrated (elevation) geodetic characteristic identifiers. Furthermore, a historical database can be formed based on the output medium-long term water level values, effective information contained in mass data is mined by adopting a prediction method combining wavelet analysis and long-short term memory (LSTM) network, and the water level is dynamically and multi-domain and multi-point identified and measured in real time under various scenes, so that the water level under extreme conditions such as heavy rain, flood and the like is obtained in real time, monitored for a long time and early-warned in time.
The water level identification method based on the haar-like feature can avoid interference of floaters and foreign matters on the water or shore-based fixed scale identification method. The illumination and identification of the water level shoreline can be carried out by setting a fixed light source and a camera at night through natural light in daytime.
The method of the invention can be used in hydraulic and hydroelectric engineering, and can also be used in other places with continuous shorelines, such as natural rivers, reservoirs, water pools and the like.
Drawings
FIG. 1 is a schematic flow chart of the present invention;
fig. 2 is a schematic diagram of the application of the present invention.
Detailed Description
The invention will now be described in further detail with reference to the drawings and specific examples, which are given for clarity of understanding and are not to be construed as limiting the invention.
As shown in fig. 1, the present invention provides a method for recognizing a water level using a machine vision without a scale, comprising the steps of:
acquiring a video image of a river surface water body and a shore base to be detected; a calibration object is arranged on the shore base;
filtering a video frame of a video image;
graying each frame of image in the filtered video image, and extracting an edge image of river surface water body in each frame of image based on a Sobel operator;
dividing an edge image in any frame of image into a plurality of sections of images; and respectively detecting the water level line height of each section of image based on the Haar-like features, and calculating the total water level height of the river surface water body at the corresponding moment of each frame of image based on the water level line height of each section of image.
The invention provides a method for recognizing water level without scale by utilizing a machine vision continuity smooth edge contour algorithm, wherein a realization system mainly comprises an optical system, an image acquisition module, an image processing system, an early warning and other state output interactive interfaces, and the method comprises the following steps: (1) industrial grade cameras (monocular or multicular); (2) Dedicated light sources (supplemental lighting only at night recognition); (3) an elevation reference mark (shore-based); (4) a body of flowing or stationary water; (5) an image acquisition card; (6) A continuous smooth edge contour recognition and AI algorithm processing unit; (7) an early warning device; (8) a deep learning unit; (9) a trend status output display device; (10) power and control cables. The method comprises the steps of carrying out a first treatment on the surface of the
Taking machine vision and AI identification of the water level of a flowing water body (natural river and water delivery canal) as an example, the system of the invention mainly decomposes and introduces the functions of equipment as follows:
(1) Industrial-grade camera (monocular or multi-eye)
The area array camera or the linear array camera can be selected and used for acquiring images of the river surface to be measured and the shore base thereof. And recognizing the color difference of the water body in the embodiment, and selecting an area array camera. Under the circumstance of identifying the water surface chromatic aberration, a high-dynamic full-color camera can be selected. The camera resolution is calculated according to the actual image breadth and accuracy requirements, in this example, high accuracy and dynamic color difference recognition are required, so that 1920 pixels×1080 pixels with higher resolution are selected. Generally, in this example, long-term state monitoring is adopted, and the frame rate can be selected to be low, such as 1fps, due to the slow change speed of the sediment content of the water body. Because the camera of this example is generally fixed in position, the lens can employ fixed focus, fixed aperture.
(2) Special light source (supplementary lighting for night recognition only)
The water level can be identified under natural light in this example, the special light source is a supplementary light source necessary for the identification under night condition, and in this example, the continuous edge contour of the identification target object is selected from the front or the front side light source.
(3) Elevation reference mark (shore base)
The elevation calibration is performed in advance for the shore-based fixed mark, so that the elevation calibration can be accurately identified in an image or a video, and the elevation calibration is used as a water level measurement reference system of a measurement target.
(4) Flowing or stationary bodies of water
Identified target objects, including flowing bodies of water, such as natural rivers, main channels, canals, and the like; and stationary bodies of water such as lakes, reservoirs, etc. The example is the river surface of a natural river.
(5) Image acquisition card
The data interface is used for acquiring and preprocessing the image acquired by the industrial Camera lens, determines the transmission bandwidth according to the resolution and the frame rate, and can select a USB3.0, camera Link or GigE interface in combination with the transmission distance. The example selects the USB3.0 interface.
(6) Continuous smooth edge contour recognition and AI algorithm processing unit
The method is used for executing a method program for recognizing the water level without a scale by utilizing machine vision, the water level (shoreline) is recognized with high precision by means of high-speed and high-dynamic machine vision imaging by means of an edge recognition algorithm, the water level shoreline with irregular wave fluctuation is analyzed into a water level average straight line parameter by curve piecewise linearity and haar-like characteristics, and the water level parameter is recognized and read by combining the comparison of the calibration elevation reference system.
(7) Early warning device
And the device is used for sending out an early warning signal when the water level or the variation exceeds the minimum fastening force limit value (early warning threshold value) in the safety coefficient range.
(8) Deep learning unit
The method is used for carrying out contrast analysis and deep learning on water level parameters obtained in real time in the time domain, and can carry out intelligent recognition, prediction and early warning on extreme phenomena such as heavy rain, flood peak, debris flow and the like when sudden change trend occurs.
(9) Power supply and control cable
And the power cable is connected with the control cable for connecting the equipment.
In specific embodiment 1, taking machine vision and AI identification of water level of a natural river as an example (the machine vision identification method of other flowing and non-flowing water scenes is similar to the above), the application flow of the invention is as follows:
because the acquired river surface water body and shore-based images are relatively rough in the shore area, the water body area is relatively smooth, and the water body color is relatively single, obvious mutation exists between the two areas, and the water level line can be confirmed at the mutation position. Meanwhile, as the water surface is always in a flowing state, the process of filtering the video frames of the video image comprises the following steps: and performing motion compensation on video frames of the video images by adopting a linear Kalman filter, and performing time update and measurement update on the acquired river water body and shore-based images based on Kalman filtering to obtain stable frame position signals, thereby realizing filtering processing.
Specifically, two key steps of Kalman filtering on the collected river surface water body and shore-based image are time update and measurement update respectively: the method is firstly responsible for timely and forward calculating the state variable of the current video frame and the value of the error covariance estimation so as to construct prior estimation for the current time state, and the prior estimation of the video frame and the new actual measured value are combined to construct improved posterior estimation. The process can also be a prediction and correction process, and the mathematical principle is expressed as follows:
Figure GDA0004182487210000071
Figure GDA0004182487210000072
K k =P k - H T (HP k - H T +R) - (3)
Figure GDA0004182487210000073
P k =(I-K k H)P k - (5)
equation (1) represents a state prediction equation of the Kalman filter, equation (2) represents a covariance equation of the Kalman filter in a prediction state, equation (3) represents a filter gain equation of the Kalman filter, equation (4) represents a state optimization estimation equation of the Kalman filter, and equation (5) represents a covariance equation of the state optimization estimation of the Kalman filter.
When Kalman filtering is utilized to smooth the acquired river surface water body and shore-based images, the method mainly comprises the following steps: first, calculate the Kalman gain K of the measurement update according to equation (3) k Then assume an initial value
Figure GDA0004182487210000074
And p 0 And combined with the actual measured value Z at time k k And equation (4), for k time instant estimationPosterior estimation of State->
Figure GDA0004182487210000075
Performing recursive computation, and finally performing posterior covariance P of the estimated state according to formula (5) k And (5) performing calculation.
The process of graying each frame of image comprises the following steps: and carrying out graying treatment on the water body and the shore-based image of the river surface after each frame is smoothed, and taking the sum of absolute values of horizontal and vertical gray values of each pixel point as a new gray value of the pixel point.
The method adopts classical Sobel operator to calculate convolution, and extracts the edge image of river surface water body in each frame of image. As an operator for searching the edge by utilizing the local difference, the Sobel operator comprises two operators which can respectively detect the horizontal edge and the vertical edge, and can reduce the blurring degree of the edge by carrying out weighted average on the position influence of the pixel and then carrying out differential operation. The Sobel operator in the horizontal direction and the vertical direction can be calculated as follows:
Figure GDA0004182487210000081
Figure GDA0004182487210000082
f () represents the gray value at the point of change; x, y represents the abscissa; delta x f (x, y) represents the gray value of the point in the abscissa direction after edge detection; delta y f (x, y) represents the gray value of the point in the ordinate direction after edge detection.
Based on the calculation results of the two operators, taking the maximum value of convolution of Sobel operators in the horizontal direction and the vertical direction for each pixel point A on the river surface water body and the shore-based image after the graying treatment as the output value of the pixel point, and respectively obtaining the horizontal and longitudinal brightness difference approximate values G x And G y And further obtaining an edge image, wherein the calculation method is shown in the formula (8):
Figure GDA0004182487210000083
further, the gradient magnitude and direction of the edge image can be calculated using the formulas (9) and (10), respectively, and can be converted into the edge image by a computer:
Figure GDA0004182487210000084
θ=tan -1 (G y /G x ) (10)
based on the edge images of river water body and shore base, the invention selects Haar-like features to detect water level lines, which are defined as differences of pixel gray value sum in adjacent areas in the images, and can reflect the gray change of the detected local features of the edge images of river water body and shore base. Since the water line is usually an irregular curve, the invention adopts a method for segmenting the image so as to improve the accuracy of water line detection.
As shown in fig. 2, the process of calculating the total height of the water level of the river surface at the moment corresponding to any frame of image in this embodiment mainly includes the following steps:
under the condition that the water level line is not changed greatly, the whole image can be divided into a plurality of sections of images at equal distance, the water level line of the river surface water body in each section of image is obtained respectively, and then the water level line is fitted into a complete water level line.
Because the height of the water level line can be changed, the irregular trapezoid area representing the change of the water level line is required to be generalized into a rectangular area, and the height of the rectangular area is the average water level line in the edge images of river water body and shore base.
When the change of the water level line is large, the water level line needs to be divided with different distances, the position of the water level line on the left bank is taken as an original point, the position of the water level line on the right bank is taken as an important point, and the distance division is carried out according to the change rate of the water level line in the edge image, so that an abscissa set [0, x ] of the division points can be obtained 1 ,x 2 ,...,x n ,L]. L is the water body of the river surfaceOverall length.
Because the water line is located at the abrupt position between the water body area and the land area, and in each segmented water body image, the water body area and the non-water body area are both rectangular, the Haar features of the two rectangles are used for detection. The edge images of river surface water body and non-water body can be divided into two areas according to the number of black characteristic points: a characteristic region and a non-characteristic region. The former feature points are dense, while the latter are the opposite.
The process for respectively detecting the water level line height of each section of image based on the Haar-like features and further calculating the total height of the water level of the river surface water body at the corresponding moment of each frame of image comprises the following steps: summarizing irregular trapezoid areas (such as broken lines shown in a first row in fig. 2) representing water bodies on river surfaces and water line edge images corresponding to shore-based images in each section of images into rectangular areas, such as histograms shown in a second row in fig. 2; dividing rectangular areas of the river surface water body and the shore-based water line edge image into a characteristic area and a non-characteristic area according to the number of black characteristic points, wherein the black characteristic points of the characteristic area are dense, and the black characteristic points of the non-characteristic area are opposite; respectively calculating the centers of the characteristic region and the non-characteristic region, and then sliding a Haar characteristic target between the two centers to calculate characteristic values of the characteristic region and the non-characteristic region, wherein the position with the maximum characteristic value is the position of a water level line of the river surface water body corresponding to the section of image; the ordinate of the water level line of the river surface water body corresponding to each dividing point is obtained again, and the ordinate of the average water level line is obtained through calculation based on the abscissa of each image dividing point and the ordinate of the water level line of the river surface water body corresponding to the dividing point; and calculating the water level height according to the ordinate of the obtained average water level line and the ordinate of the calibration object on the shore base, and obtaining a straight line shown in the third row in fig. 2. The method can obtain the height (ordinate) of the water line corresponding to each division point as [ y ] 0 ,y 1 ,y 2 ,...,y n ,y L ]Based on the above data, the average height of the water line in the present invention is calculated according to formula (11) using the area surrounding method:
Figure GDA0004182487210000101
wherein y is Z Representing the ordinate of the mean water line, n=n+2 representing the number of segments of the water line. And (3) calculating the difference value between the ordinate of the average water level line of the river surface water body and the ordinate of the calibration object on the shore base, and calculating to obtain the water level height. And if the water level exceeds the set threshold value, sending out an early warning signal. The curve shown in the fourth line of fig. 2 is the original water surface edge image, and the straight line is the recognized water level height.
Based on a large amount of data of the obtained water level height of the water surface changing along with time, the invention adopts a W-LSTM prediction model to predict the future water level height of the water surface, thereby realizing the pre-judgment on extreme conditions such as heavy rain, flood and the like. The prediction model combines wavelet analysis with an LSTM network, thereby realizing acquisition of water level sequence components of water surfaces with different time scales and prediction of future water levels.
The components of specific characteristic differences in the data of the water level height of the water surface changing along with time are separated based on wavelet analysis, so that a stable sequence and a non-stable sequence on different scales are obtained. According to the invention, dbN wavelet sequence 4-level decomposition is selected, water level height data at 24 points per day is used as a decomposition sequence, and characteristic analysis is carried out on massive water level height data changing with time.
And then the LSTM network is combined to realize the prediction of the water level height of the water surface. The LSTM network is an improved time-loop neural network, solves the problem of gradient disappearance in model training by adding an additional forgetting gate, and has the following calculation formula:
f t =σ(W fx x t +W fh h t-1 +b f ) (12)
i t =σ(W ix x t +W ih h t-1 +b i ) (13)
g t =φ(W gx x t +W gh h t-1 +b g ) (14)
o t =σ(W ox x t +W oh h t-1 +b o ) (15)
S t =g t ⊙x t +S t-1 ⊙f t (16)
h t =φ(S t )⊙o t (17)
wherein f t ,i t ,g t ,o t ,S t And h t Respectively representing states of forgetting gate, input node, output gate, state unit and intermediate output in network, sigma and phi respectively representing sigmoid function change and tanh function change, W fx ,W fh ,W ix ,W ih ,W gx ,W gh ,W ox And W is oh Representing matrix weights multiplied by the input and intermediate output, b f ,b i ,b g ,b o Respectively representing bias terms, wherein, as indicated by the following, the vectors are multiplied by elements;
the number of layers of the model and the number of neurons of each layer are selected through an experimental method, and finally, the prediction of the water level height of the water surface in the future is determined by adopting the 2 LSTM network layers and one full connection layer, so that the prediction of extreme conditions such as heavy rain, flood and the like is realized. Firstly, separating components of specific characteristic differences in data of the overall height of the water level of the river surface water body along with time based on wavelet analysis to obtain a stable sequence and a non-stable sequence on different scales; training an LSTM network by adopting historical data of the total height of the water level of the river surface, and adopting a stable sequence and an unstable sequence obtained by decomposition as characteristic analysis results of the historical data to guide the training process of the LSTM network; and inputting the historical data of the total water level height of the river surface water body containing the current moment data into a training completion LSTM network to obtain the predicted total water level height of the river surface water body in the future.
Specific example 2 takes identification and measurement of natural river water level in the Yangtze river section from upstream of Ge Zhou dam hydroelectric power station to downstream of three gorges dam as an example.
The water level change between the section of the Yangtze river between the Ge Zhou dam and the three gorges dam and between the downstream section and the 30km section of the Ge Zhou dam hydropower station is greatly dependent on the operation mode of the three gorges junction due to the power generation and regulation effects of the upstream three gorges hydropower station, for example, the water level of the river in the section can rise when the three gorges dam discharges floodwater, and the water level of the river in the section falls back when the three gorges high-level water storage power generation is carried out in the dead water period. Therefore, the length of the Yangtze river of the Ge Zhouba-Sanxia section is not long, but the water level change is more influenced by the operation modes of power stations at two ends of the section except for natural factors, and the existing means and method for monitoring the water level in real time on line in all weather, multiple points and multiple sections and high precision in the section of natural river channel are difficult to realize.
The application process of the specific embodiment 2 is as follows:
firstly, a fixed machine vision optical system is installed on a river surface section needing to identify and measure water level, a front camera or a front side camera is arranged aiming at a target river surface, and an image of river surface water body is in a calibrated camera vision range. And the LED light source is arranged for supplementing light (used for night illumination) corresponding to the image range of the camera lens, so that the illumination requirement of on-site high-definition imaging is met. The camera is of industrial grade, 1920 pixels×1080d pixels, and 1fps frame rate is selected. The image acquisition card is used for acquiring and preprocessing the image acquired by the industrial-grade camera lens, and the data interface selects the USB3.0 interface according to the transmission bandwidth determined by the resolution and the frame rate.
And then establishing a reference system of the standard elevation mark (shore base) in the camera view range based on the shore base, namely calibrating the marker or mark with high precision by using the ground marker or set manual fixed mark above the water surface line of the shore base as an elevation reference system for measuring the river water level of the measuring target section. In the method, a manual mark is arranged on a shore base at a position 20km downstream of a three gorges dam, and the calibration elevation is 57.000m. The shore-based artificial identification image and the corresponding labeling reference image are images of the same shore-based artificial identification state obtained under the same shooting condition; the same shooting conditions comprise the same relative positions of the camera and the shore-based manual mark, the same camera and the same shooting angle of the camera. The same shore-based artificial mark status does not include the relative position of the shore-based artificial mark and the water surface.
By means of high-speed and high-dynamic machine vision imaging, the water body liquid level (shoreline) is identified with high precision by means of an edge identification algorithm, the water surface shoreline with irregular wave fluctuation is analyzed into a water level average straight line parameter by means of curve piecewise linearity and haar-like characteristics, the 57.000m calibration elevation is combined and compared and measured to obtain a water level elevation (average correction value) within a certain range, the water level (m) within the range of the high Cheng Ji is the average water level (m) within the view range, the water level result identified and obtained in the example is 53.123m, and the measurement deviation of the same section with a professional water level meter is within +/-5%. In practical application, the camera shoots the shore-based manual identification of a certain measuring point generally fixedly, and the differences between the images shot at different times are only caused by different water levels, so that the shore-based manual identification of each measuring point can be respectively pre-constructed with corresponding labeling reference images.
And when the water level of the water surface in the range of the monitoring target object exceeds a set threshold value, sending out an early warning signal. And outputting the change trend analysis of the water level according to the change delta C (m)/day, delta C/week or delta C/Month of the water level in the water level section on two or more time sequences and the corresponding change rate delta aC/day, delta aC/week or delta aC/Month by a prediction method combining wavelet analysis and long-short-term memory (LSTM) network, and sending out forecast and early warning.
In addition, on the basis of the above, a multipoint multi-section series water level curve can be established, and the change trend forecast and the early warning of the water level in a long section can be provided in real time.
What is not described in detail in this specification is prior art known to those skilled in the art.

Claims (8)

1. A method for recognizing water level without scale by using machine vision, which is characterized in that: the method comprises the following steps:
acquiring a video image of a river surface water body and a shore base to be detected; a calibration object is arranged on the shore base;
filtering a video frame of a video image;
graying each frame of image in the filtered video image, and extracting an edge image of river surface water body in each frame of image based on a Sobel operator;
for an edge image in any frame image, dividing the edge image into a plurality of segments of images:
dividing the water line edge image into multiple segments by adopting different distances, and performing distance division according to the water line change rate in the edge image by taking the position of the water line on the left bank of the bank base as an origin and the position of the water line on the right bank of the bank base as a center to obtain an abscissa set of division points
[0,x 1 ,x 2 ,...,x n ,L]L is the total length of the river surface water body;
and respectively detecting the water level line height of each section of image based on the Haar-like features, and calculating the total height of the water level of the river surface water body at the corresponding moment of each frame of image based on the water level line height of each section of image:
summarizing the irregular trapezoid area of the water level line edge image corresponding to the river surface water body representation and the shore-based image in each section of image into a rectangular area; dividing rectangular areas of the river surface water body and the shore-based water line edge image into a characteristic area and a non-characteristic area according to the number of black characteristic points, wherein the black characteristic points of the characteristic area are dense, and the black characteristic points of the non-characteristic area are opposite; respectively calculating the centers of the characteristic region and the non-characteristic region, and then sliding a Haar characteristic target between the two centers to calculate characteristic values of the characteristic region and the non-characteristic region, wherein the position with the maximum characteristic value is the position of a water level line of the river surface water body corresponding to the section of image; re-executing the steps to obtain the ordinate [ y ] of the water level line of the river surface water body corresponding to each partition point 0 ,y 1 ,y 2 ,...,y n ,y L ]And based on the abscissa of each image division point and the ordinate of the water level line of the corresponding river surface water body, calculating to obtain the ordinate y of the average water level line by adopting the following formula Z
Figure FDA0004182487200000011
And (5) calculating the difference value between the ordinate of the average water level line of the river surface water body and the ordinate of the calibration object on the shore base to obtain the water level height.
2. The method according to claim 1, characterized in that: the method also comprises the following steps: and predicting the water level height of the water surface in the future by adopting a W-LSTM prediction model based on the total water level height of the water body of the river surface at different moments.
3. The method according to claim 1, characterized in that: the method also comprises the following steps: calculating the total height of the water level of the river surface water body at the corresponding moment of each frame of image in real time, and comparing the total height with a set threshold value; and selecting whether to send out an early warning signal based on the comparison result.
4. The method according to claim 2, characterized in that: based on the total height of the water level of the river surface water body at different moments, the process for predicting the future water level height by adopting the W-LSTM prediction model comprises the following steps:
according to the water level difference of the water level of the river surface water body to be measured on two or more time sequences and corresponding change rates, outputting the change trend of the water level by a prediction method combining wavelet analysis and a long-short-period memory network, and sending out an early warning signal.
5. The method according to claim 2, characterized in that: the process of filtering video frames of a video image includes: and performing motion compensation on video frames of the video images by adopting a linear Kalman filter, and performing time update and measurement update on the acquired river water body and shore-based images based on Kalman filtering to obtain stable frame position signals, thereby realizing filtering processing.
6. The method according to claim 2, characterized in that: the process of graying each frame of image comprises the following steps: and carrying out graying treatment on the water body and the shore-based image of the river surface after each frame is smoothed, and taking the sum of absolute values of horizontal and vertical gray values of each pixel point as a new gray value of the pixel point.
7. The method according to claim 6, wherein: the process for extracting the river surface water body edge image corresponding to each frame of image based on the Sobel operator comprises the following steps: performing weighted average and differential operation on the position influence of the pixels by adopting Sobel operators in the horizontal direction and the vertical direction; taking the maximum value of Sobel operator convolution in the horizontal direction and the vertical direction for each pixel point on the river surface water body and the shore-based image after any frame graying treatment based on the calculation result as the output value of the pixel point, and respectively obtaining the horizontal and longitudinal brightness difference approximate values; and obtaining the gradient size and the gradient direction of the edge image based on the transverse and longitudinal brightness difference approximate values, and converting the gradient size and the gradient direction into a water level line edge image corresponding to the river surface water body and the shore base image of the frame.
8. The method according to claim 4, wherein: firstly, separating components of specific characteristic differences in data of the overall height of the water level of the river surface water body along with time based on wavelet analysis to obtain a stable sequence and a non-stable sequence on different scales; training an LSTM network by adopting historical data of the total height of the water level of the river surface, and adopting a stable sequence and an unstable sequence obtained by decomposition as characteristic analysis results of the historical data to guide the training process of the LSTM network; and inputting the historical data of the total water level height of the river surface water body containing the current moment data into a training completion LSTM network to obtain the predicted total water level height of the river surface water body in the future.
CN202310010209.5A 2023-01-05 2023-01-05 Method for recognizing water level without scale by utilizing machine vision Active CN115760850B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310010209.5A CN115760850B (en) 2023-01-05 2023-01-05 Method for recognizing water level without scale by utilizing machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310010209.5A CN115760850B (en) 2023-01-05 2023-01-05 Method for recognizing water level without scale by utilizing machine vision

Publications (2)

Publication Number Publication Date
CN115760850A CN115760850A (en) 2023-03-07
CN115760850B true CN115760850B (en) 2023-05-26

Family

ID=85348492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310010209.5A Active CN115760850B (en) 2023-01-05 2023-01-05 Method for recognizing water level without scale by utilizing machine vision

Country Status (1)

Country Link
CN (1) CN115760850B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118052820B (en) * 2024-04-16 2024-07-02 沈阳迈思医疗科技有限公司 Water level detection method, device, equipment, storage medium and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2544450B1 (en) * 2011-07-07 2016-04-13 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Model parameter estimation for a rate- or distortion-quantization model function
CN110596715B (en) * 2019-09-20 2021-07-06 中国有色金属长沙勘察设计研究院有限公司 Intelligent waterline identification system and positioning method
CN111222689A (en) * 2019-12-06 2020-06-02 重庆三峡学院 LSTM load prediction method, medium, and electronic device based on multi-scale temporal features
CN112381067A (en) * 2020-12-21 2021-02-19 赵如月 Intelligent image water level identification method based on fixed view port
CN114279521A (en) * 2021-12-28 2022-04-05 合肥中纳医学仪器有限公司 Method and system for monitoring safe water level and application thereof
CN114359841B (en) * 2022-03-07 2022-06-03 武汉大水云科技有限公司 Video water level identification method based on space-time average
CN115509122B (en) * 2022-11-21 2023-03-21 山东高速集团有限公司创新研究院 Online optimization control method and system for unmanned line marking vehicle based on machine vision navigation

Also Published As

Publication number Publication date
CN115760850A (en) 2023-03-07

Similar Documents

Publication Publication Date Title
CN107506798B (en) Water level monitoring method based on image recognition
CN109508630B (en) Method for identifying water level of water gauge based on artificial intelligence
CN115409741B (en) Machine vision identification method for measuring sediment content by using river surface color difference
CN101586956B (en) River water level monitoring method based on monocular camera
CN102564508B (en) Method for implementing online tests of stream flow based on video images
CN110473217A (en) A kind of binocular solid matching process based on Census transformation
CN110210350A (en) A kind of quick parking space detection method based on deep learning
CN113158768B (en) Intelligent vehicle lane line detection method based on ResNeSt and self-attention distillation
CN110097536A (en) Hexagon bolt looseness detection method based on deep learning and Hough transformation
CN115760850B (en) Method for recognizing water level without scale by utilizing machine vision
CN111259827B (en) Automatic detection method and device for water surface floating objects for urban river supervision
CN112084712A (en) Flood submerging range dynamic simulation method fusing active and passive microwave remote sensing information
CN109186706A (en) A method of for the early warning of Urban Storm Flood flooding area
CN110765912B (en) SAR image ship target detection method based on statistical constraint and Mask R-CNN
CN115546235B (en) Water level identification method, system and storage medium based on image segmentation
CN114639064B (en) Water level identification method and device
CN103735269A (en) Height measurement method based on video multi-target tracking
CN115060343B (en) Point cloud-based river water level detection system and detection method
CN115393700A (en) Water level height identification method and device, electronic equipment and storage medium
CN112884731B (en) Water level detection method and river channel monitoring method based on machine vision
CN115493740B (en) Method and system for measuring pressure pulsation of internal flow passage of water turbine by using machine vision
Lin et al. Semantic segmentation and scale recognition–based water-level monitoring algorithm
CN115797411B (en) Method for online recognition of hydropower station cable bridge deformation by utilizing machine vision
CN115830514B (en) Whole river reach surface flow velocity calculation method and system suitable for curved river channel
Yang et al. Measure dry beach length of tailings pond using deep learning algorithm

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
GR01 Patent grant
GR01 Patent grant