|
|
@ -83,6 +83,7 @@ namespace cv |
|
|
|
return splus / (sminus + splus); |
|
|
|
return splus / (sminus + splus); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
double TLDDetector::ocl_Sr(const Mat_<uchar>& patch) |
|
|
|
double TLDDetector::ocl_Sr(const Mat_<uchar>& patch) |
|
|
|
{ |
|
|
|
{ |
|
|
|
double splus = 0.0, sminus = 0.0; |
|
|
|
double splus = 0.0, sminus = 0.0; |
|
|
@ -185,6 +186,7 @@ namespace cv |
|
|
|
resultSc[id] = spc / (smc + spc); |
|
|
|
resultSc[id] = spc / (smc + spc); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Calculate Conservative similarity of the patch (NN-Model)
|
|
|
|
// Calculate Conservative similarity of the patch (NN-Model)
|
|
|
|
double TLDDetector::Sc(const Mat_<uchar>& patch) |
|
|
|
double TLDDetector::Sc(const Mat_<uchar>& patch) |
|
|
@ -212,6 +214,7 @@ namespace cv |
|
|
|
return splus / (sminus + splus); |
|
|
|
return splus / (sminus + splus); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
double TLDDetector::ocl_Sc(const Mat_<uchar>& patch) |
|
|
|
double TLDDetector::ocl_Sc(const Mat_<uchar>& patch) |
|
|
|
{ |
|
|
|
{ |
|
|
|
double splus = 0.0, sminus = 0.0; |
|
|
|
double splus = 0.0, sminus = 0.0; |
|
|
@ -256,6 +259,7 @@ namespace cv |
|
|
|
return 0.0; |
|
|
|
return 0.0; |
|
|
|
return splus / (sminus + splus); |
|
|
|
return splus / (sminus + splus); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // HAVE_OPENCL
|
|
|
|
|
|
|
|
|
|
|
|
// Generate Search Windows for detector from aspect ratio of initial BBs
|
|
|
|
// Generate Search Windows for detector from aspect ratio of initial BBs
|
|
|
|
void TLDDetector::generateScanGrid(int rows, int cols, Size initBox, std::vector<Rect2d>& res, bool withScaling) |
|
|
|
void TLDDetector::generateScanGrid(int rows, int cols, Size initBox, std::vector<Rect2d>& res, bool withScaling) |
|
|
@ -393,6 +397,7 @@ namespace cv |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
bool TLDDetector::ocl_detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize) |
|
|
|
bool TLDDetector::ocl_detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize) |
|
|
|
{ |
|
|
|
{ |
|
|
|
patches.clear(); |
|
|
|
patches.clear(); |
|
|
@ -507,6 +512,7 @@ namespace cv |
|
|
|
res = maxScRect; |
|
|
|
res = maxScRect; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // HAVE_OPENCL
|
|
|
|
|
|
|
|
|
|
|
|
// Computes the variance of subimage given by box, with the help of two integral
|
|
|
|
// Computes the variance of subimage given by box, with the help of two integral
|
|
|
|
// images intImgP and intImgP2 (sum of squares), which should be also provided.
|
|
|
|
// images intImgP and intImgP2 (sum of squares), which should be also provided.
|
|
|
|