Commit c743244f authored by Vladimir's avatar Vladimir

Warnings Fix #1

parent 36f8dc2b
...@@ -98,7 +98,7 @@ int main() ...@@ -98,7 +98,7 @@ int main()
// //
// "MIL", "BOOSTING", "MEDIANFLOW", "TLD" // "MIL", "BOOSTING", "MEDIANFLOW", "TLD"
// //
char* tracker_algorithm_name = "TLD"; const char* tracker_algorithm_name = "TLD";
Mat frame; Mat frame;
paused = false; paused = false;
......
...@@ -75,6 +75,7 @@ namespace cv ...@@ -75,6 +75,7 @@ namespace cv
bool MultiTracker::update(const Mat& image) bool MultiTracker::update(const Mat& image)
{ {
printf("Naive-Loop MO-TLD Update....\n");
for (int i = 0; i < (int)trackers.size(); i++) for (int i = 0; i < (int)trackers.size(); i++)
if (!trackers[i]->update(image, boundingBoxes[i])) if (!trackers[i]->update(image, boundingBoxes[i]))
return false; return false;
...@@ -130,7 +131,7 @@ namespace cv ...@@ -130,7 +131,7 @@ namespace cv
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
data = tracker->data; data = tracker->data;
data->frameNum++; data->frameNum++;
...@@ -236,7 +237,14 @@ namespace cv ...@@ -236,7 +237,14 @@ namespace cv
} }
//Debug display candidates after Variance Filter
////////////////////////////////////////////////
Mat tmpImg = image;
for (int i = 0; i < (int)debugStack[0].size(); i++)
//rectangle(tmpImg, debugStack[0][i], Scalar(255, 255, 255), 1, 1, 0);
debugStack[0].clear();
tmpImg.copyTo(image);
////////////////////////////////////////////////
return true; return true;
} }
...@@ -311,7 +319,7 @@ namespace cv ...@@ -311,7 +319,7 @@ namespace cv
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
//Optimized variance calculation //Optimized variance calculation
bool varPass = (windowVar > tld::VARIANCE_THRESHOLD * *tldModel->detector->originalVariancePtr); bool varPass = (windowVar > tld::VARIANCE_THRESHOLD * *tldModel->detector->originalVariancePtr);
...@@ -334,13 +342,14 @@ namespace cv ...@@ -334,13 +342,14 @@ namespace cv
} while (size.width >= initSize.width && size.height >= initSize.height); } while (size.width >= initSize.width && size.height >= initSize.height);
//Encsemble classification //Encsemble classification
//e1 = getTickCount();
for (int k = 0; k < (int)trackers.size(); k++) for (int k = 0; k < (int)trackers.size(); k++)
{ {
//TLD Tracker data extraction //TLD Tracker data extraction
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
for (int i = 0; i < (int)varBuffer[k].size(); i++) for (int i = 0; i < (int)varBuffer[k].size(); i++)
...@@ -376,13 +385,14 @@ namespace cv ...@@ -376,13 +385,14 @@ namespace cv
} }
//NN classification //NN classification
//e1 = getTickCount();
for (int k = 0; k < (int)trackers.size(); k++) for (int k = 0; k < (int)trackers.size(); k++)
{ {
//TLD Tracker data extraction //TLD Tracker data extraction
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
npos = 0; npos = 0;
nneg = 0; nneg = 0;
...@@ -505,7 +515,7 @@ namespace cv ...@@ -505,7 +515,7 @@ namespace cv
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
//Optimized variance calculation //Optimized variance calculation
bool varPass = (windowVar > tld::VARIANCE_THRESHOLD * *tldModel->detector->originalVariancePtr); bool varPass = (windowVar > tld::VARIANCE_THRESHOLD * *tldModel->detector->originalVariancePtr);
...@@ -528,13 +538,14 @@ namespace cv ...@@ -528,13 +538,14 @@ namespace cv
} while (size.width >= initSize.width && size.height >= initSize.height); } while (size.width >= initSize.width && size.height >= initSize.height);
//Encsemble classification //Encsemble classification
//e1 = getTickCount();
for (int k = 0; k < (int)trackers.size(); k++) for (int k = 0; k < (int)trackers.size(); k++)
{ {
//TLD Tracker data extraction //TLD Tracker data extraction
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
for (int i = 0; i < (int)varBuffer[k].size(); i++) for (int i = 0; i < (int)varBuffer[k].size(); i++)
...@@ -570,13 +581,15 @@ namespace cv ...@@ -570,13 +581,15 @@ namespace cv
} }
//NN classification //NN classification
//e1 = getTickCount();
for (int k = 0; k < (int)trackers.size(); k++) for (int k = 0; k < (int)trackers.size(); k++)
{ {
//TLD Tracker data extraction //TLD Tracker data extraction
trackerPtr = trackers[k]; trackerPtr = trackers[k];
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr); tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction //TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel())); tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->model));
//Size InitSize = tldModel->getMinSize();
npos = 0; npos = 0;
nneg = 0; nneg = 0;
maxSc = -5.0; maxSc = -5.0;
......
...@@ -51,7 +51,7 @@ namespace cv ...@@ -51,7 +51,7 @@ namespace cv
bool flagVOT = false; bool flagVOT = false;
//TLD Dataset Parameters //TLD Dataset Parameters
char* tldFolderName[10] = { const char* tldFolderName[10] = {
"01_david", "01_david",
"02_jumping", "02_jumping",
"03_pedestrian1", "03_pedestrian1",
...@@ -63,7 +63,7 @@ namespace cv ...@@ -63,7 +63,7 @@ namespace cv
"09_carchase", "09_carchase",
"10_panda" "10_panda"
}; };
char* votFolderName[60] = { const char* votFolderName[60] = {
"bag", "ball1", "ball2", "basketball", "birds1", "birds2", "blanket", "bmx", "bolt1", "bolt2", "bag", "ball1", "ball2", "basketball", "birds1", "birds2", "blanket", "bmx", "bolt1", "bolt2",
"book", "butterfly", "car1", "car2", "crossing", "dinosaur", "fernando", "fish1", "fish2", "fish3", "book", "butterfly", "car1", "car2", "crossing", "dinosaur", "fernando", "fish1", "fish2", "fish3",
"fish4", "girl", "glove", "godfather", "graduate", "gymnastics1", "gymnastics2 ", "gymnastics3", "gymnastics4", "hand", "fish4", "girl", "glove", "godfather", "graduate", "gymnastics1", "gymnastics2 ", "gymnastics3", "gymnastics4", "hand",
...@@ -72,11 +72,11 @@ namespace cv ...@@ -72,11 +72,11 @@ namespace cv
"singer2", "singer3", "soccer1", "soccer2", "soldier", "sphere", "tiger", "traffic", "tunnel", "wiper" "singer2", "singer3", "soccer1", "soccer2", "soldier", "sphere", "tiger", "traffic", "tunnel", "wiper"
}; };
Rect2d tldInitBB[10] = { const Rect2d tldInitBB[10] = {
Rect2d(165, 93, 51, 54), Rect2d(147, 110, 33, 32), Rect2d(47, 51, 21, 36), Rect2d(130, 134, 21, 53), Rect2d(154, 102, 24, 52), Rect2d(165, 93, 51, 54), Rect2d(147, 110, 33, 32), Rect2d(47, 51, 21, 36), Rect2d(130, 134, 21, 53), Rect2d(154, 102, 24, 52),
Rect2d(142, 125, 90, 39), Rect2d(290, 43, 23, 40), Rect2d(273, 77, 27, 25), Rect2d(337, 219, 54, 37), Rect2d(58, 100, 27, 22) Rect2d(142, 125, 90, 39), Rect2d(290, 43, 23, 40), Rect2d(273, 77, 27, 25), Rect2d(337, 219, 54, 37), Rect2d(58, 100, 27, 22)
}; };
Rect2d votInitBB[60] = { const Rect2d votInitBB[60] = {
Rect2d(142, 125, 90, 39), Rect2d(490, 400, 40, 40), Rect2d(273, 77, 27, 25), Rect2d(145, 84, 54, 37), Rect2d(58, 100, 27, 22), Rect2d(142, 125, 90, 39), Rect2d(490, 400, 40, 40), Rect2d(273, 77, 27, 25), Rect2d(145, 84, 54, 37), Rect2d(58, 100, 27, 22),
Rect2d(450, 380, 60, 60), Rect2d(290, 43, 23, 40), Rect2d(273, 77, 27, 25), Rect2d(225, 175, 50, 50), Rect2d(58, 100, 27, 22), Rect2d(450, 380, 60, 60), Rect2d(290, 43, 23, 40), Rect2d(273, 77, 27, 25), Rect2d(225, 175, 50, 50), Rect2d(58, 100, 27, 22),
...@@ -118,7 +118,10 @@ namespace cv ...@@ -118,7 +118,10 @@ namespace cv
cv::Rect2d tld_InitDataset(int videoInd, const char* rootPath, int datasetInd) cv::Rect2d tld_InitDataset(int videoInd, const char* rootPath, int datasetInd)
{ {
char* folderName = (char *)""; char* folderName = (char *)"";
int x, y, w, h; int x = 0,
y = 0,
w = 0,
h = 0;
//Index range //Index range
// 1-10 TLD Dataset // 1-10 TLD Dataset
...@@ -127,7 +130,7 @@ namespace cv ...@@ -127,7 +130,7 @@ namespace cv
if (datasetInd == 0) if (datasetInd == 0)
{ {
folderName = tldFolderName[id]; folderName = (char*)tldFolderName[id];
x = tldInitBB[id].x; x = tldInitBB[id].x;
y = tldInitBB[id].y; y = tldInitBB[id].y;
w = tldInitBB[id].width; w = tldInitBB[id].width;
...@@ -138,7 +141,7 @@ namespace cv ...@@ -138,7 +141,7 @@ namespace cv
} }
if (datasetInd == 1) if (datasetInd == 1)
{ {
folderName = votFolderName[id]; folderName = (char*)votFolderName[id];
x = votInitBB[id].x; x = votInitBB[id].x;
y = votInitBB[id].y; y = votInitBB[id].y;
w = votInitBB[id].width; w = votInitBB[id].width;
......
...@@ -238,7 +238,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox) ...@@ -238,7 +238,7 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
//Debug display candidates after Variance Filter //Debug display candidates after Variance Filter
//////////////////////////////////////////////// ////////////////////////////////////////////////
Mat tmpImg = image; Mat tmpImg = image;
for (int i = 0; i < tldModel->detector->debugStack[0].size(); i++) for (int i = 0; i < (int)tldModel->detector->debugStack[0].size(); i++)
//rectangle(tmpImg, tldModel->detector->debugStack[0][i], Scalar(255, 255, 255), 1, 1, 0); //rectangle(tmpImg, tldModel->detector->debugStack[0][i], Scalar(255, 255, 255), 1, 1, 0);
tldModel->detector->debugStack[0].clear(); tldModel->detector->debugStack[0].clear();
tmpImg.copyTo(image); tmpImg.copyTo(image);
......
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