Commit 9aedc612 authored by Vladimir's avatar Vladimir

Added MO-TLD NN Classifier optimization on GPU

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