Two Stage Hybrid Tracker

From ImageWiki

(Difference between revisions)
Jump to: navigation, search
(tsht::reinitialize)
Line 1: Line 1:
-
Denne side beskriver hvorledes DIKU's implementation af ''Two Stage Hybrid Tracker (TSHT)'' kan benyttes. black-box'', hvilket betyder at interfacet beskrives, mens de algoritmiske detaljer udelades. Dog beskrives metoden ''meget'' kortfattet.
+
This page describes how DIKU's implementation of the ''Two Stage Hybrid Tracker (TSHT)'' can be used in C++. Here the tracker is described as a black-box. This means that only the programmers interface will be described, while algorithmic details aren't given. The tracking method is, however, ''very'' briefly described.
-
== Kort om trackeren ==
+
== Short algorithmic description ==
-
Trackeren er en hybrid mellem to anerkendte algoritmer til tracking, nemlig ''meanshift'' og ''partikel filtrering''.
+
The tracker is a hybrid between the two well-known tracking algorithms, ''the Meanshift'' and ''the Particle Filter''.
-
''Meanshift'' tracker, . Den eneste parameter ''meanshift. Som uddata giver ''meanshift'' position .  
+
''Meanshift'' is a simple and computationally efficient tracker, that (unfortunaly) often gets misled. The only parameter needed by the meanshift algorithm is the size of the object that is to be tracked. The output from the meanshift tracker is the object position and a measure of the object size.
-
''Partikel filteret'' . I forbindelse med tracking er hypoteserne objektets position. ''Partikel filteret'' . iteration at gode hypoteser har stor chance for at overleve, .
+
''The Particle Filter'' is a technique for hypothesis selection. In tracking a hypothesis is the object position. ''The Particle Filter'' weights each hypothesis so good hypothesises gets large weights and bad hypothesises gets small weights. In the next iteration of the algorithm hypothesises are selected at random, but large weighted hypothesises has a large chance of being selected. So, good hypothesises survive while bad hypothesises die.
-
''Two Stage Hybrid Tracker'' er som sagt en hybrid mellem disse to algoritmer. Dvs. at en serie ''meanshift'' trackerer afvikles parallelt og ''partikel filteret'' .
+
''The Two Stage Hybrid Tracker'' is a hybrid between these two algorithms. A series of ''Meanshift'' trackers are executed, and the ''Particle Filter'' selects which of these trackers should be used in the next iteration.
-
== Trackerens API ==
+
== The Tracking API ==
-
Trackeren implementeres gennem C++ klassen 'tsht' public interface
+
The tracker is implemented in the C++ class 'tsht' that has the following public interface
  class tsht {
  class tsht {
Line 20: Line 20:
   
   
     // The tracking functionality
     // The tracking functionality
-
     status update(IplImage *propmap);
+
     status update(IplImage *probmap);
     void reinitialize(CvPoint new_position, float uncertainty=10);
     void reinitialize(CvPoint new_position, float uncertainty=10);
   
   
Line 29: Line 29:
  }
  }
-
.
+
In the following, each of the public functions are described.
-
=== Constructor og destructor ===
+
=== Constructor and destructor ===
-
Constructoren tager tre argumenter
+
The object constructor takes three arguments
-
* '''CvPoint initial_position''' angiver objektets position frame.
+
* '''CvPoint initial_position''' contains the objects position in the first frame.
-
* '''unsigned int radius''' . ''2*radius + 1''.
+
* '''unsigned int radius''' informs the tracker about the size of the object. It is assumed that the object is a ''2*radius + 1'' by ''2*radius + 1'' square.
-
* '''unsigned int num_samples''' angiver antallet af partikler i partikel filteret. , .
+
* '''unsigned int num_samples''' is the number of particles in the ''Particle Filter''. Large values of ''num_samples'' gives a more stable tracking, but comes at the cost of increasing computationally demands.
-
''11x11'' objekt hvis startposition er i ''(100, 100)'':
+
The following code starts the tracking of an ''11x11'' object centered in ''(100, 100)'':
  tsht tracker(cvPoint(100, 100), 5);
  tsht tracker(cvPoint(100, 100), 5);
-
Destructoren siger sig selv.
+
The object destructor needs no explanation.
=== tsht::update ===
=== tsht::update ===
-
Denne funktion foretager selve trackingen. Argumentet '''IplImage *propmap''' er et sandsynlighedskort der beskriver objektets placering. Dvs. at der skal oprettes et billede hvor hver pixel beskriver hvor sandsynligt det er at objektet befinder sig i netop denne pixel. 8 bit . 255 , mens 0 .
+
This function does the tracking. The argument '''IplImage *probmap''' is a probability map that describes the object position. So, to use the tracker you need to create an image in which each pixel contains a value the describes how likely it is that the object is located in the pixel. It is assumed that the image is an 8 bit gray scale image. This means that it is higly likely that the object is in pixels with values of 255, and higly unlikely in pixels with values of 0.
-
Funktionen returner enten ''LOST_OBJECT'' eller ''OK'' .
+
The function either returns ''LOST_OBJECT'' or ''OK''.
=== tsht::reinitialize ===
=== tsht::reinitialize ===
-
Funktionen reinitialiserer trackeren. Objektets position ''new_position''. ''uncertainty'' position. .
+
This function reinitializes the tracker. The object position is set to ''new_position''.
 +
Large values of ''uncertainty'' means that the tracker isn't very certain on the position of the object. Usually this function is needed if the tracker no longer is able to find the object (''tsht::update'' return ''LOST_OBJECT'').
=== tsht::object_position ===
=== tsht::object_position ===
-
position.
+
This function returns the currently best estimate of the objects current position.
=== tsht::object_size ===
=== tsht::object_size ===
Line 57: Line 58:
=== tsht::get_samples ===
=== tsht::get_samples ===
-
Funktionen returnerer en pointer til et array af CvPoint's. Hver punkt beskriver en hypotese for partikel filteret. Typisk skal denne funktion ikke benyttes.
+
The function returns a pointer to an array of CvPoint's. Each point is a hypothesis in the Particle Filter. Usually you don't need to use this function.
 +
 
 +
== Program sketch ==
 +
A program using the tracker will often look something like this
-
== Programskitse ==
 
-
 
  #include "highgui.h"
  #include "highgui.h"
  #include "tsht.h"
  #include "tsht.h"
Line 71: Line 73:
     while (cvWaitKey(4) == -1) {
     while (cvWaitKey(4) == -1) {
         IplImage *input = cvQueryFrame(cam);
         IplImage *input = cvQueryFrame(cam);
-
         IplImage *P = compute_propmap(input);
+
         IplImage *P = compute_probmap(input);
         tracker.update(P);
         tracker.update(P);
     }
     }
Line 77: Line 79:
     return 0;
     return 0;
  }
  }
-
 
-
== Referencer ==
+
Here ''compute_probmap'' is a function that computes a probability map describing the objects position. To use the tracker you need to create this function.
 +
 
 +
== References ==
'''Hybrid Particle Filter and Mean Shift tracker with adaptive transition model'''<br/>
'''Hybrid Particle Filter and Mean Shift tracker with adaptive transition model'''<br/>
''Emilio Maggio og Andrea Cavallaro''<br/>
''Emilio Maggio og Andrea Cavallaro''<br/>
Acoustics, Speech, and Signal Processing, 2005. Proceedings. (ICASSP apos;05). IEEE International Conference on<br/>
Acoustics, Speech, and Signal Processing, 2005. Proceedings. (ICASSP apos;05). IEEE International Conference on<br/>
Volume 2, Issue , March 18-23, 2005 Page(s): 221 - 224<br/>
Volume 2, Issue , March 18-23, 2005 Page(s): 221 - 224<br/>
-
[http://www.elec.qmul.ac.uk/staffinfo/andrea/papers/icassp05_maggio_cavallaro.pdf Download som PDF]
+
[http://www.elec.qmul.ac.uk/staffinfo/andrea/papers/icassp05_maggio_cavallaro.pdf Download as PDF]

Revision as of 19:41, 8 August 2006

Personal tools