Image processing technique for hydraulic application

. In this paper, we present techniques Surface Flow Image Velocimetry (SFIV) that is a practical extension of Particle Image Velocimetry method (PIV). In particular, this technique is to evaluate the behavior on the surface flow for complex flow. SFIV allows to measure complex surface velocity fields for engineering applications. The objective of this work was the application of the SFIV technique to determine the velocity fields and their hydraulic efficiency of grated inlet, making a comparison between the programs able to correlate images like Digiflow or PIVlab program.


Introduction
In general, the particle image velocimetry (PIV) method is a classic velocity meter through video cameras, where velocity fields can be obtained by following the definition of velocity u: where x is the displacement of a marker, located at x at time t, over a short time interval t separating observations of the marker images [1].
Surface Flow Image Velocimetry (SFIV) similar to the Particle Image Velocimetry (PIV) or laser anemometry, that may be used without the need of adding tracer particles to the flow, but following the perturbations of the surface flow as shapes of the vortices or wave flows as defined in [5], for these applications in surface flows local capillary waves, vortices or wakes as in the case of convective or shock induced flows, the vortex cores or the vortex filaments are needed to be able to follow in detail the lagrangian aspects of the flow. Very high-resolution cameras with high frame speeds are necessary, together with large computer capacity and the implementation of programs coupled to advanced image processing for fluid mechanics, such as Imacal, DigImage and DigiFlow [4,8].
Technique called Surface Flow Image Velocimetry (SFIV) was developed to obtain the velocity field from the image processing of the surface flow in the vicinity of the grated inlet [6,7]. The equipment for obtaining these images consists of a camera of high resolution and speed accompanied to a large computer where the image analysis was carried out through the application of the advanced image-processing program for fluid mechanics called Digiflow, developed by the Department of Applied Mathematics and Physical Theory, University of Cambridge and Dalziel Research Partners [2]. In addition, Digiflow is an open software developed for the community of research focus in the area of fluids mechanics and turbulence applications. In order to follow the same line of research and compare the results with Digiflow, we also used a free code for image processing called PIVlab developed by the University of Groningen in the Netherlands. [10,11], written in the mathematical language MATLAB. Considering that MATLAB language is a private code, but the company Matworks provide a special permission as open software for research community and student, for this reason, now a day is the more common program used in the universities for mathematics application and programming.

Experimental Set-Up
The experiment consists of fixed laboratory facilities such as grated inlet platform, 2 reflectors and a grate of study. Mobile installations as the high-resolution camera and speed connected to a large computer. The platform has dimensions of 5.5 m long and 4 m wide, with a working area of 1.5 m long and 3 meters wide in the vicinity of the grated inlet. The platform is able to modify its longitudinal slope between 0% to 10% and the transverse slope of 0% to 4% [5]. In addition, the maximum approach flow for the experiments is 200 l/s, as shown in Figure1.
In order to obtain high-resolution images of the order of 1280 x 1024 pixels with a capture rate of 150 frames per second, it was decided to place the artificial lighting with two reflectors of power of 500 and 1000 Watt located strategically to provide the best possible illumination in the area of study ( Figure 1). In addition, we painted the gray color the platform, which allowed us to see better the surface flow and avoid reflections. Finally, marks were made around the grate used as reference in the image.

Fig. 1. Area of study
The platform has dimensions of 5.5 m long and 4 m wide, with a working area of 1.5 m long and 3 meters wide in the vicinity of the grated inlet. The platform is able to modify its longitudinal slope between 0% to 10% and the transverse slope of 0% to 4% [5]. In addition, the maximum approach flow for the experiments is 200 l/s, as shown in fig. 2. In order to obtain high-resolution images of the order of 1280 x 1024 pixels with a capture rate of 150 frames per second, it was decided to place the artificial lighting with two reflectors of power of 500 and 1000 Watt located strategically to provide the best possible illumination in the area of study ( fig. 1). In addition, we painted the gray color the platform, which allowed us to see better the surface flow and avoid reflections. Finally, marks were made around the grate used as reference in the image.

Surface Flow Image Velocimetry
The Surface Flow Image Velocimetry (SFIV) technique allows the measurement of complex surface flows to obtain the field of velocities in engineering. This methodology has been developed using the physical model of grated inlet located in the Hydraulic Laboratory of the Unicersitat Politècnica of Catalonia BarcelonaTech. The Digiflow algorithm is a method of the synthetic schlieren type, which is a novel technique that gives us a qualitative visualization of the fluctuations of the densities of the frames, and has origin in the classical schlieren method and the moire fringe technique. It also allows us to get good visualization in large study domains [4]. The synthetic schlieren method has different approaches to measure flows within the Digiflow program, such as line refractometry, dot-tracking refractometry, and pattern matching refractometry [3]. The final method is based on PIV techniques and was the method of correlation and image analysis proposed in the SFIV technique with Digiflow. PIVlab is a free access PIV program developed in the MATLAB calculation platform, which allows us to have easier access to this tool. We must take into account that for the image processing using PIVlab, we used the same videos that were used for the analysis with the program Digiflow, only that, in this case, we must take into account that PIVlab does not accept video formats only sequence of fixed images, for this reason, we developed an additional code in MATLAB capable of decomposing videos into frames, which allowed us to introduce the sequence of images in the PIVlab. In MATLAB it is possible to generate the histograms of the digital videos, allowing to represent the frequency of intensity of each pixel and the form of the histogram. This is possible through a function within the tools developed in MATLAB, in this case the utility is "imhist". In fig. 2 and fig. 3, a comparison of the histograms was made when the platform is completely flat and with a longitudinal slope of 10% and transverse slope of 4%, and these graphs show the significant difference between the intensity values for different videos, which indicates that when we do not have slopes the intensity histogram is more widespread, while in extreme conditions of slope the intensities are accumulating around the mean value of 100. It is evident that this affects the recognition of flow patterns, being one of the reasons why the calculation algorithm must be powerful enough to be able to reproduce the velocity fields for different geometric combinations and approximation flowrates on the platform.

Results
After performing several tests with different PIV algorithms, it was finally possible to obtain the velocity fields for 24 different geometries and 5 approximation flows, in order to compare with the Digiflow code. The visualization of the video captured, and the flow approach around the grated inlet is how in the fig. 4. The velocity fields in the vicinity of the grated inlet are shown in fig. 5 with PIVlab code and fig.  6 using Digiflow program. Moreover, both algorithm show a good approximation of field velocities around the grated inlet, but the different is on the grated inlet, because Digiflow present better approximation in this area, but also it is not enough, because the holes of the grate represent a behavior more tri-dimensional.

Discussion
Considering that both analysis with different programs have different algorithms, but follow a procedure similar to particle velocimetry (PIV), in both cases the SFIV technique was applied for surface flow, without adding particles as tracers and validating the results with experimental data for the measurement of flowrate collected by the grated inlet. The proposed methodology can become a useful tool to understand the hydraulic behavior of the flow in the surroundings of a catchment of grated inlet where traditional measurement equipment has serious problems and limitations. Fig. 6. Field velocity. Longitudinal slope 10%. Trasnversal slope 4%. Digiflow program.
As for the difference of the calculation programs, we have noticed that the Digiflow presents us with more advanced options for the analysis and processing of images, since it is a specialized program for visualization of complex flows in fluids mechanics, and it allows us complete stream of videos. In contrast, PIVlab, it has the disadvantage that it is only possible to work with sequence of frames so we need to create a tool capable of decomposing the videos into frames, but at the same time, it is a public access tool written in a common calculation language like is the MATLAB.