#include <ClassifierSelector.h>
|
| ClassifierSelector (int numW, const Size &patchSize, int numB=2) |
|
| ClassifierSelector (int numW, WeakClassifier **weaks, int numB=2) |
|
void | Initialize (const Size &patchSize) |
|
void | Train (const IntegralImage *intImage, const Rect &roi, int target, float importance, bool *errMask) |
|
float | GetError (int index=-1) const |
|
virtual int | SelectBestClassifer (float importance, const bool *errorMask, float *errors) |
|
virtual int | ReplaceWeakestClassifier (float *sumErrors, const Size &patchSize) |
|
virtual void | ReplaceWeakestClassifierStatistic (int src, int dst) |
|
int | Classify (const IntegralImage *intImage, const Rect &roi) |
|
float | Evaluate (const IntegralImage *intImage, const Rect &roi, int indexWeak=-1) |
|
WeakClassifier ** | GetClassifierPool () const |
|
void | SetClassifierPool (WeakClassifier **weaks) |
|
int | GetNewBackup () |
|
Select the best classifier from some weak classifiers. Here we only use WeakClassifierHaar. Used in online boosting classifier.
- Author
- Zhengrong Wang.
ClassifierSelector::ClassifierSelector |
( |
int |
numW, |
|
|
const Size & |
patchSize, |
|
|
int |
numB = 2 |
|
) |
| |
Build a classifier selector with some WeakClassifierHaars.
- Parameters
-
numW | # weak classifiers |
patchSize | the patch size used in weak classifiers |
numB | # weak classifiers for subsititution |
ClassifierSelector::ClassifierSelector |
( |
int |
numW, |
|
|
WeakClassifier ** |
weaks, |
|
|
int |
numB = 2 |
|
) |
| |
Build a classifier selector from some outside weakclassifier array.
- Parameters
-
weaks | the array of weak classifiers. |
int ClassifierSelector::Classify |
( |
const IntegralImage * |
intImage, |
|
|
const Rect & |
roi |
|
) |
| |
Evaluate a feature.
- Returns
- 1 for pos, -1 for neg
float ClassifierSelector::GetError |
( |
int |
index = -1 | ) |
const |
- Returns
- the error rate of this seletor, or any specific classifier.
void ClassifierSelector::Initialize |
( |
const Size & |
patchSize | ) |
|
Initialize this selector for a new target. Notice the number of weak classifiers will not change, but all the features will be randomly generated again. This is designed to reduce the new/delete operation.
int ClassifierSelector::ReplaceWeakestClassifier |
( |
float * |
sumErrors, |
|
|
const Size & |
patchSize |
|
) |
| |
|
virtual |
Replace the weakest classifier.
- Parameters
-
sumErrors | a buffer contains the sum of error rate. The biggest weak classifier will be replaced |
- Returns
- the index of the replaced classifier
void ClassifierSelector::ReplaceWeakestClassifierStatistic |
( |
int |
src, |
|
|
int |
dst |
|
) |
| |
|
virtual |
Only replace the weight. Used when the weak classifier is from outside.
int ClassifierSelector::SelectBestClassifer |
( |
float |
importance, |
|
|
const bool * |
errorMask, |
|
|
float * |
errors |
|
) |
| |
|
virtual |
Select the best classifier.
- Parameters
-
in | importance the weight of this sample |
in | errorMask true if the classifer makes mistake on this sample |
out | errors a buffer contains the error rates of each classifier |
- Returns
- index of new selected classifier
void ClassifierSelector::Train |
( |
const IntegralImage * |
intImage, |
|
|
const Rect & |
roi, |
|
|
int |
target, |
|
|
float |
importance, |
|
|
bool * |
errMask |
|
) |
| |
Train the weak classifiers.
- Parameters
-
intImage | the integral image |
roi | the region of the target |
target | 1 for pos, -1 for neg |
importance | the weight of this sample |
out | errMask update the error mask array |
The documentation for this class was generated from the following files: