## 2 Materials and Methods  
### Experimental Site  
One of the essential parts of a system that uses vision feedback to determine the behavior of fish in a breeding tank is the estimation of the water-flow velocity. Such studiescan be carried out by various image analysis methods, which, however, require verification with a calibrated water-flow meter used in experimental studies. To verify the suitability of individual methods of video sequence analysis for this purpose, experimental tests were carried out by recording video material for the determined values of water flows in a round tank (SDK RT 29-68 type). The experiments were initially carried out without the fish in the tank in order to prevent possible disturbance caused by their movements. Due to the fact that the water in the tank is never perfectly clean and transparent, visible small objects may appear on its surface, making it easier to estimate the flow velocity thanks to their tracking. Additionally, it may be useful to have fixed elements of the tank or other objects attached to it, or a reflection of the elements above the tank. The flow of water at different speeds causes visible undulations in the shapes of these objects, while in the case of small elements floating on the water surface, it is possible to estimate the flow velocity on the basis of tracking their movement. The experimental study was performed in a rainbow-trout farm located in Gamki in the northern part of Poland about 35 km from the Baltic Sea coast. The reference measurements were conducted using the electromagnetic water-flow meter MTF-10 and SonTek FlowTracker2 in the above-mentioned fish tank, as illustrated in Figure 1. Video acquisition took place using the color IP camera Dahua IPC-HFW2231T-ZS-27135-S2 typically applied in video surveillance and industrial monitoring systems. It is a varifocal IPC camera of the Lite series that records frames of video sequences with FullHD resolution (1920 \(\times\) 1080 pixels) at the speed of 25 or 30 frames per second. It has a two megapixel CMOS 1/2.8 inch Progressive Scan sensor with a sensitivity of 0.002 lux/F 1.5. It also has the option of using an additional illuminator in the form of 4 IR LEDs with a range of 60 m and an automatic ICR infrared filter. It has the built-in 2.7-13.5 mm lens with a viewing angle of 28-109 degrees and a motorized zoom with autofocus, which enables external, remote adjustment of the focal length level with the help of a built-in electric motor, and also automatically adjusts the sharpness level. The native format of data recording is Dahua's DAV, the camera also supports H.265+, H.265, H.264+ and MJPEG compression. The latter format, also referred to as Motion JPEG, may be used in the applications where a high compression ratio is not necessary, as in this case the video stream consists of a series of recorded frames compressed using a JPEG algorithm without using inter-frame information in the compression process. The housing has an IP67 tightness class, the camera supports 12 V DC or 48 V power supply using the Power over Ethernet interface (PoE 10/100 Base-T 802.3 af). Additional functionalities and advantages of the camera are the following technologies: 3D NR (noise reduction system that allows the image to be transparent in the event of changing signal levels, which protects the recordings against smudging), WDR (wide dynamic range--extended dynamic range, important in places with different lighting levels of the observed scene), BLC and HLC (back light compensation--important when the camera is directed towards a strong light source--and high lighting compensation to reduce the negative impact of point light sources, e.g., reflected in water), intelligent infrared lighting function and region of interest (RoI) limitation to minimize the size of saved files. Due to some limitations of the local conditions, the camera was mounted directly above the tank (about 1 m above the water surface), enabling the observation of a selected part of the tank.