multipleObjectTracker2D
module use OpenCV
Python API. This module tracks objects, people, animals or something that the user needs in a image source. multipleObjectTracker2D
use OpenCV
region of interest to select the region or different regions that the user need to track selecting with a rectangle with user mouse input.
multipleObjectTracker2D
is a multipurpose tracker, that support different OpenCV
trackers like CSRT
, GOTURN
, KCF
...
The module can be configured in config.ini file, selecting the track you want to use, also image source size to be resize and improve speed.
By default use user webcam, but can be configured to use IP video source, local file or OpenCV
supported sources.
Also this module has support to use YARP
middleware, and can receive video source from YARP
port, the module receive in /multipleObjectTracker2D/img:i
port. Also publish in YARP
network in /multipleObjectTracker2D/img:o
processed image source.
Centroid tracked object coordinates is published in /multipleObjectTracker2D/data:o YARP
port.
The module can be used with or without YARP
dependences and configured in config.ini file.
Documentation available on docs.
- Running without YARP support
- Execute programs/multipleObjectTracker2D.py the detector.
- Select region to track and q to end selection or c to continue selecting multiple object to track.
- Running with YARP support
- Configure config.ini to select
yarp-send
andyarp-receive
if you want to useYARP
input, output or both of them. - Create or configure YARP Server.
- Connect
YARP
input port if needed.
yarp connect /videoSource /multipleObjectTracker2D/img:i
- Execute programs/multipleObjectTracker2D.py the detector.
- Select region to track and q to end selection or c to continue selecting multiple object to track.
NOTE:
- Video results are published on
/multipleObjectTracker2D/img:o
- Coordinate results are published on
/multipleObjectTracker2D/data:o
multipleObjectTracker2D
requires:
- Install pip3
- Install OpenCV and OpenCV Contrib
pip3 install opencv-python==3.4.7.28
pip3 install opencv-contrib-python==3.4.7.28
- Install YARP 2.3.XX+ with Python 3 bindings
Tested on: windows 10
, ubuntu 16.04
, ubuntu 18.04
, lubuntu 18.04
and kubuntu 20.04
.