A Newly Developed Unmanned Aerial Vehicle ( UAV ) Imagery Based Technology for Field Measurement of Water Level

Field measurement of water level is important for water conservancy project operation and hydrological forecasting. In this study, we proposed a new measuring technique by integrating the advantages of unmanned aerial vehicle (UAV) photogrammetry and image recognition technology. Firstly, the imagery of water fluctuation process was captured by an UAV airborne camera, and water surface line in the imagery was recognized and extracted using image recognition technology. Subsequently, successive water levels at a measuring section were calculated by parameter calibration. Statistical parameters of water levels, such as maximum, average, and minimum values during the capturing period were also calculated. Additionally, we introduced a correction method to offset the error caused by UAV drift. The newly proposed method was tested in field measurement for Miaowei hydropower station, China, and the results showed that the method is reliable and adoptable.


Introduction
Water level process of water conservancy projects (e.g., Oroville dam, USA; Three Gorges Dam, China, etc.), overcurrent structures (e.g., spillway, lock approach, and plunge pool, etc.), and rivers is one of the important hydraulic indexes.In particular, for newly constructed dams and river engineering works, it is necessary to conduct accurate field measurements of water level and its surface fluctuations in order to analyze their operation behaviors, test engineering design, and provide operation guidance.Therefore, the high-precision measurement of water level is significant for the safe operation of water conservancy projects [1].
Instruments for field measurement of water level should be advanced and automatic with the premise of reliability, economy, durability, and practicality [1].Common instruments include water level measuring rule, float-type water level gauge, pressure-type water level gauge, ultrasonic water level gauge, and radar water level gauge.However, these instruments have some disadvantages, especially in the complex natural environment, details are as follows.

•
Water level measuring rule is a traditional contacting measurement method, which needs manual measurement, suggesting that it is difficult to continuously measure water level for its poor automaticity.In addition, it is easily damaged under high-speed flow, and also difficult to accurately obtain the water level when water surface fluctuates intensely.

•
Float-type water level gauge is suitable for low sandy flow, and the water level measuring well needs to be built for its operation [2].Regularly adjusting the water level and cleaning up siltation in the measuring well and pipeline often results in high operating cost.

•
Pressure-type water level gauge is installed underwater, thus its accuracy is affected by water impurities and wave, and its calibration process is complex, resulting in a high failure rate [3].

•
Ultrasonic water level gauge and radar water level gauge are vulnerable to external interferences, and they have relatively high operating costs for regular calibration [4,5].
Moreover, for some overcurrent buildings, such as spillways, in order to measure water level fluctuations, plurality of instruments along the flow need be installed, which increases instrument installation workload and costs.In some particular cases, such as short-term field measurements during the flood season of a new water conservancy project, the workload and cost of using above-mentioned instruments are higher, indicating their low applicability and efficiency.Image recognition technology, an important automatic, informative, and intelligent method, has been applied to many water level monitoring systems [6][7][8].These systems improved measurement efficiency.However, these systems need to be equipped with a measuring rule and a fixed image acquisition device, which limits its applicability in complex conditions, such as high flow velocity and wide channel.Recently, with rapidly improving performance of unmanned aerial vehicle (UAV), captures of objective imagery by airborne camera, identification of dynamic morphological characteristics in imagery based on image recognition technology has become a research hotspot in the field of water conservancy management [9].Wang [10] introduced the characteristics of UAV photogrammetry technology and prospected its application in water conservancy domain.Lin [11] applied the UAV and image recognition technology to identify and analyze river ice, as introduced its implementation process, and applied this technology in the ice section of Yellow River, China.Photogrammetry and image recognition technology were combined by Ahmad and Room to classify riverway and floodplain area and obtain their scale in physical river model [12].Stephen [13] introduced a river boundary recognition system based on UAV images, and provided, in detail, the image recognition and planning algorithms.Tammingac [14] assessed the capabilities of UAV to characterize the river channel morphology and hydraulic habitat, including bathymetry, grain sizes, undercut banks, forested channel margins, and large wood, and discussed the advantages and challenges of this technology for river research and management.Woodget [15] exploited a novel approach for characterizing river physical habitat, which consists of a small unmanned aerial system (sUAS) and Structure-from-Motion photogrammetry (SfM).Their results showed that the sUAS-SfM approach provided high-resolution and spatially continuous, and explicit measurements of water depth and point cloud roughness at the microscale.Thumser [16] developed a real-time measurement system for natural river surface flow velocity fields that are based on drone images and applied it in the study of Brigach River, German.
In order to overcome the disadvantages of current image-based water level monitoring systems, this study utilized the technical advantages of both UAV (e.g., flexibility and mobility) [17] and image recognition technology (e.g., high automaticity and efficiency) [18], and developed a new UAV imagery based technology for the field measurement of water level (UAVi-fmwl).The objectives of this study are to: (1) introduce the research idea of the measuring technology and components of the measuring system; (2) introduce its implementation processes in detail, including coefficient calibration, image preprocessing, offset correction, and water level identification and calculation; and, (3) examine its applicability and reliability by applying the new optical measuring technology in a hydraulic prototype measurement task.

Study Site
A short-term field measurement of the Miaowei hydropower station on the Lancang River, Yunnan Province, China (25 • 51.102 N, 99 • 09.870 E) was implemented (Figure 1).This newly-constructed hydropower station came into operation in March 2017.The normal water level of the hydropower station is 1408.00m (1985 National Height Datum of China), with a corresponding storage capacity of 0.66 billion m 3 .This hydropower station is a first-class engineering project (maximum dam height: 139.8 m), with the major functions of flood control, electricity generation, and water supply.
Plunge pool, located at the downstream of spillway, is an important structure for flow energy dissipation and riverbed erosion protection, and water level and water surface fluctuation of plunge pool have important influence on plunge pool design and operation, especially for sidewall height [19].Therefore, the water level at the sidewall of the plunge pool (atomization wind area) during spillway flooding is an important measurement task.
The sidewall is up to 15 m or more in height, and the flow velocity is high and the water level fluctuation is large here.Thus, it is difficult to install the measurement ruler.Also, since water level needs to be observed only for a short time period, other water level measuring instruments are expensive and with low applicability to install or use.The river width at the water level measurement section is about 160 m, and there is no suitable condition for fixed camera installation on the opposite bank.Therefore, the newly developed UAV imagery based technology for field measurement of water level was adopted.

Integrated Design of Measurement Technology
We used quadcopter UAV (details in Section 2.3) as an aerial platform to obtain the video of close range water surface fluctuation process.The dedicated image recognition algorithm was exploited to recognize the water surface fluctuation processes and to calculate water fluctuation parameters.The corresponding measurement system consists of UAV and airborne camera, plane wall, baffle or straight line, two calibration points and a correction point (Figure 2), and image processing software (Figure 3).The research ideas of this measurement technology are as follows: 1.
Two calibration points (B 1 , B 2 ), located at the water level measuring vertical line (L), are set on the side wall of the water level measurement section.Both points are higher than the highest water level of the measurement section, and the absolute elevations of the two calibration points (Z 1 , Z 2 ) are staked out in survey, respectively.In addition, correction point (J) is also set to correct the measurement error that is caused by the UAV offset.

2.
UAV hover close the side wall and its airborne camera capture the water surface fluctuation processes, the selected capture area should include three points B 1 , B 2 , J, and consider the highest and lowest water level at L extension.

3.
According to the captured water surface fluctuation video, we used Visual Studio 2008 (VS2008) [20] combined with OpenCV [21] as the development tool under the operating platform of Windows 7. The dedicated image recognition algorithm was programmed and used to recognize the intersection point W of L and water surface in each frame image, and to calculate the actual elevation of W based on the calibration coefficient and calculation formula automatically.

UAV and Drone Camera
In this study, the DJI MAVIC 2 (Figure 4) was used as an aerial platform, and the water surface fluctuation process was captured by HD integrated drone camera.This camera, L1D-20c model (RGB lens, frame rate: 10 HZ, pixel: 3840 × 2160), is jointly developed by DJI and Hasselbald.The DJI MAVIC 2 is a rigid quadcopter with a maximum ascent rate of 5 m/s, a maximum descent rate of 3 m/s and a maximum flight speed of 20 m/s, a maximum range of 5000 m, and a maximum altitude of 500 m.Its maximum hover stabilization precision is 0.1 m in the vertical direction and 0.3 m in horizontal direction.Its max-endurance is about 30 min, which is sufficient for our measurement duration need (less than two minutes every experiment case).The operator can control the UAV and camera using Wi-Fi, which is a very important function that allows for real-time viewing and the obtaining of scene being captured by the camera.

Coefficient Calibration
The coefficient calibration is to map the relationship between the image pixel scale and actual spatial scale, and it is the key step to accurately calculate the target features in the image.This study focuses on the water level time series of the measuring section.By numerically calibrating the space vertical scale, the water level elevation data can be accurately converted.Two calibration points, B 1 and B 2 , were set on the side wall of the water level measuring section, and their real elevations were measured by the total station (1985 National Height Datum of China; Z 1 = 1322.16m, Z 2 = 1316.16m), one offset correction point J was also set on the side wall.The first frame image and related markers are shown in Figure 5, and corresponding markers coordinates are listed in Figure 6.The origin of the pixel coordinates of the image is the upper left corner (O) (Figure 6).According to B 1 and B 2 pixel vertical coordinates P 1 , P 2 , and their actual elevation Z 1 , Z 2 , and S point pixel vertical coordinate P s , the actual elevation Z s of point S can be obtained.It is considered as the actual reference elevation of the water level measuring section in the collection area, and Z s is calculated by Equation ( 1), as: According to the reference elevation that was obtained by Equation (1), the actual elevation of point W can be calculated using Equation (2), as: where P w is an unknown quantity and it needs to be acquired with the dedicated image recognition algorithm.

Image Preprocessing
The main purpose of image preprocessing is to eliminate irrelevant information in the image, enhance the detectability of relevant information, and minimize calculating task.This step will improve image segmentation, object recognition reliability, and processing efficiency [22].Image preprocessing adopted in this study includes the steps of extracting ROI (Region of Interest), image graying, binarization, and opening operation.Image preprocessing details are as follows, and the effect of image preprocessing is shown in Figure 7.
(1) Extraction of ROI.In the image processing, the specific area is selected from the whole image to be processed by a box, a circle, etc., which is called a ROI, and it serves as an important preprocessing task primarily for subsequently object tracking.The ROI can reduce processing time, increase recognition accuracy, and improve processing efficiency [23].In this study, the ROI is selected in a box manner (Figures 5 and 6), and the subsequent image processing takes the ROI as the processing object.In addition, it is necessary to determine the horizontal pixel coordinate X c of the measuring section L in the ROI area.(2) Image graying.Images taken by UAV are always colorized (RGB), and the color of each pixel is determined by three components: red (R), green (G), and blue (B).Each component has 256 (0-255) values, and one pixel has more than 16 million color changes.Such large amount of data will reduce the efficiency of image processing.The grayscale image is calculated by calculating R, G, and B of each pixel in the colorized image, using only one numerical value (0-255) to represent the characteristics of the pixel.Grayscale image, obtained by a reasonable grayscale calculation method, can still characterize the target in the color image, and can greatly reduce the calculation task and improve the image processing efficiency.Therefore, image graying is always the critical step in many image processing tasks [24].After comparing and selecting different gray methods, this study uses grey-scale average method to obtain gray image, which can meet the needs of subsequent processing.(3) Image binarization.Image binarization is also called as image segmentation or image thresholding [22].The appropriate threshold is used to distinguish the target and background in the gray image, which is convenient for subsequent target extraction and parameter calculation.
Selecting an appropriate threshold segmentation manner has been the subject of active research for many years [25].In order to avoid the influence of uneven illumination on the segmentation, we used the adaptive threshold segmentation manner to obtain the threshold of the neighborhood by calculating the average value of the pixel gray value in the neighborhood of the pixel [26].
A pixel whose gray value is larger than the threshold value is determined to be one type and a gray value is set as 255.A pixel whose gray value is smaller than the threshold value is determined to be another type and its gray value is set as 0. By adjusting the threshold parameters in the algorithm, the water body and the wall are divided.The gray value of the water body area in the image after segmentation is 255, and the gray value of the wall near the water surface is 0. ( 4) Image open operation.After the image segmentation, the binary image generally suffers from noise or breakpoints, and this situation is especially obvious in photographs that were taken in the field [27].In order to eliminate noise and fuse the water surface line breakpoints, the binary image is processed by the "image open operation" (consists of "erosion operation" and "dilation operation") with a certain structuring element [28].In this study, an ellipse structuring element (size: 2 × 2 pixel) is defined and operated on the binary image, and the desired smooth air-water interface line is obtained.

Offset Correction
Slight offset (hover precision) is inevitable for UAV capturing video, which will change the acquisition area and the measurement section coordinates and affect the recognition accuracy [29].Therefore, we consider measurement errors that are caused by the UAV offset, and track the real-time coordinates of the correction point, examine the coordinate offset between the current frame image, and the correction point in the first frame image.Also, the UAV offset is corrected, and the UAVi-fmwl is modified.Figure 8 shows the schematic map of offset correction, and the specific process steps are as follows: (1) Select the area containing the calibration point (J) as the ROI_b (to distinguish the aforementioned ROI).(2) Identify the calibration point (J) in the first frame ROI_b, and calculate its centroid coordinates (X J0 , P J0 ), which is considered as the base coordinate for the offset correction in the subsequent ROI_b.(3) Identify the centroid coordinates (X Ji , P Ji ) of the calibration point in the ROI_b of ith frame image.(4) Calculate the difference (∆X, ∆P) between the calibration point coordinates and the base coordinates in the ROI_b of ith frame image, where ∆X = X Ji − X J0 , ∆P = P Ji − P J0 .

Water Level Identification
The following method is used to obtain the W point actual elevation.On the vertical reference line (water level measuring section) of the horizontal pixel coordinate X c , whether the gray value of each pixel is 0 is determined from the bottom of the line to the upper (the gray value of water and the wall are 255 and 0, respectively).When the gray value is 0, it means that the W point of the water surface is reached, and the pixel coordinate value of W point (X w , P w ) is obtained.Furthermore, the real pixel coordinate of W is (X w + ∆X, P w + ∆P) after UAV offset correction, and water surface real elevation Z w obtained by introducing P w + ∆P instead of P w in Equation (2).By calculating W elevation in each frame of the video in turn, the water surface elevation and surface fluctuation process of the measurement section can be obtained.When the last frame of video is recognized, the maximum water level, average water level, and minimum water level in the collection period are calculated.

Application Assessment of UAVi-fmwl
Three cases were conducted to test the UAVi-fmwl applicability.The water level offset displacements that are caused by UAV drift in each frame are traced.Figure 9 shows the correction point coordinate trajectories of three cases (30 s, 300 frames), which are also on behalf of UAV drift trajectories.The UAV drift trajectories present obvious randomness under the influence of UAV hover stabilization precision, operator control skill and external environment, e.g., atomization wind that is caused by flooding flow splitting and energy dissipation [30].Table 1 shows the statistical parameters of UAV offset displacements of three cases, i.e., the average offset displacement and max offset displacement.Both offset parameters increase with spillway flooding discharge (Q), which is always positively correlated with the atomization wind speed [31].The Max offset displacement is 140.293cm in Case 3.  The water level offset displacements that are caused by UAV drift (Figure 9) in each frame are corrected over time using method in Section 2.4.3.Subsequently, water level in each frame is obtained using method in Section 2.4.4.The water level fluctuation time series are plotted in Figure 10.In order to check the reliability of the measurement technology, the water level time series of artificial recognition (AR) and UAV calculation before offset correction (UAVi-fmwl: BC) are also plotted.Results showed that the water level fluctuation data that was obtained by UAV is greatly deviated from the artificial recognition data before the UAV offset correction (UAVi-fmwl: BC), and the water level fluctuation data is in good agreement with the artificial recognition water level data after the UAV offset correction (UAVi-fmwl: AC).Furthermore, consistency analysis and linear regression results between artificial recognition data and UAVi-fmwl calculated data are plotted in Figure 11.The regression coefficient (R) between AR data and UAVi-fmwl: BC data decreases with spillway flooding discharge.It is obvious that the consistency of artificial recognition data and UAVi-fmwl calculated data after offset correction is much better than artificial recognition data and UAVi-fmwl calculated data before offset correction (Figure 11).Their probability density distributions (P) of comprehensive data of the three cases are presented in Figure 12.Detailed comparison results of their probability density distributions show that the artificial recognition data and UAVi-fmwl calculated data before offset correction has poor consistency, especially for the relatively larger water level elevation groups.On the contrary, the artificial recognition data and UAVi-fmwl calculated data after offset correction has relatively good consistency, which indicates that the proposed method for offset correction of the UAV is reasonable.In addition, the artificial recognition data has obvious data drift, and the continuity of the data series is poor, which is mainly caused by manual error (Figure 10a).By contrast, water level continuity that was obtained by UAVi-fmwl: AC is better than the artificial recognition results.Furthermore, the UAVi-fmwl image processing for each frame is about 0.2 s and the data acquisition efficiency is much better than artificial recognition.Therefore, the newly developed unmanned aerial vehicle imagery based technology for field measurement of water level has good reliability and progressiveness.
It should be pointed out that UAVi-fmwl is not a real-time monitoring system presently.Furthermore, the water level measurement site should provide an environment to guarantee B 1 , B 2 , and W located at one straight line (Figure 5).However, if there is no wall as this study to set B 1 , B 2 , but the measurement site is suitable for driving a pile or pulling a steel wire (one end with ballast sink to the riverbed, another end is tired to river bank), the pile or steel wire marked with B 1 , B 2 are also feasible for UAVi-fmwl.

Preliminary Application of UAVi-fmwl
Water level of the plunge pool in seven cases of spillway flooding discharge was measured using UAVi-fmwl.The time series of water level in each working condition is shown in Figure 13.There are some instantaneous water level crosses between adjacent flooding discharges, however the total water level is positively correlated with flood discharge.The statistical water levels (maximum, average, and minimum values) of each flooding discharge condition are shown in Figure 14.Three statistical water levels are all positively correlated with flooding discharges.Disparity between maximum water level and minimum water level increases with discharge, which reveals that the water fluctuation is gradually getting more intense with the stronger interaction of high speed velocity flooding flow and plunge pool water body [32].
In order to check the sidewall top elevation design, the regression relations of three statistical water levels and flooding discharges are also plotted in Figure 14, and their regression equations are calculated, as: Z max = 0.0023Q + 1307.9 Z ave = 0.0017Q + 1307.5.
Z min = 0.0014Q + 1307.2 (5) where Z max is maximum water level elevation, Z ave is average water level elevation, Z min is minimum level water elevation, and Q is spillway flooding discharge.Flow in rivers with relative regular form and constant boundary can be approximated as uniform and steady, and many universal theoretical and empirical equations between Q and water depth (h) have been proposed, e.g., the classical Q-h relation Equation ( 6) based on Manning equation and Chezy equation for a rectangular cross-section river [33,34].
where n is Manning's coefficient of the river, b is river width, i is the river slope, and the relationship between Q and h is nonlinear.
In this study, the research location is located at the downstream of spillway.Flow spraying out from spillway exit with high speed (generally larger than 20 m/s, Figure 1), and dropping into the plunge pool, makes the flow extremely non-uniform and unsteady.In addition, the river boundary form of the research section is irregular, thus the relationship between Q-h is always not consistent with classical Q-h Equation ( 6), and this exclusive relationship is unknown until this special research in this study.
Based on the exclusive linear relationship between Q and h, and the sidewall top elevation of water level measurement section (B 1 : 1322.16m), the maximum allowable spillway flooding discharge 6200 m 3 /s can be calculated based on Equation (3) if the water surface fluctuation is considered.This value approximates to the 10% frequency flood discharge (6130 m 3 /s) of Miaowei hydropower station.The maximum allowable spillway flooding discharge of 8625 m 3 /s can be calculated based on Equation (4) if the water surface fluctuation is neglected, and this value approximates to the 2% frequency flood discharge (8570 m 3 /s) of Miaowei hydropower station.This result could provide reference for the operation and scheduling of Miaowei hydropower station during its flooding period.

Conclusions
Aiming at solving the limitations of current measuring instruments and methods for water level measurements in the field, we integrated UAV photogrammetry and image recognition technology, and developed a newly optical measuring technology to measure water level in the field, and constructed the corresponding measurement system, including UAV, airborne camera, plane wall, baffle or straight line, calibration points, correction point, and image processing software.
The UAVi-fmwl theory and implementation processes are as follows: (1) capture the video of water surface fluctuation processes, (2) dedicate image processing software orderly preprocess images separated from video captured by airborne camera, (3) segment the water body and background, (4) use the traversal algorithm to calculate the pixel coordinates of measurement section, and (5) obtain the actual water level at that time according to the conversion coefficient and the conversion relationship.Particularly, the UAVi-fmwl considers the offset error of UAV and then provides a UAV offset correction method.
The UAVi-fmwl was applied to water level measurement in the plunge pool downstream of the spillway of a hydropower station, and the results showed that the newly developed technology has good reliability, good progressiveness, and strong potential to monitor water level in the field environment.In addition, an operation and scheduling reference of the hydropower station is acquired based on the water level analysis results.
The UAVi-fmwl proposed in this study has the advantages of maneuverable and flexible UAV, high image recognition and analysis automation, high recognition accuracy, non-contact, low cost, and no requirement for water quality.It is suitable to water level and water surface fluctuation measurement in complex field environment (e.g., high and steep mountain slope, wide river, high-speed flow), especially for short-term water surface fluctuation and urgent water level change process measurement (e.g., dammed lake).This technology can also be applied to hydraulic model experiments and fluid surface fluctuation measurement of the oil industry and metallurgical industry.

Figure 4 .
Figure 4. General image of the unmanned aerial vehicle (UAV).

Figure 5 .
Figure 5. First frame image and related signs.

Figure 12 .
Figure 12.Probability density distribution of AR data and UAVi-fmwl data (three cases).

Figure 13 .
Figure 13.Time series of water surface fluctuations.

Figure 14 .
Figure 14.Relationship between discharge and statistical water level.

Table 1 .
Statistics of UAV offset displacements.