iCub-main
Template Tracking with Particle Filter

This module expects a template from the following port /templatePFTracker/template/image:i in order to commence tracking.

Collaboration diagram for Template Tracking with Particle Filter:

This module expects a template from the following port /templatePFTracker/template/image:i in order to commence tracking.

This is a simple single-object tracker that uses a color histogram-based observation model. Particle filtering is a Monte Carlo sampling approach to Bayesian filtering.The particle filtering algorithm maintains a probability distribution over the state of the system it is monitoring, in this case, the state – location, scale, etc. – of the object being tracked. Particle filtering represents the distribution as a set of weighted samples, or particles. Each particle describes one possible location of the object being tracked. The set of particles contains more weight at locations where the object being tracked is more likely to be. The most probable state of the object is determined by finding the location in the particle filtering distribution with the highest weight.

# Libraries

YARP libraries and OpenCV

# Parameters

Command-line Parameters

The following key-value pairs can be specified as command-line parameters by prefixing – to the key (e.g. –from file.ini. The value part can be changed to suit your needs; the default values are shown below.

• from templatePFTracker.ini
specifies the configuration file
• context particleFiltering
specifies the sub-path from \$ICUB_ROOT/icub/app to the configuration file
• name templatePFTracker
specifies the name of the module (used to form the stem of module port names)

Configuration File Parameters

The following key-value pairs can be specified as parameters in the configuration file (they can also be specified as command-line parameters if you so wish). The value part can be changed to suit your needs; the default values are shown below.

• inputPortNameTemp /templatePFTracker/template/image:i
specifies the input port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter
• inputPortNameLeft /templatePFTracker/left/image:i
specifies the input port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter
• inputPortNameRight /templatePFTracker/right/image:i
specifies the input port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter
• outputPortNameLeft /templatePFTracker/left/image:o
specifies the output port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter
• outputPortNameRight /templatePFTracker/right/image:o
specifies the output port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter

outputPortNameLeftBlob /templatePFTracker/leftblob/image:o
specifies the output port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter

• outputPortNameLeftBlob /templatePFTracker/rightblob/image:o
specifies the output port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter
• outputPortNameTarget /templatePFTracker/target:o
specifies the output port name (this string will be prefixed by /templatePFTracker or whatever else is specifed by the name parameter Sends a Bottle list containing info on the tracking process: cog.x + cog.y + boundingBox.topLeft.x + boundingBox.topLeft.y
• boundingBox.BottomRight.x + boundingBox.BottomRight.y eg: (180.0 116.0 167.0 102.0 193.0 130.0)

• None

# Ports Created

Input ports

• /templatePFTracker
This port is used to change the parameters of the module at run time or stop the module.
The following commands are available

help
quit
Note that the name of this port mirrors whatever is provided by the –name parameter value The port is attached to the terminal so that you can type in commands and receive replies. The port can be used by other modules but also interactively by a user through the yarp rpc directive, viz.: yarp rpc /yuvProc This opens a connection from a terminal to the port and allows the user to then type in commands and receive replies.

• /templatePFTracker/template/image:i
• /templatePFTracker/left/image:i
• /templatePFTracker/right/image:i
Output ports
• /templatePFTracker
see above
• /templatePFTracker/left/image:o
• /templatePFTracker/right/image:o
• /templatePFTracker/leftblob/image:o
• /templatePFTracker/rightblob/image:o
• /templatePFTracker/target:o
Port types

None

None

# Tested OS

Linux: Ubuntu 9.10 and Debian Stable

# Example Instantiation of the Module

templatePFTracker –name tracker –context templatePFTracker –from templatePFTracker.ini