Commit 6da37048 authored by Vladimir's avatar Vladimir

Fixing Warnings #2

parent 34d91fa9
...@@ -106,10 +106,10 @@ namespace cv ...@@ -106,10 +106,10 @@ namespace cv
double TLDDetector::ocl_Sr(const Mat_<uchar>& patch) double TLDDetector::ocl_Sr(const Mat_<uchar>& patch)
{ {
int64 e1, e2, e3, e4; //int64 e1, e2, e3, e4;
double t; //double t;
e1 = getTickCount(); //e1 = getTickCount();
e3 = getTickCount(); //e3 = getTickCount();
double splus = 0.0, sminus = 0.0; double splus = 0.0, sminus = 0.0;
...@@ -134,23 +134,23 @@ namespace cv ...@@ -134,23 +134,23 @@ namespace cv
posNum, posNum,
negNum); negNum);
e4 = getTickCount(); //e4 = getTickCount();
t = (e4 - e3) / getTickFrequency()*1000.0; //t = (e4 - e3) / getTickFrequency()*1000.0;
//printf("Mem Cpy GPU: %f\n", t); //printf("Mem Cpy GPU: %f\n", t);
size_t globSize = 1000; size_t globSize = 1000;
size_t localSize = 128; size_t localSize = 128;
e3 = getTickCount(); //e3 = getTickCount();
if (!k.run(1, &globSize, &localSize, true)) if (!k.run(1, &globSize, &localSize, true))
printf("Kernel Run Error!!!"); printf("Kernel Run Error!!!");
e4 = getTickCount(); //e4 = getTickCount();
t = (e4 - e3) / getTickFrequency()*1000.0; //t = (e4 - e3) / getTickFrequency()*1000.0;
//printf("Kernel Run GPU: %f\n", t); //printf("Kernel Run GPU: %f\n", t);
e3 = getTickCount(); //e3 = getTickCount();
Mat resNCC = devNCC.getMat(ACCESS_READ); Mat resNCC = devNCC.getMat(ACCESS_READ);
e4 = getTickCount(); //e4 = getTickCount();
t = (e4 - e3) / getTickFrequency()*1000.0; //t = (e4 - e3) / getTickFrequency()*1000.0;
//printf("Read Mem GPU: %f\n", t); //printf("Read Mem GPU: %f\n", t);
////Compare ////Compare
...@@ -174,8 +174,8 @@ namespace cv ...@@ -174,8 +174,8 @@ namespace cv
for (int i = 0; i < *negNum; i++) for (int i = 0; i < *negNum; i++)
sminus = std::max(sminus, 0.5 * (resNCC.at<float>(i+500) +1.0)); sminus = std::max(sminus, 0.5 * (resNCC.at<float>(i+500) +1.0));
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Sr GPU: %f\n\n", t); //printf("Sr GPU: %f\n\n", t);
if (splus + sminus == 0.0) if (splus + sminus == 0.0)
...@@ -185,10 +185,10 @@ namespace cv ...@@ -185,10 +185,10 @@ namespace cv
void TLDDetector::ocl_batchSrSc(const Mat_<uchar>& patches, double *resultSr, double *resultSc, int numOfPatches) void TLDDetector::ocl_batchSrSc(const Mat_<uchar>& patches, double *resultSr, double *resultSc, int numOfPatches)
{ {
int64 e1, e2, e3, e4; //int64 e1, e2, e3, e4;
double t; //double t;
e1 = getTickCount(); //e1 = getTickCount();
e3 = getTickCount(); //e3 = getTickCount();
UMat devPatches = patches.getUMat(ACCESS_READ, USAGE_ALLOCATE_DEVICE_MEMORY); UMat devPatches = patches.getUMat(ACCESS_READ, USAGE_ALLOCATE_DEVICE_MEMORY);
UMat devPositiveSamples = posExp->getUMat(ACCESS_READ, USAGE_ALLOCATE_DEVICE_MEMORY); UMat devPositiveSamples = posExp->getUMat(ACCESS_READ, USAGE_ALLOCATE_DEVICE_MEMORY);
...@@ -213,25 +213,25 @@ namespace cv ...@@ -213,25 +213,25 @@ namespace cv
negNum, negNum,
numOfPatches); numOfPatches);
e4 = getTickCount(); //e4 = getTickCount();
t = (e4 - e3) / getTickFrequency()*1000.0; //t = (e4 - e3) / getTickFrequency()*1000.0;
//printf("Mem Cpy GPU: %f\n", t); //printf("Mem Cpy GPU: %f\n", t);
// 2 -> Pos&Neg // 2 -> Pos&Neg
size_t globSize = 2 * numOfPatches*MAX_EXAMPLES_IN_MODEL; size_t globSize = 2 * numOfPatches*MAX_EXAMPLES_IN_MODEL;
size_t localSize = 1024; size_t localSize = 1024;
e3 = getTickCount(); //e3 = getTickCount();
if (!k.run(1, &globSize, &localSize, true)) if (!k.run(1, &globSize, &localSize, true))
printf("Kernel Run Error!!!"); printf("Kernel Run Error!!!");
e4 = getTickCount(); //e4 = getTickCount();
t = (e4 - e3) / getTickFrequency()*1000.0; //t = (e4 - e3) / getTickFrequency()*1000.0;
//printf("Kernel Run GPU: %f\n", t); //printf("Kernel Run GPU: %f\n", t);
e3 = getTickCount(); //e3 = getTickCount();
Mat posNCC = devPosNCC.getMat(ACCESS_READ); Mat posNCC = devPosNCC.getMat(ACCESS_READ);
Mat negNCC = devNegNCC.getMat(ACCESS_READ); Mat negNCC = devNegNCC.getMat(ACCESS_READ);
e4 = getTickCount(); //e4 = getTickCount();
t = (e4 - e3) / getTickFrequency()*1000.0; //t = (e4 - e3) / getTickFrequency()*1000.0;
//printf("Read Mem GPU: %f\n", t); //printf("Read Mem GPU: %f\n", t);
//Calculate Srs //Calculate Srs
...@@ -281,8 +281,8 @@ namespace cv ...@@ -281,8 +281,8 @@ namespace cv
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Sr GPU: %f\n\n", t); //printf("Sr GPU: %f\n\n", t);
} }
...@@ -312,9 +312,9 @@ namespace cv ...@@ -312,9 +312,9 @@ namespace cv
return splus / (sminus + splus); return splus / (sminus + splus);
*/ */
int64 e1, e2; //int64 e1, e2;
float t; //double t;
e1 = getTickCount(); //e1 = getTickCount();
double splus = 0.0, sminus = 0.0; double splus = 0.0, sminus = 0.0;
Mat_<uchar> modelSample(STANDARD_PATCH_SIZE, STANDARD_PATCH_SIZE); Mat_<uchar> modelSample(STANDARD_PATCH_SIZE, STANDARD_PATCH_SIZE);
int med = getMedian((*timeStampsPositive)); int med = getMedian((*timeStampsPositive));
...@@ -331,8 +331,8 @@ namespace cv ...@@ -331,8 +331,8 @@ namespace cv
modelSample.data = &(negExp->data[i * 225]); modelSample.data = &(negExp->data[i * 225]);
sminus = std::max(sminus, 0.5 * (NCC(modelSample, patch) + 1.0)); sminus = std::max(sminus, 0.5 * (NCC(modelSample, patch) + 1.0));
} }
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Sc: %f\n", t); //printf("Sc: %f\n", t);
if (splus + sminus == 0.0) if (splus + sminus == 0.0)
return 0.0; return 0.0;
...@@ -473,18 +473,16 @@ namespace cv ...@@ -473,18 +473,16 @@ namespace cv
std::vector <Mat> resized_imgs, blurred_imgs; std::vector <Mat> resized_imgs, blurred_imgs;
std::vector <Point> varBuffer, ensBuffer; std::vector <Point> varBuffer, ensBuffer;
std::vector <double> varScaleIDs, ensScaleIDs; std::vector <double> varScaleIDs, ensScaleIDs;
int64 e1, e2; //int64 e1, e2;
double t; //double t;
e1 = getTickCount(); //e1 = getTickCount();
//Detection part //Detection part
<<<<<<< HEAD
=======
//Generate windows and filter by variance //Generate windows and filter by variance
scaleID = 0; scaleID = 0;
resized_imgs.push_back(img); resized_imgs.push_back(img);
blurred_imgs.push_back(imgBlurred); blurred_imgs.push_back(imgBlurred);
>>>>>>> 2-nd level of parallelization + detector remake
do do
{ {
Mat_<double> intImgP, intImgP2; Mat_<double> intImgP, intImgP2;
...@@ -508,12 +506,12 @@ namespace cv ...@@ -508,12 +506,12 @@ namespace cv
GaussianBlur(resized_imgs[scaleID], tmp, GaussBlurKernelSize, 0.0f); GaussianBlur(resized_imgs[scaleID], tmp, GaussBlurKernelSize, 0.0f);
blurred_imgs.push_back(tmp); blurred_imgs.push_back(tmp);
} while (size.width >= initSize.width && size.height >= initSize.height); } while (size.width >= initSize.width && size.height >= initSize.height);
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Variance: %d\t%f\n", varBuffer.size(), t); //printf("Variance: %d\t%f\n", varBuffer.size(), t);
//Encsemble classification //Encsemble classification
e1 = getTickCount(); //e1 = getTickCount();
for (int i = 0; i < (int)varBuffer.size(); i++) for (int i = 0; i < (int)varBuffer.size(); i++)
{ {
prepareClassifiers((int)blurred_imgs[varScaleIDs[i]].step[0]); prepareClassifiers((int)blurred_imgs[varScaleIDs[i]].step[0]);
...@@ -522,12 +520,12 @@ namespace cv ...@@ -522,12 +520,12 @@ namespace cv
ensBuffer.push_back(varBuffer[i]); ensBuffer.push_back(varBuffer[i]);
ensScaleIDs.push_back(varScaleIDs[i]); ensScaleIDs.push_back(varScaleIDs[i]);
} }
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Ensemble: %d\t%f\n", ensBuffer.size(), t); //printf("Ensemble: %d\t%f\n", ensBuffer.size(), t);
//NN classification //NN classification
e1 = getTickCount(); //e1 = getTickCount();
for (int i = 0; i < (int)ensBuffer.size(); i++) for (int i = 0; i < (int)ensBuffer.size(); i++)
{ {
LabeledPatch labPatch; LabeledPatch labPatch;
...@@ -561,8 +559,8 @@ namespace cv ...@@ -561,8 +559,8 @@ namespace cv
maxScRect = labPatch.rect; maxScRect = labPatch.rect;
} }
} }
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("NN: %d\t%f\n", patches.size(), t); //printf("NN: %d\t%f\n", patches.size(), t);
if (maxSc < 0) if (maxSc < 0)
...@@ -586,10 +584,10 @@ namespace cv ...@@ -586,10 +584,10 @@ namespace cv
std::vector <Mat> resized_imgs, blurred_imgs; std::vector <Mat> resized_imgs, blurred_imgs;
std::vector <Point> varBuffer, ensBuffer; std::vector <Point> varBuffer, ensBuffer;
std::vector <double> varScaleIDs, ensScaleIDs; std::vector <double> varScaleIDs, ensScaleIDs;
int64 e1, e2; //int64 e1, e2;
double t; //double t;
e1 = getTickCount(); //e1 = getTickCount();
//Detection part //Detection part
//Generate windows and filter by variance //Generate windows and filter by variance
scaleID = 0; scaleID = 0;
...@@ -618,12 +616,12 @@ namespace cv ...@@ -618,12 +616,12 @@ namespace cv
GaussianBlur(resized_imgs[scaleID], tmp, GaussBlurKernelSize, 0.0f); GaussianBlur(resized_imgs[scaleID], tmp, GaussBlurKernelSize, 0.0f);
blurred_imgs.push_back(tmp); blurred_imgs.push_back(tmp);
} while (size.width >= initSize.width && size.height >= initSize.height); } while (size.width >= initSize.width && size.height >= initSize.height);
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Variance: %d\t%f\n", varBuffer.size(), t); //printf("Variance: %d\t%f\n", varBuffer.size(), t);
//Encsemble classification //Encsemble classification
e1 = getTickCount(); //e1 = getTickCount();
for (int i = 0; i < (int)varBuffer.size(); i++) for (int i = 0; i < (int)varBuffer.size(); i++)
{ {
prepareClassifiers((int)blurred_imgs[varScaleIDs[i]].step[0]); prepareClassifiers((int)blurred_imgs[varScaleIDs[i]].step[0]);
...@@ -632,12 +630,12 @@ namespace cv ...@@ -632,12 +630,12 @@ namespace cv
ensBuffer.push_back(varBuffer[i]); ensBuffer.push_back(varBuffer[i]);
ensScaleIDs.push_back(varScaleIDs[i]); ensScaleIDs.push_back(varScaleIDs[i]);
} }
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("Ensemble: %d\t%f\n", ensBuffer.size(), t); //printf("Ensemble: %d\t%f\n", ensBuffer.size(), t);
//NN classification //NN classification
e1 = getTickCount(); //e1 = getTickCount();
//Prepare batch of patches //Prepare batch of patches
int numOfPatches = ensBuffer.size(); int numOfPatches = ensBuffer.size();
Mat_<uchar> stdPatches(numOfPatches, 225); Mat_<uchar> stdPatches(numOfPatches, 225);
...@@ -693,8 +691,8 @@ namespace cv ...@@ -693,8 +691,8 @@ namespace cv
maxScRect = labPatch.rect; maxScRect = labPatch.rect;
} }
} }
e2 = getTickCount(); //e2 = getTickCount();
t = (e2 - e1) / getTickFrequency()*1000.0; //t = (e2 - e1) / getTickFrequency()*1000.0;
//printf("NN: %d\t%f\n", patches.size(), t); //printf("NN: %d\t%f\n", patches.size(), t);
if (maxSc < 0) if (maxSc < 0)
......
...@@ -58,11 +58,11 @@ namespace cv ...@@ -58,11 +58,11 @@ namespace cv
// Calculate measure locations from 15x15 grid on minSize patches // Calculate measure locations from 15x15 grid on minSize patches
void TLDEnsembleClassifier::stepPrefSuff(std::vector<Vec4b>& arr, int pos, int len, int gridSize) void TLDEnsembleClassifier::stepPrefSuff(std::vector<Vec4b>& arr, int pos, int len, int gridSize)
{ {
#if 0 #if 0
int step = len / (gridSize - 1), pref = (len - step * (gridSize - 1)) / 2; int step = len / (gridSize - 1), pref = (len - step * (gridSize - 1)) / 2;
for (int i = 0; i < (int)(sizeof(x1) / sizeof(x1[0])); i++) for (int i = 0; i < (int)(sizeof(x1) / sizeof(x1[0])); i++)
arr[i] = pref + arr[i] * step; arr[i] = pref + arr[i] * step;
#else #else
int total = len - gridSize; int total = len - gridSize;
int quo = total / (gridSize - 1), rem = total % (gridSize - 1); int quo = total / (gridSize - 1), rem = total % (gridSize - 1);
int smallStep = quo, bigStep = quo + 1; int smallStep = quo, bigStep = quo + 1;
......
...@@ -64,6 +64,5 @@ namespace cv ...@@ -64,6 +64,5 @@ namespace cv
std::vector<Point2i> offset; std::vector<Point2i> offset;
int lastStep_; int lastStep_;
}; };
} }
} }
\ No newline at end of file
...@@ -65,7 +65,7 @@ namespace cv ...@@ -65,7 +65,7 @@ namespace cv
detector->posExp = &posExp; detector->posExp = &posExp;
detector->negExp = &negExp; detector->negExp = &negExp;
detector->positiveExamples = &positiveExamples; detector->positiveExamples = &positiveExamples;
detector->negativeExamples = &negativeExamples; detector->negativeExamples = &negativeExamples;
detector->timeStampsPositive = &timeStampsPositive; detector->timeStampsPositive = &timeStampsPositive;
detector->timeStampsNegative = &timeStampsNegative; detector->timeStampsNegative = &timeStampsNegative;
...@@ -78,15 +78,13 @@ namespace cv ...@@ -78,15 +78,13 @@ namespace cv
scaledImg, blurredImg, GaussBlurKernelSize, SCALE_STEP); scaledImg, blurredImg, GaussBlurKernelSize, SCALE_STEP);
GaussianBlur(image, image_blurred, GaussBlurKernelSize, 0.0); GaussianBlur(image, image_blurred, GaussBlurKernelSize, 0.0);
TLDDetector::generateScanGrid(image.rows, image.cols, minSize_, scanGrid); TLDDetector::generateScanGrid(image.rows, image.cols, minSize_, scanGrid);
getClosestN(scanGrid, Rect2d(boundingBox.x / scale, boundingBox.y / scale, boundingBox.width / scale, getClosestN(scanGrid, Rect2d(boundingBox.x / scale, boundingBox.y / scale, boundingBox.width / scale, boundingBox.height / scale), 10, closest);
boundingBox.height / scale), 10, closest);
Mat_<uchar> blurredPatch(minSize); Mat_<uchar> blurredPatch(minSize);
TLDEnsembleClassifier::makeClassifiers(minSize, MEASURES_PER_CLASSIFIER, GRIDSIZE, detector->classifiers); TLDEnsembleClassifier::makeClassifiers(minSize, MEASURES_PER_CLASSIFIER, GRIDSIZE, detector->classifiers);
//Generate initial positive samples and put them to the model //Generate initial positive samples and put them to the model
positiveExamples.reserve(200); positiveExamples.reserve(200);
for (int i = 0; i < (int)closest.size(); i++) for (int i = 0; i < (int)closest.size(); i++)
{ {
for (int j = 0; j < 20; j++) for (int j = 0; j < 20; j++)
...@@ -296,9 +294,12 @@ namespace cv ...@@ -296,9 +294,12 @@ namespace cv
dfprintf((port, "\tpositiveExamples.size() = %d\n", (int)positiveExamples.size())); dfprintf((port, "\tpositiveExamples.size() = %d\n", (int)positiveExamples.size()));
dfprintf((port, "\tnegativeExamples.size() = %d\n", (int)negativeExamples.size())); dfprintf((port, "\tnegativeExamples.size() = %d\n", (int)negativeExamples.size()));
} }
<<<<<<< HEAD
=======
>>>>>>> Fixing Warnings #2
} }
} }
\ No newline at end of file
...@@ -50,9 +50,6 @@ namespace cv ...@@ -50,9 +50,6 @@ namespace cv
{ {
namespace tld namespace tld
{ {
class TrackerTLDModel : public TrackerModel class TrackerTLDModel : public TrackerModel
{ {
public: public:
...@@ -82,7 +79,10 @@ namespace cv ...@@ -82,7 +79,10 @@ namespace cv
void modelUpdateImpl(){} void modelUpdateImpl(){}
Rect2d boundingBox_; Rect2d boundingBox_;
RNG rng; RNG rng;
<<<<<<< HEAD
=======
>>>>>>> Fixing Warnings #2
}; };
} }
......
...@@ -60,7 +60,6 @@ void TrackerTLD::Params::write(cv::FileStorage& /*fs*/) const {} ...@@ -60,7 +60,6 @@ void TrackerTLD::Params::write(cv::FileStorage& /*fs*/) const {}
namespace tld namespace tld
{ {
class TrackerProxy class TrackerProxy
{ {
public: public:
......
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