This project implements automatic eel tracking in sonar underwater videos using OpenCV. Each region potentially corresponding to an eel is assigned a unique ID and highlighted with a blue contour. When the region is confirmed as an eel, a green bounding box appears around it, and its trajectory is recorded in a CSV file. The algorithm combines background subtraction (MOG2), contour filtering, and centroid-based tracking to detect and track eels over time.
Clone the repository:
git clone https://github.com/nellbru/eel-tracking-opencv.git
cd eel-tracking-opencvRun the executable and provide the video path:
.\eel_tracking.exe <video-file>The visualization shows the input video where each potential eel is outlined in blue and assigned an ID. When a region is confirmed as an eel, a green bounding box appears around it with the label “Anguille” and its trajectory is recorded in a CSV file. Console updates also display the frame processing progress. The algorithm is robust to slow movements and partial occlusions, and each eel is confirmed only after several consecutive frames to reduce false detections.
The algorithm is robust to noise and slow movements. Each eel is confirmed after several consecutive frames to reduce false detections.
eel-tracking-opencv/
├─ Videos/ # Input videos
├─ Results/ # Results examples
├─ docs/ # Documentation assets
├─ eel_tracking.cpp # Tracking algorithm
├─ eel_tracking.exe # Precompiled executable (Windows)
├─ CMakeLists.txt # Visual Studio project configuration
├─ opencv_world4120.dll # OpenCV library dll
├─ .gitignore # Git ignore rules
├─ LICENSE # Project license
└─ README.md # Project documentation
- Windows 10/11 (64-bit)
This project is licensed under the terms of the LICENSE file.