1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-21 06:11:09 +08:00

Added MO-TLD NN Classifier optimization on GPU

This commit is contained in:
Vladimir
2015-08-10 17:45:21 +09:00
parent b3636fe547
commit 9aedc612c8
3 changed files with 277 additions and 30 deletions

View File

@@ -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