## 3 Discussion of the Experimental Results  
Calculation of the individual flow maps was made with the use of the three methods considered in the paper: Horn-Schunck, Farneback and Lucas-Kanade. Since all calculations were made for the recorded video sequences, the results obtained for individual pixels were averaged. Sample results obtained with the use of the three above-listed methods for two exemplary water-flow velocities are illustrated in Figure 5. All the presented flow maps demonstrate the highest values of detected optical flows for the reflections of several elements located above the tank visible on the water surface (wooden roof boards, electric extension cord, camera). Therefore, further analyses related to determining the flow characteristics were carried out for the central parts of the visible area. Nevertheless, it is worth noting that the presence of reflections on the water surface of solid elements of the structure located above the tank is in fact beneficial for the methods applied to determine the optical flows. As noticed on the presented flow maps, the flow rates shown in the images did not always follow expectations, which is well-visible, especially for the LK method. However, in this case, the application of the Farneback method yielded water-flow estimates more in line with the predictions. To improve the accuracy of the flow estimation, providing a highly linear correlation with the velocities measured with an electromagnetic flow meter, a set of features determined based on the obtained flow-velocity maps for the central parts of the scene was selected. The goal of the application of these features is the efficient utilization of the visual feedback for the detection of changes in the water-flow values based on the continuous analysis of the video sequence. Thanks to such an approach, the detection of some failures of, e.g., a pump or flow meter (significant non-compliance of the value determined using the video sequence analysis with the values from the flow meter) would be possible. Ultimately, after calibrating the system, it is also possible to use the proposed vision approach for fish-farming tanks in situations when an installation of a water-flow meter is impossible. The achieved relationship, based on a non-linear combination of the three features with the fitting curves obtained for the linear and quadratic functions, is shown in Figure 6. The features used in this combination, which ensure the Pearson's linear correlation coefficient greater than 0.9, are:  
* Squared entropy of the motion vectors map for the Farneback method (\(Ent_{F}^{2}\));
* Standard deviation of the motion vector map for the Lucas-Kanade method (\(std_{LK}\));
* Variance in the local entropy of the motion vector map for the Lucas-Kanade method (\(varEnt_{LK}\)). The final formula combining the three above features may be obtained using the optimization of the weighting coefficients, finally leading to the following expression:  
\[Est_{flow}=A\cdot\left(Ent_{F}^{2}-12\cdot std_{LK}+varEnt_{LK}\right)+B \tag{8}\]  
where the parameters \(A=4.5\) and \(B=-0.4\) depend on the spatial configuration of the camera and the tank and might be changed according to needs. The dependence presented on the graph is approximately linear, however, one can notice an increase in the flow estimation error with the increase in its value. For this reason, the application of the proposed method in real conditions may be limited to lower flow values, for which the linearity of the relationship between the estimated and measured values is easily noticeable. However, additional verification and calibration is required if a different type of tank is used. Figure 5: Sample averaged optical flows obtained for two different water flow velocities: (**a**) Farneback method for 2.17 dm\({}^{3}\)/s; (**b**) Farneback method for 5.03 dm\({}^{3}\)/s; (**c**) HS method for 2.17 dm\({}^{3}\)/s; (**d**) HS method for 5.03 dm\({}^{3}\)/s; (**e**) LK method for 2.17 dm\({}^{3}\)/s; and (**f**) LK method for 5.03 dm\({}^{3}\)/s.