Commit 8aab2615 authored by Vladimir's avatar Vladimir

Improved VF optimization + Added EC optimization for MO-TLD

parent 016b4c82
...@@ -1384,7 +1384,7 @@ public: ...@@ -1384,7 +1384,7 @@ public:
class CV_EXPORTS_W MultiTrackerTLD : public MultiTracker_Alt class CV_EXPORTS_W MultiTrackerTLD : public MultiTracker_Alt
{ {
public: public:
bool update(const Mat& image); bool update_opt(const Mat& image);
}; };
//! @} //! @}
......
...@@ -49,7 +49,7 @@ using namespace std; ...@@ -49,7 +49,7 @@ using namespace std;
using namespace cv; using namespace cv;
#define NUM_TEST_FRAMES 100 #define NUM_TEST_FRAMES 100
#define TEST_VIDEO_INDEX 7 //TLD Dataset Video Index from 1-10 #define TEST_VIDEO_INDEX 15 //TLD Dataset Video Index from 1-10 for TLD and 1-60 for VOT
//#define RECORD_VIDEO_FLG //#define RECORD_VIDEO_FLG
static Mat image; static Mat image;
...@@ -119,12 +119,12 @@ int main() ...@@ -119,12 +119,12 @@ int main()
//From TLD dataset //From TLD dataset
selectObject = true; selectObject = true;
Rect2d boundingBox1 = tld::tld_InitDataset(TEST_VIDEO_INDEX, "D:/opencv/TLD_dataset"); Rect2d boundingBox1 = tld::tld_InitDataset(TEST_VIDEO_INDEX, "D:/opencv/VOT 2015", 1);
Rect2d boundingBox2; Rect2d boundingBox2;
boundingBox2.x = 280; boundingBox2.x = 470;
boundingBox2.y = 60; boundingBox2.y = 500;
boundingBox2.width = 40; boundingBox2.width = 50;
boundingBox2.height = 60; boundingBox2.height = 100;
frame = tld::tld_getNextDatasetFrame(); frame = tld::tld_getNextDatasetFrame();
frame.copyTo(image); frame.copyTo(image);
...@@ -140,6 +140,7 @@ int main() ...@@ -140,6 +140,7 @@ int main()
std::cout << "!!! Output video could not be opened" << std::endl; std::cout << "!!! Output video could not be opened" << std::endl;
getchar(); getchar();
return; return;
} }
#endif #endif
...@@ -193,12 +194,14 @@ int main() ...@@ -193,12 +194,14 @@ int main()
else else
{ {
//updates the tracker //updates the tracker
if (mt.update(frame)) if (mt.update_opt(frame))
for (int i=0; i < mt.targetNum; i++) {
rectangle(image, mt.boundingBoxes[i], mt.colors[i], 2, 1); for (int i = 0; i < mt.targetNum; i++)
rectangle(frame, mt.boundingBoxes[i], mt.colors[i], 2, 1);
} }
} }
imshow("Tracking API", image); }
imshow("Tracking API", frame);
#ifdef RECORD_VIDEO_FLG #ifdef RECORD_VIDEO_FLG
outputVideo << image; outputVideo << image;
...@@ -210,7 +213,7 @@ int main() ...@@ -210,7 +213,7 @@ int main()
double t1 = (e2 - e1) / getTickFrequency(); double t1 = (e2 - e1) / getTickFrequency();
cout << frameCounter << "\tframe : " << t1 * 1000.0 << "ms" << endl; cout << frameCounter << "\tframe : " << t1 * 1000.0 << "ms" << endl;
waitKey(0); //waitKey(0);
} }
} }
......
This diff is collapsed.
...@@ -54,7 +54,7 @@ namespace cv ...@@ -54,7 +54,7 @@ namespace cv
double posteriorProbability(const uchar* data, int rowstep) const; double posteriorProbability(const uchar* data, int rowstep) const;
double posteriorProbabilityFast(const uchar* data) const; double posteriorProbabilityFast(const uchar* data) const;
void prepareClassifier(int rowstep); void prepareClassifier(int rowstep);
private:
TLDEnsembleClassifier(const std::vector<Vec4b>& meas, int beg, int end); TLDEnsembleClassifier(const std::vector<Vec4b>& meas, int beg, int end);
static void stepPrefSuff(std::vector<Vec4b> & arr, int pos, int len, int gridSize); static void stepPrefSuff(std::vector<Vec4b> & arr, int pos, int len, int gridSize);
int code(const uchar* data, int rowstep) const; int code(const uchar* data, int rowstep) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment