An Automatic Detection Algorithm of River Surface Velocity Estimation

In the 21st century, we are deeply impacted by global warming and extremely climate change. Meanwhile, relative organizations around the world carry out disaster prevention research. Since along with the tendency to enhance disaster occurred, the number of relevant monitoring system is used along with the growth of the field of disaster prevention. However, there are several limitations in the system of conventional monitors. For example the traditional monitor system usually needs people to keep an eye on those disasters, which makes the changes of disasters cannot be passed instantly and correctly. This paper will propose a set of image algorithms for disaster analysis detection technology. Through the non-contact measurement mode, analyze information of rivers in Taiwan and extract crucial information of river surface velocity in hydrological disaster prevention. With driftwood in rivers, bubble waves, swirling waves and other changes of images, using Retinex theory and correlation with related technical principles of the application, it will overcome the interference effect of light and shadows in harsh environments. This mode can also correctly estimate instantaneous surface velocity of the river, and through experiment of several images information to verify the river surface velocity by the instrument in the same time, confirmed the development of this system has its value and reliability. It is expected to achieve effectiveness of real time information detection and automatic notification system of disaster prevention.


Introduction
In recent years, under the influence of global extreme climate change, extreme rainfall patterns and constantly changing disaster scale, making the area around Taiwan and urban district cannot achieve ideal drainage and dredging in a short time, which causes floods. In order to prevent extreme rainfall and subsequent disaster caused by the expansion of the downstream area, monitoring changes of river velocity and river flow has become one of the major natural disaster prevention tasks.
In general, in hydrological observation technologies, river velocity and river flow are important hydrological information. River flow is mainly based on the hydrological analysis of water level, river velocity and river flow curves and calculations, but such method will cause large error to measured data when it is applied during the flood. The breaking surface is affected by the scouring and silting of river, which makes the measurements a difficult job. In the same manner, it is difficult to obtain an accurate average of velocity measurement. However, the monitoring instrumentation for the velocity of water level in the flow use contact tools most, including the traditional use of helical flow meter or buoy method, which assumed that the vertical velocity distribution of river velocity to meet certain laws, such as power-law, logarithmic law and other velocity formula [1][2].
In the non-contact measuring instrument, one of common image measurements of river surface velocity analysis is particle image velocimetry (PIV), which estimates velocity gradient distribution in the target area by the image analysis techniques, widely applied in research of flume velocity flow field of laboratory scale. But for the application of river basins in the field, it is still easy to be limited by natural factors such as the scale of the space sites, river reflection and weather, which makes the analysis and calculation of water surface velocity measurement not ideal at all [2][3][4][5].
Therefore, the paper is to improve the limitation and damage caused by the traditional contact and non-contact instrument during the practice of engineering measuring equipment. In this paper, monitoring photographic equipment set up in the river are used to capture images of surface water through continuous monitoring, in order to carry out river ripple analysis, image correction, object tracking, image recognition and other technology integration, research and develop image surface velocity estimation system.

Methods
Automatic monitoring system mainly utilizes digital image analysis technology for disaster-related information measurement and interpretation. And during the information estimation of the river velocity, the primary problem faces the harsh and changeable outdoor environment, because image-related monitoring instruments are easy to be influenced by dramatic changes of ambient light. If only use traditional Gaussian mixture model background algorithm [6], we cannot effectively extract real-time information about changes of river velocity. In order to overcome the interference of above-mentioned environmental factors and estimate the river velocity accurately, this paper proposed and implemented a set of application of image analysis on river surface velocity detection system structure. The structure can be divided into four parts, including: image enhancement and calibration, the foreground moving targets detection, targets recognition and tracking, and surface velocity estimation of pixel transformation. And the process of system architecture has shown in Figure 1 below.

Image Enhancement and Calibration
Generally, when obtaining the related images of surveillance camera, the erection mode, imaging principles and shooting techniques will cause geometric distortion. Moreover, monitoring images are usually limited to the environment, climate change and light interference, so the use of several co-related calculus can carry out camera calibration and monitoring image enhancement, as Figure 2 shown.  First, images must be calibrated in order to obtain relevant 3D images information from 2D images, by shooting three-dimensional checkerboard, to obtain relevant intrinsic parameter and extrinsic parameter. The intrinsic parameters are the transformation between the image coordinate system and the camera coordinate system, while the external parameter represents the transformation between the camera coordinate system and the world coordinate system. Through the projection mapping relationship matrix, each corresponding point there will have two corresponding formulas, like the following formula (1) and (2) A desire to convert the homography coefficient, the actual coordinates of a known point transformation required by at least four or more, such as formula shown in (3) [7].
After completion of the camera geometric calibration, it requires follow-up image enhancement through Retinex theory. This color theory is proposed by Edwin Land in 1971, which proposed an image enhancement method from theory on the basis of color constancy. According to the Retinex theory, the brightness of the image is composed of two coefficients: the illumination and reflection. Thus, the human visual images will transfer with different light wavelengths and frequencies change, but the color of the object is determined by the frequency and intensity of reflection of light. As shown in Figure 3   Suppose a two-dimensional image function represents the intensity value is proportional to the spatial coordinates of the actual source of the radiation energy, so the function must have a non-zero value, and limited. Function can represent two components: illumination and reflection, which represent the ambient illumination light on the object reaction, reflection brightness of the object itself, and are labeled ( , ) L x y and ( , ) R x y , while the product of two functions is expressed as ( , ) F x y , as (4) shown in formula.
To reduce the impact of changes in light and convenient matrix numerical calculation, it will be the formula (4) take the log can be calculated by the formula (5). log( ( , )) log( ( , )) log( ( , )) F x y L x y R x y = + However, the incident light may directly determine an image pixel dynamic range which can be achieved, while the reflective object determines the intrinsic features of the image. The purpose of using Retinex theory is to obtain the reflective properties of the target object from the image, which excludes shadows and light caused by waves, and has reached the goal of image enhancement. As shown in Figure  4. Figure 4 is image enhancement from the Retinex calculation, and then through the HSV color space automatic threshold, the results show that it can effectively suppress noises generated by light and shadow of waves in the original river image, also retaining characteristics of drifting objects. Meanwhile, this algorithm can quickly get foreground information image.

Foreground Moving Targets Detection
The second part is moving target detection, through image pre-processing based on image information provided by monitoring system, including methods such as image calibration and image enhancement. At the same time, since the image is often disturbed by Gaussian noises in practical application, so the background image data will be extracted based on robustness Gaussian mixture model [6]. As Figure  5 shown: foreground moving targets detection. Gaussian mixture model (GMM), which is the main concepts of each image pixel statistics, establishes k Gaussian distributions for changes in pixel value of each point. According to establishment based on each point of the k pixel mixed Gaussian distribution, determine whether the pixel is a moving object and update background information. Since Gaussian mixture model has robustness for dynamic background and illumination changes, it is regarded as one of important ways to split the foreground and background. Gaussian mixture formula has defined the most important three main parameters, including mixture weights, mean vector and covariance matrix. Each pixel should be described by the following parameters. As shown in the formula (6)  , , , N n X X X X =  , is distributed into N-dimensional space, the similarity of GMM represents as the following formula (7) and (8): After several iterations of convergence, the parameters grouping, the center value and variance are the initial numbers of Gaussian mixture model. After calculation above, if pixel meets the condition, it is the background pixels. Otherwise it belongs to foreground pixels.

Target Recognition and Tracking
The third part is targets recognition and tracking. Though Gaussian mixture model constantly updates the information of background and foreground, the system extracts the moving object to reach the multi-target tracking. Hence it obtains the relationship of the maximum displacement by the multi-target tracking, and gets the position of the displacement correlation maximization though the cross-correlation analysis. According to the statistic, the most possible positions which the targets move to are calculated in whole image. Then the biggest response peak with the displacement relationship of objects each other can be found. The main reason is avoiding the deviation which caused by changes of the drifting on the river. We define two continuous images, ( , ) f x y and ( , ) g x y , in continuous image sequence. Then its discrete correlation coefficient can be expressed as the formula (9) and (10) Wherein M and N are the original image size, and m and n are the amount of the displacement. Therefore, the calculation procedure is shown in Figure 6. Through two continuous images in continuous image sequence, the cross-correlation analysis function is calculated in entire image and gets the peak value of the maximum amount of displacement. Then the displacement direction and position of the drifting object on the river and the corrugated information can be obtained.

Surface Velocity Estimation of Pixel Transformation
If the river velocity is estimated directly, it would be error and cannot accurately estimate the river velocity. Hence, with the placement on the image screen or the relevant feature points, and though several obvious feature points which are corresponding to different distances, the relevant information of the 3D real world coordinate would be obtained from 2D image. And Figure 7 will show the image scale reference feature points in tributaries of Wu River and linear quadratic fitting polynomial of pixel transformation real distance. number of all frames that objects move in continuous image sequence, like the formula (11) [9]. At the same time, we take every ten continuous data to calculate the mean value, V [9].

Results and Discussions
There are three main experimental results in this paper. First, the proposed algorithm compared with the traditional algorithms, the difference of the tracking result and the suppressive effect to light in outdoor would be discussed. Second, through the estimations of the actual river velocity in outdoor river environment, it is considered as the validation of the river velocity identification system. Meanwhile we use the velocimeter instrument to verify the robustness and the functionality of this system. There are four kinds of outdoor experimental river environment, including Wufeng ditch, tributaries of Taichung Wu River, Hsinchu Youluo River and Southern Region Water Resources Office Tai Po observation station of Taiwan [10]. Third, we use the formula to verify the experimental percent error of the river velocity by image estimation and discuss the experimental results.

The Proposed Algorithm Compared with Traditional Algorithms
In order to detect the foreground objects, the traditional 110 An Automatic Detection Algorithm of River Surface Velocity Estimation method of image tracking adopts the median algorithm or other methods to establish the background model. The main concept of the median algorithm is that after getting a section of continuous images, the median pixel value will be regarded as the background. However, the disadvantages of this background are easily influenced by light, shadows change and wave interference, as shown in Figure 8 and Figure 9. It is clear that this method is not useful to suppress the noise interference and make error for detecting the objects. As a result the proposed algorithm is more robust and reliable than other traditional algorithms in the outdoor environment and in field of hydrologic information detection.

Experiment Results
In order to verify the accuracy of image river surface velocity estimation, we use SVR400 instrument to measure actual river surface velocity. SVR400 velocimeter permit the estimation of its velocity range between 0-321km/h , and the accuracy of velocity is 0.1km/h ± . By using a handheld radio wave and Doppler principle, it can achieve the motion radial velocity measurement of the river surface. After verifying experimental data and results in four different cases inclusive of Wufeng ditch, tributaries of Taichung Wu River, Hsinchu Youluo River and Southern Region Water Resources Office Tai Po observation station [10], it prove that image analysis on river surface velocity estimation is provided with accuracy and promotability. However, limitations on space only show experimental results of Taichung Wu River and Tai Po Observation Station.
The Wu River is a river in the middle parts of Taiwan and flows through Taichung City, Changhua County, and Nantou County. It is the fourth largest river in terms of drainage area, and the sixth longest one in Taiwan. About tributaries of Taichung Wu River field experiment, which data sampling on October 11, 2015, the image resolution is 432 × 240 and the number of samples is 624. It happened to be a rainy day, so great amounts of many woods and branches are washed to river. In this case is mainly based on river rafting object tracking to estimate velocity. And we can know that river velocity measuring by instrument is 1.7 km/h or 0.472m/s. So tributaries of Taichung Wu River experiment data and multi-target tracking results, as shown in Figure 10 and Table 1.    Tai Po Observation Station is located at Zengwen Dam and which is on the Zengwun River. It is the third tallest dam in Taiwan, and forms the largest reservoir in Taiwan by volume. About Tai Po Station hit by Sudi Le typhoon field experiment [10], which data sampling on August 7 to 10, 2015, the image resolution is 720 × 480 and the number of samples are 1143. For inclement weather conditions, although the historical monitoring data did not appear obviously large-scale drift wood or other objects, it extracted waves and torrent features to estimate river surface velocity. And shooting the photographs which may be impacted by wind, rain and turbid stream causes unclear. In spite of only using historical video data, confirm river surface velocity via experiences judged by professionals of Southern Region Water Resources Office. And the professionals of Southern Region Water Resources Office preliminary view river surface velocity as 1.3 ~ 1.5m/s, describe in Figure 11 and shown Table 2.

Discussions
It was limited by the accuracy of the instrument or external impact during the experiment, in order to figure out that the experimental percent error between the river surface velocities of instrument measuring and using image analysis on river surface velocities estimation, we analyze experimental percent error, estimator of experimental error and valid data processing. Through computing percent error, we can get references of valid data. So actual value and theoretical value represents river surface velocity estimation by paper and river surface velocity measured by velocimeter respectively, such as the formula (12) [11].
After experimental percent error calculation, we can get that the percent error of Taichung Wu River data is 15%, and the percent error of Tai Po Observation Stations hit by typhoon data is 10%. According to the experimental percent error results, we can know that this paper proposes a set of image processing techniques of automatic river surface velocity estimation, which can make non-contact river surface velocity estimation detection more accurate and effective.

Conclusions
In this paper, through experimental results, it is difficult to control the changes in the actual environment of the river and the uncontrollable factors, such as the water shimmering reflections, severe shadow changing and etc. Therefore, compared with the traditional algorithm, there are several breakthroughs and innovations in this paper. First, this paper establishes the background information by using the Gaussian mixture model. Through the Retinex and HSV automatic threshold algorithm, the noises which are the water shimmering reflections and shadow will be filtered. Hence, it is effective to reach the purpose which tracks and detects the moving object. Second, the accuracy which is the estimation of the image river velocity in this paper will be verified by the real measurements and their values of the several actual cases. And the accuracy can be up to 85 -90%. Finally, this paper has completed the prototype of the image recognition system which is a non-contacting river velocity. In the future, it will be more immediate and reliable with the alarm announcement in the field of the flood and disaster prevention.