OpenCV, a portable video library for hosted (e.g. Linux, Windows etc) as well as specialized embedded systems (e.g. Raspberry Pi), has been around for decades and has hundreds of books and tutorials written for it.
Use functions to detect:
- difference between frame
- calculate the size (of fish)
- Tune to match size of fish and reduce false alarms
- movement of the 'detected block' (fish, as a group of pixels moving in the same direction)
- helps avoid false detection due to noise (floating leave, rubbish, etc.)
OpenCV has template matching and can detect different types of objects under good lighting conditions and pose. It may not work too well in natural setting in your case, but you can try and see.
OpenCV is a library, not a ready-made application. It is portable and works well in Linux, Windows and other operating systems. There are many high quality tutorials on the web as well as examples.
In all computer vision projects, the computer itself is only half of what matters. Camera, lighting, etc are very important, too. Select a suitable camera, focal length, lighting, etc to get the best possible image quality. If video is EASILY detected by human, computer may be able to do it (for vision, computer is less able than human, but, works 24 hours).
Raspberry Pi has many "tracking" or "counting" projects, such as detecting new people who have just entered a room (note some such projects use opencv some do not) or passed a line. Some examples from YouTube:
People Counter With OPENCV
Real time vehicle counting and velocity estimation using OpenCV
http://videolectures.net/icml2010_bradski_ocv/ [[author of a opencv book]]
There are companies selling complete packages for people/vehicle counting or vehicle classification (e.g. car, truck).
You can search YouTube further for demos such as this:
RIVA IP Cameras - People Counting Supermarket
Hope this helps.