Skip to content

Commit

Permalink
Moved tracking functionality to TLD class
Browse files Browse the repository at this point in the history
  • Loading branch information
alantrrs committed Jun 10, 2011
1 parent 3b907dd commit c4b6177
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/TLD.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <opencv2/opencv.hpp>
#include <LKTracker.h>

class TLD{
private:
cv::PatchGenerator patchGenerator;
cv::FernClassifier classifier;
LKTracker tracker;
public:
TLD();
void init(const cv::Mat& frame1,const vector<cv::Point2f> &points1);
void track(const cv::Mat& img1, const cv::Mat& img2,const vector<cv::Point2f> &points1, vector<cv::Point2f> &points2);
//void detect(const cv::Mat& frame, vector<cv::Point2f> &detected_pts);
};
33 changes: 33 additions & 0 deletions src/TLD.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* TLD.cpp
*
* Created on: Jun 9, 2011
* Author: alantrrs
*/

#include <TLD.h>
using namespace cv;

TLD::TLD()
{
//patchGenerator(0,0,30,true,0.8,1.2,-CV_PI/2,CV_PI/2,-CV_PI/2,CV_PI/2);
}

void TLDK::init()

void TLD::track(const Mat& img1, const Mat& img2,const vector<Point2f> &points1, vector<Point2f> &points2){
//Frame-to-frame tracking with forward-backward error cheking
tracker.trackf2f(img1,img2,points1,points2);
}

/*
void TLD::generate(){
Mat warpbuf, warped;
Mat matM(2, 3, CV_64F);
RNG& random_ng = theRNG();
patchGenerator.generateRandomTransform(Point2f(), Point2f(), matM, random_ng);
patchGenerator.warpWholeImage(last_gray, matM, warpbuf, warped,0, random_ng);
imwrite("warped.jpg",warped);
}
*/

0 comments on commit c4b6177

Please sign in to comment.