#include <face_recognizer_algorithms.h>
Public Member Functions | |
virtual void | activate_unknown_treshold () |
Method to activate usage of "unknown" threshold. | |
virtual void | classifyImage (cv::Mat &probe_mat, int &max_prob_index)=0 |
Abstract method for classification. | |
virtual void | classifyImage (cv::Mat &probe_mat, int &max_prob_index, cv::Mat &classification_probabilities)=0 |
Abstract method for classification. | |
FaceRecognizerBaseClass () | |
Constructor. | |
virtual bool | loadModel (boost::filesystem::path &model_file)=0 |
Abstract method to load recognition model. | |
virtual bool | saveModel (boost::filesystem::path &model_file)=0 |
Abstract method to save recognition model. | |
virtual bool | trainModel (std::vector< cv::Mat > &img_vec, std::vector< int > &label_vec, int &target_dim)=0 |
Abstract method for model training. | |
virtual | ~FaceRecognizerBaseClass () |
Destructor. | |
Public Attributes | |
bool | trained_ |
Flag indicates whether model is trained and ready for recognition. | |
Protected Member Functions | |
virtual void | calc_threshold (cv::Mat &data, double &thresh)=0 |
Calculation of unknown threshold. | |
virtual void | calc_threshold (std::vector< cv::Mat > &data, double &thresh)=0 |
Calculation of unknown threshold. | |
virtual void | calcDIFS (cv::Mat &probe_mat, int &minDIFSindex, double &minDIFS, cv::Mat &probabilities)=0 |
Abstract method for DIFS calculation. | |
virtual void | extractFeatures (std::vector< cv::Mat > &src_vec, cv::Mat &proj_mat, std::vector< cv::Mat > &coeff_vec)=0 |
Abstract method feature extraction. | |
virtual void | extractFeatures (cv::Mat &src_mat, cv::Mat &proj_mat, cv::Mat &coeff_mat)=0 |
Abstract method feature extraction. | |
virtual bool | input_param_check (std::vector< cv::Mat > &imgs, std::vector< int > &labels, int &target_dim) |
bool | is_known (double &distance, double &threshold) |
Check whether the unknown threshold is exceeded. | |
Protected Attributes | |
cv::Mat | eigenvalues_ |
Eigenvalues from Eigenvalue decomposition of training set. | |
std::vector< int > | model_label_vec_ |
Vector containing labels of training set. | |
int | num_classes_ |
Number of classes. | |
cv::Mat | projection_mat_ |
Linear projection matrix (Eigenvectors) for transition from image space to features space. | |
cv::Size | source_dim_ |
Dimensions of the images the model is trained with. | |
int | target_dim_ |
Subspace dimension that is used for the facespace. | |
double | unknown_thresh_ |
Unknown threshold. When it is exceeded face is classified as unknown. | |
bool | use_unknown_thresh_ |
When true unknown idendities are considered. |
Definition at line 27 of file face_recognizer_algorithms.h.
Constructor.
Definition at line 31 of file face_recognizer_algorithms.h.
virtual ipa_PeopleDetector::FaceRecognizerBaseClass::~FaceRecognizerBaseClass | ( | ) | [inline, virtual] |
Destructor.
Definition at line 38 of file face_recognizer_algorithms.h.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::activate_unknown_treshold | ( | ) | [inline, virtual] |
Method to activate usage of "unknown" threshold.
Definition at line 74 of file face_recognizer_algorithms.h.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::calc_threshold | ( | cv::Mat & | data, |
double & | thresh | ||
) | [protected, pure virtual] |
Calculation of unknown threshold.
Abstract method for the calculation of the "unknown" threshold
[in] | data | Matrix containing model features as matrix-rows. |
[out] | thresh | Value for "unknown" threshold. |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::calc_threshold | ( | std::vector< cv::Mat > & | data, |
double & | thresh | ||
) | [protected, pure virtual] |
Calculation of unknown threshold.
Abstract method for the calculation of the "unknown" threshold
[in] | data | Vector containing model features as matrices. |
[out] | thresh | Value for "unknown" threshold. |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::calcDIFS | ( | cv::Mat & | probe_mat, |
int & | minDIFSindex, | ||
double & | minDIFS, | ||
cv::Mat & | probabilities | ||
) | [protected, pure virtual] |
Abstract method for DIFS calculation.
Abstract method to calculate the minimal distance in face space (DIFS) for a given probe image.
[in] | probe_mat | Image which is compared to the model features |
[out] | minDIFSindex | Index of the minimal distance |
[out] | minDIFS | Minimal distance |
[out] | probabilities | Classification probabilities for all classes in dataset |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::classifyImage | ( | cv::Mat & | probe_mat, |
int & | max_prob_index | ||
) | [pure virtual] |
Abstract method for classification.
Abstract method to classifiy image.
[in] | src_vec | Vector of image matrices |
[in] | probe_mat | Image that is classified |
[out] | max_prob_index | Index of most probable label |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::classifyImage | ( | cv::Mat & | probe_mat, |
int & | max_prob_index, | ||
cv::Mat & | classification_probabilities | ||
) | [pure virtual] |
Abstract method for classification.
Abstract method to classifiy image and recieve classification probabilities for all possible classes.
[in] | probe_mat | Image that is classified |
[out] | max_prob_index | Index of most probable label |
[out] | Classification probabilities for all classes in dataset |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::extractFeatures | ( | std::vector< cv::Mat > & | src_vec, |
cv::Mat & | proj_mat, | ||
std::vector< cv::Mat > & | coeff_vec | ||
) | [protected, pure virtual] |
Abstract method feature extraction.
Abstract method to extract features from image matrix using a linear projection matrix.
[in] | src_vec | Vector of image matrices |
[in] | proj_mat | Linear projection matrix |
[out] | coeff_vec | Vector with feature matrices |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual void ipa_PeopleDetector::FaceRecognizerBaseClass::extractFeatures | ( | cv::Mat & | src_mat, |
cv::Mat & | proj_mat, | ||
cv::Mat & | coeff_mat | ||
) | [protected, pure virtual] |
Abstract method feature extraction.
Abstract method to extract features from image matrix using a linear projection matrix.
[in] | src_vec | Vector of image matrices |
[in] | src_mat | Image matrix |
[in] | proj_mat | Linear projection matrix |
[out] | coeff_vec | Feature matrix |
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
bool ipa_PeopleDetector::FaceRecognizerBaseClass::input_param_check | ( | std::vector< cv::Mat > & | imgs, |
std::vector< int > & | labels, | ||
int & | target_dim | ||
) | [protected, virtual] |
Method that checks input parameters for filetype and usable dimensions
Definition at line 3 of file face_recognizer_algorithms.cpp.
bool ipa_PeopleDetector::FaceRecognizerBaseClass::is_known | ( | double & | distance, |
double & | threshold | ||
) | [inline, protected] |
Check whether the unknown threshold is exceeded.
Method is used to check whether the unknown threshold is exceeded.
[in] | distance | Distance in faces space |
[in] | threshold | "unknown" threshold |
Definition at line 128 of file face_recognizer_algorithms.h.
virtual bool ipa_PeopleDetector::FaceRecognizerBaseClass::loadModel | ( | boost::filesystem::path & | model_file | ) | [pure virtual] |
Abstract method to load recognition model.
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual bool ipa_PeopleDetector::FaceRecognizerBaseClass::saveModel | ( | boost::filesystem::path & | model_file | ) | [pure virtual] |
Abstract method to save recognition model.
Implemented in ipa_PeopleDetector::FaceRecognizer2D, and ipa_PeopleDetector::FaceRecognizer1D.
virtual bool ipa_PeopleDetector::FaceRecognizerBaseClass::trainModel | ( | std::vector< cv::Mat > & | img_vec, |
std::vector< int > & | label_vec, | ||
int & | target_dim | ||
) | [pure virtual] |
Abstract method for model training.
Abstract method to train recognition model.
[in] | img_vec | Vector of image matrices |
[in] | label_vec | Vector of labels |
[in] | target_dim | Subspace dimension |
Implemented in ipa_PeopleDetector::FaceRecognizer_PCA2D, ipa_PeopleDetector::FaceRecognizer_LDA2D, ipa_PeopleDetector::FaceRecognizer_Fisherfaces, and ipa_PeopleDetector::FaceRecognizer_Eigenfaces.
cv::Mat ipa_PeopleDetector::FaceRecognizerBaseClass::eigenvalues_ [protected] |
Eigenvalues from Eigenvalue decomposition of training set.
Definition at line 141 of file face_recognizer_algorithms.h.
std::vector<int> ipa_PeopleDetector::FaceRecognizerBaseClass::model_label_vec_ [protected] |
Vector containing labels of training set.
Definition at line 142 of file face_recognizer_algorithms.h.
int ipa_PeopleDetector::FaceRecognizerBaseClass::num_classes_ [protected] |
Number of classes.
Definition at line 139 of file face_recognizer_algorithms.h.
cv::Mat ipa_PeopleDetector::FaceRecognizerBaseClass::projection_mat_ [protected] |
Linear projection matrix (Eigenvectors) for transition from image space to features space.
Definition at line 140 of file face_recognizer_algorithms.h.
cv::Size ipa_PeopleDetector::FaceRecognizerBaseClass::source_dim_ [protected] |
Dimensions of the images the model is trained with.
Definition at line 137 of file face_recognizer_algorithms.h.
int ipa_PeopleDetector::FaceRecognizerBaseClass::target_dim_ [protected] |
Subspace dimension that is used for the facespace.
Definition at line 138 of file face_recognizer_algorithms.h.
Flag indicates whether model is trained and ready for recognition.
Definition at line 78 of file face_recognizer_algorithms.h.
double ipa_PeopleDetector::FaceRecognizerBaseClass::unknown_thresh_ [protected] |
Unknown threshold. When it is exceeded face is classified as unknown.
Definition at line 134 of file face_recognizer_algorithms.h.
bool ipa_PeopleDetector::FaceRecognizerBaseClass::use_unknown_thresh_ [protected] |
When true unknown idendities are considered.
Definition at line 143 of file face_recognizer_algorithms.h.