libface 0.2

src/Haarcascades.h

Go to the documentation of this file.
00001 
00031 #ifndef _HAARCASCADES_H_
00032 #define _HAARCASCADES_H_
00033 
00034 #include <string>
00035 
00036 #include "LibFaceConfig.h"
00037 
00038 namespace libface
00039 {
00040 
00041 // A Cascade structure has :
00042 // a name (for easy reference),
00043 // a filename (to load the actual cascade from)
00044 // a CvHaarClassifierCascade object pointer
00045 
00046 typedef struct CascadeStruct
00047 {
00048     std::string              name;
00049     CvHaarClassifierCascade* haarcasc;
00050 } Cascade;
00051 
00052 class FACEAPI Haarcascades
00053 {
00054 
00055 public:
00056 
00062     Haarcascades(const std::string& path);
00063 
00067     ~Haarcascades();
00068 
00074     void addCascade(const Cascade& newCascade, int newWeight);
00075 
00081     void addCascade(const std::string& name, int weight);
00082 
00087     void removeCascade(const std::string& name);
00088 
00093     void removeCascade(int index);
00094 
00100     void setWeight(const std::string& name, int weight);
00101 
00107     void setWeight(int index, int weight);
00108 
00114     int getWeight(const std::string& name) const;
00115 
00121     int getWeight(int index) const;
00122 
00128     bool hasCascade(const std::string& name) const;
00129 
00135     const Cascade& getCascade(const std::string& name) const;
00136 
00142     const Cascade& getCascade(int index) const;
00143 
00148     int getSize() const;
00149 
00153     void clear();
00154 
00155 private:
00156 
00157     class HaarcascadesPriv;
00158     HaarcascadesPriv* const d;
00159 };
00160 
00161 } // namespace libface
00162 
00163 #endif // _HAARCASCADES_H_
 All Classes Files Functions