|
|
|
@ -55,8 +55,7 @@ namespace cv |
|
|
|
|
measurements.assign(meas.begin() + beg, meas.begin() + end); |
|
|
|
|
offset.assign(mpc, Point2i(0, 0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 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) |
|
|
|
|
{ |
|
|
|
|
#if 0 |
|
|
|
@ -92,7 +91,7 @@ namespace cv |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate offsets for classifier
|
|
|
|
|
void TLDEnsembleClassifier::prepareClassifier(int rowstep) |
|
|
|
|
{ |
|
|
|
@ -106,7 +105,7 @@ namespace cv |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Integrate patch into the Ensemble Classifier model
|
|
|
|
|
void TLDEnsembleClassifier::integrate(const Mat_<uchar>& patch, bool isPositive) |
|
|
|
|
{ |
|
|
|
@ -137,7 +136,7 @@ namespace cv |
|
|
|
|
return posNum / (posNum + negNum); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Calculate the 13-bit fern index
|
|
|
|
|
// Calculate the 13-bit fern index
|
|
|
|
|
int TLDEnsembleClassifier::codeFast(const uchar* data) const |
|
|
|
|
{ |
|
|
|
|
int position = 0; |
|
|
|
@ -188,7 +187,7 @@ namespace cv |
|
|
|
|
stepPrefSuff(measurements, 2, size.height, gridSize); |
|
|
|
|
stepPrefSuff(measurements, 3, size.height, gridSize); |
|
|
|
|
|
|
|
|
|
//Compile fern classifiers
|
|
|
|
|
//Compile fern classifiers
|
|
|
|
|
for (int i = 0, howMany = (int)measurements.size() / measurePerClassifier; i < howMany; i++) |
|
|
|
|
classifiers.push_back(TLDEnsembleClassifier(measurements, i * measurePerClassifier, (i + 1) * measurePerClassifier)); |
|
|
|
|
|
|
|
|
|