Two Stage Hybrid Tracker

From ImageWiki

(Difference between revisions)
Jump to: navigation, search
(Trackerens API)
Line 16: Line 16:
   public:
   public:
     // Constructor and destructor
     // Constructor and destructor
-
     tsht(CvPoint initial_position, int radius=10, unsigned int num_samples=50);
+
     tsht(CvPoint initial_position, unsigned int radius=10, unsigned int num_samples=50);
     ~tsht();
     ~tsht();
   
   
Line 32: Line 32:
=== Constructor og destructor ===
=== Constructor og destructor ===
-
tsht(CvPoint initial_position, int radius=10, unsigned int num_samples=50);
+
Constructoren tager tre argumenter
-
~tsht();
+
* '''CvPoint initial_position
 +
* '''unsigned int radius
 +
* '''unsigned int num_samples
-
=== tsht::update ===  
+
-
status update(IplImage *propmap);
+
tsht tracker(cvPoint(100, 100), 5);
 +
 
 +
Destructoren siger sig selv.
 +
 
 +
=== tsht::update ===
 +
Denne funktion foretager selve trackingen. Argumentet '''IplImage *propmap
 +
 
 +
=== tsht::reinitialize ===
=== tsht::reinitialize ===
Line 42: Line 51:
   
   
=== tsht::object_position ===
=== tsht::object_position ===
-
CvPoint object_position();
+
=== tsht::object_size ===
=== tsht::object_size ===
-
float object_size();
+
=== tsht::get_samples ===
=== tsht::get_samples ===
-
const CvPoint* 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.
 +
 
 +
== Programskitse ==
 +
 +
#include "highgui.h"
 +
#include "tsht.h"
 +
 +
int main()
 +
{
 +
    CvCapture *cam = cvCaptureFromCAM(-1);
 +
    tsht tracker(cvPoint(100,100), 10, 150);
 +
 +
    while (cvWaitKey(4) == -1) {
 +
        IplImage *input = cvQueryFrame(cam);
 +
        IplImage *P = compute_propmap(input);
 +
        tracker.update(P);
 +
    }
 +
 +
    return 0;
 +
}
 +
hvor 'compute_propmap' er en funktion der beregner et sandsynlighedskort over objektets position.
 +
 
== Referencer ==
== Referencer ==

Revision as of 19:58, 9 July 2006

Personal tools