libface 0.2
Classes | Public Member Functions

libface::Eigenfaces Class Reference

Inheritance diagram for libface::Eigenfaces:
libface::LibFaceRecognitionCore

List of all members.

Classes

class  EigenfacesPriv

Public Member Functions

 Eigenfaces (const std::string &dir=".")
 ~Eigenfaces ()
int count () const
std::map< std::string,
std::string > 
getConfig ()
int loadConfig (const std::map< std::string, std::string > &config)
int loadConfig (const std::string &dir)
std::pair< int, float > recognize (IplImage *input)
int saveConfig (const std::string &dir)
int update (std::vector< Face > &)

Constructor & Destructor Documentation

libface::Eigenfaces::Eigenfaces ( const std::string &  dir = ".")

Constructor for Eigenfaces. Takes a directory string as argument to determine the location of config xml file.

Parameters:
dirThe directory in which the DB is to be found/created
libface::Eigenfaces::~Eigenfaces ( )

Deconstructor that frees the data variables.


Member Function Documentation

int libface::Eigenfaces::count ( ) const [virtual]

Returns the number of unique faces in the database.

Implements libface::LibFaceRecognitionCore.

map< string, string > libface::Eigenfaces::getConfig ( ) [virtual]

Get the mapping between config variables and the data. This can be stored and then loaded back into config.

Returns:
Returns a config std::map with variable names as keys and data encoded as std::string.

Implements libface::LibFaceRecognitionCore.

int libface::Eigenfaces::loadConfig ( const std::string &  dir) [virtual]

Attempts to load config from specified directory.

Parameters:
dirA directory to look for libface-config.xml file.
Returns:
Returns 0 if config was loaded or positive error code otherwise.

Implements libface::LibFaceRecognitionCore.

int libface::Eigenfaces::loadConfig ( const std::map< std::string, std::string > &  config) [virtual]

Method for loading the mapping of config variables and the data back into libface.

Parameters:
configA std::map config returned by getConfig() method.
Returns:
Returns 0 if operation was successful, or positive error codeotherwise.

Implements libface::LibFaceRecognitionCore.

pair< int, float > libface::Eigenfaces::recognize ( IplImage *  input) [virtual]

Method to attempt to compare images with the known projected images. Uses a specified type of distance to see how far away they are from each of the images in the projection.

Parameters:
inputThe pointer to IplImage * image, which is to be recognized.
Returns:
A pair with ID and closeness of the closest face.

Implements libface::LibFaceRecognitionCore.

int libface::Eigenfaces::saveConfig ( const std::string &  dir) [virtual]

Saves the config is a given directory.

Parameters:
dirA std::string path to directory where config should be stored.
Returns:
Returns 0 if operation was successful, or positive error code otherwise.

Implements libface::LibFaceRecognitionCore.

int libface::Eigenfaces::update ( std::vector< Face > &  ) [virtual]

Updates the config with a vector of input training faces. If id of the face is -1, then face is added to the end of the faces vector.

If id is not -1 and a new id, then face is added to the end of the faces vector.

If id is not -1 and it already exist, then given the given faces is projected together with the known face at that position using eigen decomposition and the projected face is stored in it's place.

Parameters:
newFaceArrThe vector of input Face objects
Returns:
Returns 0 if update was successful, or positive int otherwise.

Implements libface::LibFaceRecognitionCore.


The documentation for this class was generated from the following files:
 All Classes Files Functions