Ignore:
Timestamp:
03/19/2009 10:58:22 AM (11 years ago)
Author:
dave
Message:

Proper calibration system, better user interface and fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • foam/trunk/simple-faceident/src/FaceBank.h

    r1 r14  
    1616 
    1717#include <iostream> 
    18 #include <list> 
     18#include <map> 
    1919#include <assert.h> 
    2020 
     
    4747{ 
    4848public: 
    49         // MaxFaces is the number of faces we want to restrict the facebank to storing,  
    5049        // FaceWidth and FaceHeight are the size for the internal stored image of the face for  
    5150        // comparison, ErrorThresh is the error amount which will trigger a new face to be stored 
    52         FaceBank(unsigned int MaxFaces, unsigned int FaceWidth, unsigned int FaceHeight, float ErrorThresh); 
     51        FaceBank(unsigned int FaceWidth, unsigned int FaceHeight, float ErrorThresh); 
    5352         
    5453        ~FaceBank(); 
     54 
     55        void Clear(); 
    5556         
    56         // gives the id, given a new face, and returns the confidence 
    57         // if it's a new face it returns 1 and stores the id, copying the face image 
    58         float Identify(IplImage *face, unsigned int &ID, bool learn); 
     57        // Learn this face, the face may be a false positive, so we'll discard the  
     58        // suggestion if we've seen it before, and the error is greater than ErrorThresh 
     59        float Suggest(IplImage *face, unsigned int ID); 
     60 
     61        // Gives the id, given a face, and returns the confidence 
     62        float Identify(IplImage *face, unsigned int &ID); 
    5963         
    60         std::list<Face*> &GetFaceList() { return m_FaceList; } 
     64        std::map<unsigned int, Face*> &GetFaceMap() { return m_FaceMap; } 
    6165         
     66        unsigned int GetFaceWidth() { return m_FaceWidth; } 
     67        unsigned int GetFaceHeight() { return m_FaceHeight; } 
     68 
    6269private:         
    6370 
    64         unsigned int m_MaxFaces; 
    6571        unsigned int m_FaceWidth; 
    6672        unsigned int m_FaceHeight; 
    6773        float m_ErrorThresh; 
    6874         
    69         std::list<Face*> m_FaceList; 
     75        std::map<unsigned int, Face*> m_FaceMap; 
    7076}; 
    7177 
Note: See TracChangeset for help on using the changeset viewer.