Computation of Wind Wave Flow Field with Moving Boundary Based on Image Processing

: Based on image processing technology, a solution to the interference of moving boundary in wind wave flow field calculation is proposed. Invariant background is extracted from image sequence by means of the minimum method, and the differences between image sequence and invariant background image are used to remove the invariant background of image sequence. The image segmentation threshold is determined based on maximum interclass variance method, and the scatter interference is removed by image filtering and morphological technology, to obtain the target image. Then the flow field is calculated by PIV technology and the results of the flow field before and after the boundary treatment are compared. The experimental results show that the accuracy and speed of flow field calculation are greatly improved after removal of moving boundary disturbance, and the results of wind wave flow field calculation accord with the motion mechanism of hydraulic wind wave.


INTRODUCTION
Being an important phenomenon often seen on the ocean, wind wave is the wave produced by the direct action of wind on water surface. During the movement, wind wave is exposed to momentum, energy and matter exchange and further causes water-induced flow field [1]. The generation, movement and breaking mechanism of wind wave constitute the focuses of sea wave research. In particular, the breaking mechanism of wind wave [2] is regarded as the key research area of ocean engineering.
The current studies on the movement and breaking process of wind wave with moving boundary have acquired its internal flow field by means of Particle Image Velocimetry (PIV) technology [3]. Sun Ying and Song Yongbo et al. [4] made use of the camera and laser to capture the movement and breaking process of wave and acquired the relationship between vorticity distribution and wave height characteristics and wave asymmetry by calculating the flow field and shear stress. Long Xiaojing [5] studied the changes of wave whirling and energy loss during the rolling up and breaking of oblique wave. Dai Qin [6] applied the PIV technology to study the turbulence structures of airfoil wake under various intrinsic mode. A.H. Techet [7] utilized the PIV technology to acquire the formation of breaking wave wake and concluded that the counter-clockwise vorticity was stronger at the air side of the boundary. The studies of Sang Ho Oh [8] demonstrated that vertical acceleration below the wave crest was close to the limit value 0.5 g (g refers to gravitational acceleration) as previously advised. Wang et al. [9] proposed PIV and Particle Tracking Velocimetry [10] (PTV) hybrid algorithm for two-dimensional flow field non-interference measurement. Above studies acquired some information on wave flow field through PIV, which supported the studies of the movement and breaking of wind wave to a certain extent.
However, when the PIV system is used to collect wave images, the violent changes of the wave form in the breaking wave zone as well as wave breaking [11], water turbulence [12] and vortex aeration [13] etc. will lead to the instability of the moving boundary of flow field, overexposure of collected images and other problems, making it difficult to accurately calculate the wave flow field and exerting great influence on the determination of wave model parameter.
Based on wavelet transform, Li [14] counted the characteristics of wind and wave and calculated the wave elements of various wind and wave states. Lv et al. [15] simulated the relationship between wind and wave and proved the interaction between wind and wave. Zhou et al. [16] analyzed the characteristics of wind wave field under cold-air outbreak, and considered that the wave parameters are consistent with the distribution of wind field. Lei et al. [17] studied the randomness, nonlinearity and energy dissipation in the process of wind wave breaking. Zhang [18] studied the theory of air sea boundary layer after wave breaking. All of the above studies have proved the instability of the wave breaking boundary and the influence of the wave boundary on the calculation of wave model parameter.
However, for the calculation of wind wave flow field, it is rare to analyze the influence of boundary interference on the overall flow field. The boundary interference is often ignored or assumed to be non-interference test, which is not consistent with the actual situation, so the flow field measured by PIV technology has a great deviation. Hence, this paper puts forward the idea to process the captured images of wind wave flow with moving boundary, remove the interference outside the wind wave flow field and improve the accuracy and speed of flow field calculation with moving boundary.

RESEARCH METHOD
Random waves can be considered as the superposition of the wave frequency, amplitude and phase of different linear waves, and correspondingly, the wave surface equation of random waves η(x, t) can also be regarded as the superposition of the wave surface equations of multiple linear waves as below: Similarly, the velocity potential function of random waves is: Under the boundary conditions of free surface dynamics, take the derivative of the velocity potential function to acquire the velocity field of random waves: where α i represents the amplitude of each component wave; k i stands for the wave number of each component wave; ε i suggests the initial phase of each component wave; w i indicates the circular frequency of each component wave that is subject to random variation; g is gravitational acceleration and d means water depth. The generation, movement and breaking of wave is a continuous process, in which the flow field below wave surface is evolving constantly. To study the evolution process and relevant hydrodynamic evaluation parameters, it is necessary to study the real-time changes of the flow field within water, and the PIV technology can be used to measure the instant changes of flow field within water, thus to obtain relevant parameters for the breaking of waves. However, due to the boundary interference caused by the sharp change in the breaking zone, the current PIV technology has errors in the measurement of transient flow field, especially the flow field near the boundary.
The research method of this paper is based on the background extraction technology and edge filtering technology. By removing the boundary interference, the PIV technology can meet the requirements of fine measurement of wind wave flow field. The details are as follows:

Select the Region of Interest (ROI) of the Image
Traverse sequence images captured and select the area around wind wave boundary of the image. The red line in Fig. 1 suggests the boundary of wind wave. The ROI to be processed shall be as small as possible but include all moving boundaries. By doing this, it can reduce the error of background extraction and meanwhile increase the computation speed.

Extraction and Removal of Invariant Background of the Image
In the captured images of wind wave in the wave flume, the laser or external light source will reflect on the water flume and therefore produce the invariant background, increasing the error of flow field computation based on the PIV technology. Many methods can be applied to extract the invariant background in the image, represented by the mid-value method, means method and Gaussian background extraction method. The mid-value method and means method acquire the invariant background image by calculating the median value and mean value of pixels of each coordinate in image sequence, so the invariant background image acquired shows a big error and too much information loss after image difference detection. The Gaussian invariant background extraction method believes that pixels follow normal distribution and determines the pixels of values, which is applicable to images exposed to great changes of light conditions and complex invariant background. The minimum value invariant background extraction is adopted in this paper. Considering the single invariant background in the images captured, the parts with a smaller gray value in the image belong to invariant background, and the parts with a larger gray value are considered as foreground. In this way, this method effectively protects the particle images (the brighter parts) in these images and extracts the invariant background images.
Take the first frame of the image sequence as the original background image B and the image size as m × n (m for row and n for column). Traverse the remaining image sequence in order, read the image I, compare it to each pixel of original image B and find the values based on the following formulas. Based on the invariant background image acquired, remove the invariant background from the original background with the following formula.

Extraction of Interference Region
The continuous and changing interference in wind wave boundaries cannot be removed through the invariant background. To remove the interference in wind wave boundaries, the interference region shall be firstly extracted. The OTSU method (maximization of interclass variance) is a method based on adaptive threshold [19]. The image is divided into the foreground target and background target by the gray value. The greater interclass variance between the two parts suggests the greater differences between the two parts of the image. When a part of one target is wrongly classified to the other part, the interclass variance between the two parts will increase. Therefore, the greater interclass variance between the two parts proves a better segmentation effect. In the image I, the segmentation threshold between the foreground target and the background target is T, the ratio of pixels of foreground target to all pixels is ω 0 , and the average gray value of the foreground target is μ 0 ; the ratio of pixels of background target to all pixels is ω 1 , and the average gray value of the background target is μ 1 . The average gray value of the image is μ, and its interclass variance is g. The width and height of the image are respectively M and N, the number of pixels with a pixel value smaller than T in the image is N 0 , and the number of pixels larger than T is N 1 . Therefore: Substituting Eq (11) into Eq. (12) acquires the equivalence Eq. (13). Obtain the maximum threshold of the maximum interclass variance through traversal.
Calculate the image I with the maximum interclass variance to obtain the threshold T 1 , and perform image threshold segmentation based on the threshold T 1 to acquire the image I m1 , as shown in Fig. 3.

Removal of Interference Region
The interference region extracted includes a small part of the target region. Hence in addition to the extraction of the interference region, the median filtering shall be used to remove that part of the target region [20,21]. The basic concept of median filtering is to substitute the median value of the point values neighborhood for the value of pixel sequence points of the image, in order to make the pixel value closer to the reality and then eliminate the isolated noise points. Make use of the filtering window to arrange the pixels in the window based on the pixel values in ascending or descending order and then obtain the median value of the sequence. Therefore, the twodimensional median filter output is: where I m1 and G 1 respectively refer to the image before and after the processing of interference region and W means a 2D template, which is generally determined according to the size of the isolated noise points. Fig. 4 shows the results of median filtering. Then the differences between the image I and image G 1 are used to acquire the image with interference removed I 1 , as shown in Fig. 5. Through above steps, part of the interference region has been removed, but a large part of interference region still exists. Hence, the OTSU method and median filtering shall be applied again to extract the interference region for the second time, and the image G 2 of interference region is extracted, as shown in Fig. 6. The differences between the image I 1 and image G 2 are used to obtain the image I 2 after the removal of interference region for the second time, as shown in Fig. 7.  It can be seen from Fig. 7 that after the removal of interference region for the second time, the majority of the interference region has been removed, leaving only the burr part of interference region. On this basis, morphological erosion is applied to processing [22].
where element(I'，j') refers to the template window. Image G 3 can be obtained after morphological dilation processing.
The differences between the image I 2 and image G 3 (as shown in Fig. 8) to obtain the burr image I 3 of the interference region, as shown in Fig. 9. Finally, acquire the target image G g by means of the differencing of image I 2 and I 3 , as shown in Fig. 10.

RESULTS AND DISCUSSIONS 3.1 Experimental Environment
This experiment was conducted in the wind wave water flume in the laboratory. With a length of 20 m, a width of 1 m and a height of 1 m, the wind wave water flume consists of the wave making system, circulating water system and air supply system. It can simulate irregular waves with a maximum height of 0.3 m and a wave cycle of 0.5 -3 s and also provide the maximum flow velocity of 0.5 m/s (with a water depth of 0.5 m) and the maximum wind velocity of 15 m/s. The experiment was carried out at the middle of the water flume of the lab, and the energy dissipation device was mounted at the outlet of the flume. The pre-processing algorithm mentioned above was applied and then the PIV technology was utilized to calculate the flow field. The system comprised the CCD camera (resolution of 400 × 10 4 px and a maximum acquisition frequency of 380 Hz), CW laser, image acquisition software and image post-processing software. The laser lighted at the bottom of the flume, as shown in Fig. 11.

Experimental Conditions
The experiment adopted a water depth of 0.45 m, a flow of 300 ~ 350 m 3 /h and a cross-section velocity of 0.2 m/s. The laser prism angle was 30 o and the distance between the prism and water flume bottom was 0.05 m. In order to demonstrate the effect under different working conditions, the experiment designed three different wind velocities corresponding to different heights and speeds of wind wave, as shown in Tab. 1. The acquisition frequency of the camera varied under different working conditions to assure the normal acquisition of the camera and avoid trailing and incomplete shooting. The three working conditions were respectively: wind velocity of 5 m/s, wind wave height of 0.05 m and the camera acquisition frequency of 150 Hz, acquiring 5000 images in total; wind velocity of 9 m/s, wind wave height of 0.1 m and the camera acquisition frequency of 350 Hz, acquiring 5000 images in total; and wind velocity of 14 m/s, wind wave height of 0.15 m and the camera acquisition frequency of 580 Hz, acquiring 5000 images in total.

Experimental Results
During the experiment, the greater wind velocity and the higher wind wave speed caused greater interference at the wind wave boundaries. Among the 5000 images acquired for each working condition, more than 90% were exposed to boundary interference. The method put forward in this paper could effectively remove boundary interference and successfully removed 98% of interference. Through the method of removing interference boundary proposed in this paper, the velocity accuracy of PIV calculation has been greatly improved, as shown in Tab. 2.  In Tab. 2, "before" refers to the calculation results of PIV before removing boundary interference, and "after" refers to the calculation results after adding the boundary interference removal algorithm proposed in this paper. It can be seen from Tab. 2 that after the boundary interference is removed, the accuracy of flow velocity is improved by 13.1% and the calculation speed is improved by 29.4% under condition A; Under condition B, the accuracy of flow velocity is increased by 15.2%, and the calculation speed is increased by 16.3%; Under condition C, the accuracy of flow velocity is increased by 11.7%, and the calculation speed is increased by 10.6%. This fully proves that the method proposed in this paper can greatly improve the precision measurement of PIV technology.Now the typical cases of the three working conditions are explained below. The figure below shows the comparison of the flow field measurement results before and after the removal of wind wave flow boundary interference. Fig. 12a and Fig.12b show the computation results under the working condition of A. The flow field here shows the results when the wind wave moves to the middle of the field of vision, and the boundary error area occupies approximately 23% of the total area. The computation results achieved after the removal of the interference show that in the flow field at the boundary layer, the velocity decreases from the middle to both sides, and a little whirlpool emerges at the center of the flow velocity field as a result of the joint forces of both the upper and lower parts of wind wave. Fig. 12c and Fig.  12d present the computation results under the working condition of B, where the flow field shows the results when the wind wave moves to the left of the field of vision. The boundary error area occupies approximately 21% of the total area. The computation results achieved after the removal of the interference suggest that the flow field at the boundary layer is moving downward and has a trend to move towards the left. Fig. 12e and Fig. 12f display the computation results under the working condition of C, where the boundary error area occupies approximately 28% of the total area. According to the results of the overall flow field distribution, the velocity field shows a trend to move to the right on the whole, which is consistent with the direction of the wind wave field.
According to the images before the removal of boundary interference, boundary interference exerts great influence on the computation of the boundary flow field. The over-exposure region of the interference image severely impacts the accuracy of PIV computation, as it affects not only the computation results of the region itself but also the computation results of neighboring regions. In this case, the calculation results of the boundary flow field partly show upward movement and partly suggest downward movement of boundary flow field, and present the flow field distribution out of order. Hence, the overall trend is wrongly judged based on the calculation of boundary flow field and the correct flow field cannot be acquired. By comparison, the flow field computation results after the removal of the interference accurately reflect the status of wind wave flow boundary.
As proved by the above experiment, the method proposed in this paper can remove the boundary interference in wind wave field images in an automatic and rapid manner, and therefore can save much work and effectively improve the accuracy of computation of flow field data.

CONCLUSIONS
(1) In view of the problem that the boundary interference affects the calculation accuracy when PIV technology is used to measure wind wave flow field, an image processing method is proposed to effectively remove the boundary interference. The experimental results show that the boundary interference has a great influence on the calculation of boundary flow field. After the boundary interference is removed, the accuracy of velocity calculation is improved by more than 10%, which accurately reflects the process of wind wave and current movement, and the calculation speed is also improved.
(2) The drawback is that this method needs to manually select the ROI of the wind wave boundary, so it can be combined with machine learning method to further study the automatic selection of the region. In the experiment, the wind wave flow field is wind-driven, which is affected by a single external factor. In the later stage, it is necessary to further verify the effectiveness of the proposed method in removing boundary interference when wave-making current and wind-driven current are superimposed.