21 #ifndef _CASCADE_CLASSIFIER_H
22 #define _CASCADE_CLASSIFIER_H
28 template<
class WeakClassifier >
47 template<
class R,
class P1,
class P2>
52 template<
class R,
class P1,
class P2,
class P3>
59 static std::string signature() {
70 std::ostream & operator << (std::ostream & out, const SoftCascadeStage<T> & s);
110 template<
class R,
class Param1Type,
class Param2Type>
131 inline void insert(
const WeakClassifier & weak,
float alpha,
float reject)
138 return Classifier::signature();
146 template<
class TParam1>
147 static float compute(
const TParam1 pIntImage,
const Classifier *classifier,
int n);
150 template<
class TParam1,
class TParam2>
151 static float compute(
const TParam1 pIntImage,
const TParam2 stride,
const Classifier *classifier,
int n);
153 template<
class FeatureType>
154 void export_features(std::vector<FeatureType> & out)
const
163 template<
class TParam1,
class TParam2>
164 float raw(
const TParam1 data,
const TParam2 p1)
const
169 acc += (*i)(data, p1);
176 template<
class TParam1>
183 template<
class TParam1,
class TParam2>
184 inline float operator()(
const TParam1 pIntImage,
const TParam2 stride)
const {
193 std::ostream & operator << (std::ostream & out, const SoftCascadeClassifier<T> & src);
205 inline std::ostream & operator << (std::ostream & out, const SoftCascadeStage<T> & s)
229 std::ostream & operator << (std::ostream & out, const SoftCascadeClassifier<T> & src)
253 m_weak_classifiers.push_back(h);
259 template<
class TParam1,
class TParam2>
263 for(
int i = 0; i<n; i++)
265 acc += bc[i](pIntImage, stride);
266 if(acc < bc[i].rejection)
273 template<
class TParam1>
277 for(
int i = 0; i<n; i++)
279 acc += bc[i](pIntImage);
280 if(acc < bc[i].rejection)
Definition: SoftCascade.h:31
SoftCascadeClassifier(const SoftCascadeClassifier< R > &src, int scale, int offset, long stride)
Create and convert a SoftCascade.
Definition: SoftCascade.h:101
SoftCascadeStage< T > Classifier
A softcascadeboostable classifier is a weak classifier with a weight associated and a rejection thres...
Definition: SoftCascade.h:83
std::vector< Classifier > ClassifierList
List of BoostSoftCascade classifier.
Definition: SoftCascade.h:85
~SoftCascadeClassifier()
dtor
Definition: SoftCascade.h:241
SoftCascadeStage< typename WeakClassifier::OptimizedType > OptimizedType
the optimized version of the SoftCascadeStage classifier
Definition: SoftCascade.h:35
float operator()(const TParam1 pIntImage) const
Definition: SoftCascade.h:177
ClassifierList m_weak_classifiers
A che collection of SoftCascadeStage weak classifier.
Definition: SoftCascade.h:95
static std::string signature()
propagate signature
Definition: SoftCascade.h:137
SoftCascadeClassifier()
ctor
Definition: SoftCascade.h:238
SoftCascadeClassifier< typename T::OptimizedType > OptimizedType
the optimized version of the SoftCascadeStage classifier
Definition: SoftCascade.h:90
ClassifierList & list()
Return the inner list of classifier.
Definition: SoftCascade.h:142
float rejection
Definition: SoftCascade.h:40
static float compute(const TParam1 pIntImage, const Classifier *classifier, int n)
the real computer
Definition: SoftCascade.h:274
Definition: SoftCascade.h:76
unsigned int length() const
Return the number of classifiers.
Definition: SoftCascade.h:127
SoftCascadeClassifier(const SoftCascadeClassifier< R > &src, Param1Type p1, const Param2Type &p2)
Create and convert a SoftCascade.
Definition: SoftCascade.h:111
T WeakClassifier
the inner weak classifier
Definition: SoftCascade.h:81
float raw(const TParam1 data, const TParam2 p1) const
Definition: SoftCascade.h:164
Definition: BoostableClassifier.h:40
float operator()(const TParam1 pIntImage, const TParam2 stride) const
Definition: SoftCascade.h:184
SoftCascadeStage(bool dummy, const SoftCascadeStage< R > &src, P1 p1, P2 p2)
Definition: SoftCascade.h:48