Commit 59b18dcf authored by Vladimir's avatar Vladimir

Added MO-TLD NN Classifier optimization on GPU

parent 23acf6d2
...@@ -120,11 +120,7 @@ int main() ...@@ -120,11 +120,7 @@ int main()
//From TLD dataset //From TLD dataset
selectObject = true; selectObject = true;
Rect2d boundingBox1 = tld::tld_InitDataset(TEST_VIDEO_INDEX, "D:/opencv/VOT 2015", 1); Rect2d boundingBox1 = tld::tld_InitDataset(TEST_VIDEO_INDEX, "D:/opencv/VOT 2015", 1);
Rect2d boundingBox2; Rect2d boundingBox2(470, 490, 50, 120);
boundingBox2.x = 470;
boundingBox2.y = 500;
boundingBox2.width = 50;
boundingBox2.height = 100;
frame = tld::tld_getNextDatasetFrame(); frame = tld::tld_getNextDatasetFrame();
frame.copyTo(image); frame.copyTo(image);
...@@ -133,13 +129,13 @@ int main() ...@@ -133,13 +129,13 @@ int main()
#ifdef RECORD_VIDEO_FLG #ifdef RECORD_VIDEO_FLG
String outputFilename = "test.avi"; String outputFilename = "test.avi";
VideoWriter outputVideo; VideoWriter outputVideo;
outputVideo.open(outputFilename, -1, 30, Size(image.cols, image.rows)); outputVideo.open(outputFilename, -1, 15, Size(image.cols, image.rows));
if (!outputVideo.isOpened()) if (!outputVideo.isOpened())
{ {
std::cout << "!!! Output video could not be opened" << std::endl; std::cout << "!!! Output video could not be opened" << std::endl;
getchar(); getchar();
return; return 0;
} }
#endif #endif
...@@ -184,17 +180,17 @@ int main() ...@@ -184,17 +180,17 @@ int main()
{ {
//initializes the tracker //initializes the tracker
mt.addTarget(frame, boundingBox1, tracker_algorithm_name); mt.addTarget(frame, boundingBox1, tracker_algorithm_name);
rectangle(image, boundingBox1, mt.colors[0], 2, 1); rectangle(frame, boundingBox1, mt.colors[0], 2, 1);
mt.addTarget(frame, boundingBox2, tracker_algorithm_name); mt.addTarget(frame, boundingBox2, tracker_algorithm_name);
rectangle(image, boundingBox2, mt.colors[1], 2, 1); rectangle(frame, boundingBox2, mt.colors[1], 2, 1);
initialized = true; initialized = true;
} }
else else
{ {
//updates the tracker //updates the tracker
if (mt.update_opt(frame)) if (mt.update(frame))
{ {
for (int i = 0; i < mt.targetNum; i++) for (int i = 0; i < mt.targetNum; i++)
rectangle(frame, mt.boundingBoxes[i], mt.colors[i], 2, 1); rectangle(frame, mt.boundingBoxes[i], mt.colors[i], 2, 1);
...@@ -204,7 +200,7 @@ int main() ...@@ -204,7 +200,7 @@ int main()
imshow("Tracking API", frame); imshow("Tracking API", frame);
#ifdef RECORD_VIDEO_FLG #ifdef RECORD_VIDEO_FLG
outputVideo << image; outputVideo << frame;
#endif #endif
......
This diff is collapsed.
...@@ -129,7 +129,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox) ...@@ -129,7 +129,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
if (i == 1) if (i == 1)
{ {
if (!ocl::haveOpenCL()) if (ocl::haveOpenCL())
DETECT_FLG = tldModel->detector->ocl_detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize()); DETECT_FLG = tldModel->detector->ocl_detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize());
else else
DETECT_FLG = tldModel->detector->detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize()); DETECT_FLG = tldModel->detector->detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize());
......
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