Class cv::face::FisherFaceRecognizer#

Collaboration diagram for cv::face::FisherFaceRecognizer:

cv::face::FisherFaceRecognizer Node1 cv::face::FisherFaceRecognizer   + create() Node2 cv::face::BasicFaceRecognizer   + empty() + getEigenValues() + getEigenVectors() + getLabels() + getMean() + getNumComponents() + getProjections() + getThreshold() + read() + read() + setNumComponents() + setThreshold() + write() + write() Node2->Node1 Node3 cv::face::FaceRecognizer   + empty() + getLabelInfo() + getLabelsByString() + getThreshold() + predict() + predict() + predict() + read() + read() + setLabelInfo() + setThreshold() + train() + update() + write() + write() Node3->Node2 Node4 cv::Algorithm   + Algorithm() + ~Algorithm() + clear() + empty() + getDefaultName() + read() + save() + write() + write() + load() + loadFromString() + read() # writeFormat() Node4->Node3 Node5 std::map< int, String >     Node5->Node3 #_labelsInfo Node6 int     Node6->Node2 #_num_components Node6->Node5 +keys Node14 cv::Mat   + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() and 152 more... + diag() + eye() + eye() + getDefaultAllocator() + getStdAllocator() + ones() + ones() + ones() + ones() + setDefaultAllocator() + zeros() + zeros() + zeros() + zeros() # forEach_impl() Node6->Node14 +cols +dims +dummy +flags +rows Node7 std::string     Node7->Node5 +elements Node8 std::basic_string< Char >     Node8->Node7 Node9 std::map< K, T >     Node9->Node5 < int, String > Node10 K     Node10->Node9 +keys Node11 T     Node11->Node9 +elements Node20 std::vector< T >     Node11->Node20 +elements Node12 double     Node12->Node2 #_threshold Node13 std::vector< cv::Mat >     Node13->Node2 #_projections Node14->Node2 #_eigenvalues #_eigenvectors #_labels #_mean Node14->Node13 +elements Node15 uint8_t     Node15->Node14 +data +dataend +datalimit +datastart Node16 cv::MatAllocator   + MatAllocator() + ~MatAllocator() + allocate() + allocate() + copy() + deallocate() + download() + getBufferPoolController() + map() + unmap() + upload() Node16->Node14 +allocator Node17 UMatData *     Node17->Node14 +u Node18 MatSize     Node18->Node14 +size Node19 MatStep     Node19->Node14 +step Node20->Node13 < cv::Mat >

cv::face::FisherFaceRecognizer Node1 cv::face::FisherFaceRecognizer   + create() Node2 cv::face::BasicFaceRecognizer   + empty() + getEigenValues() + getEigenVectors() + getLabels() + getMean() + getNumComponents() + getProjections() + getThreshold() + read() + read() + setNumComponents() + setThreshold() + write() + write() Node2->Node1 Node3 cv::face::FaceRecognizer   + empty() + getLabelInfo() + getLabelsByString() + getThreshold() + predict() + predict() + predict() + read() + read() + setLabelInfo() + setThreshold() + train() + update() + write() + write() Node3->Node2 Node4 cv::Algorithm   + Algorithm() + ~Algorithm() + clear() + empty() + getDefaultName() + read() + save() + write() + write() + load() + loadFromString() + read() # writeFormat() Node4->Node3 Node5 std::map< int, String >     Node5->Node3 #_labelsInfo Node6 int     Node6->Node2 #_num_components Node6->Node5 +keys Node14 cv::Mat   + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() + Mat() and 152 more... + diag() + eye() + eye() + getDefaultAllocator() + getStdAllocator() + ones() + ones() + ones() + ones() + setDefaultAllocator() + zeros() + zeros() + zeros() + zeros() # forEach_impl() Node6->Node14 +cols +dims +dummy +flags +rows Node7 std::string     Node7->Node5 +elements Node8 std::basic_string< Char >     Node8->Node7 Node9 std::map< K, T >     Node9->Node5 < int, String > Node10 K     Node10->Node9 +keys Node11 T     Node11->Node9 +elements Node20 std::vector< T >     Node11->Node20 +elements Node12 double     Node12->Node2 #_threshold Node13 std::vector< cv::Mat >     Node13->Node2 #_projections Node14->Node2 #_eigenvalues #_eigenvectors #_labels #_mean Node14->Node13 +elements Node15 uint8_t     Node15->Node14 +data +dataend +datalimit +datastart Node16 cv::MatAllocator   + MatAllocator() + ~MatAllocator() + allocate() + allocate() + copy() + deallocate() + download() + getBufferPoolController() + map() + unmap() + upload() Node16->Node14 +allocator Node17 UMatData *     Node17->Node14 +u Node18 MatSize     Node18->Node14 +size Node19 MatStep     Node19->Node14 +step Node20->Node13 < cv::Mat >

Public Member Functions#

Public Member Functions inherited from cv::face::BasicFaceRecognizer
Public Member Functions inherited from cv::face::FaceRecognizer

Return

Name

Description

bool

empty()

String

getLabelInfo(int label)

Gets string information by label.

std::vector< int >

getLabelsByString(const String & str)

Gets vector of labels by string.

double

getThreshold()

threshold parameter accessor - required for default BestMinDist collector

int

predict(InputArray src)

void

predict(
    InputArray src,
    int & label,
    double & confidence )

Predicts a label and associated confidence (e.g. distance) for a given input image.

void

predict(
    InputArray src,
    Ptr< PredictCollector > collector )

if implemented - send all result of prediction to collector that can be used for somehow custom result handling

void

read(const FileNode & fn)

void

read(const String & filename)

Loads a FaceRecognizer and its model state.

void

setLabelInfo(
    int label,
    const String & strInfo )

Sets string info for the specified model’s label.

void

setThreshold(double val)

Sets threshold of model.

void

train(
    InputArrayOfArrays src,
    InputArray labels )

Trains a FaceRecognizer with given data and associated labels.

void

update(
    InputArrayOfArrays src,
    InputArray labels )

Updates a FaceRecognizer with given data and associated labels.

void

write(const String & filename)

Saves a FaceRecognizer and its model state.

void

write(FileStorage & fs)

Public Member Functions inherited from cv::Algorithm

Return

Name

Description

Algorithm()

~Algorithm()

void

clear()

Clears the algorithm state.

bool

empty()

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.

String

getDefaultName()

void

read(const FileNode & fn)

Reads algorithm parameters from a file storage.

void

save(const String & filename)

void

write(
    const Ptr< FileStorage > & fs,
    const String & name = String() )

void

write(FileStorage & fs)

Stores algorithm parameters in a file storage.

void

write(
    FileStorage & fs,
    const String & name )

Static Public Member Functions#

Static Public Member Functions inherited from cv::Algorithm

Return

Name

Description

static Ptr< _Tp >

load(
    const String & filename,
    const String & objname = String() )

Loads algorithm from the file.

static Ptr< _Tp >

loadFromString(
    const String & strModel,
    const String & objname = String() )

Loads algorithm from a String.

static Ptr< _Tp >

read(const FileNode & fn)

Reads algorithm from the file node.

Additional Inherited Members#

Protected Member Functions inherited from cv::Algorithm

Return

Name

Description

void

writeFormat(FileStorage & fs)

Protected Attributes inherited from cv::face::BasicFaceRecognizer

Return

Name

Description

Mat

_eigenvalues

Mat

_eigenvectors

Mat

_labels

Mat

_mean

int

_num_components

std::vector< Mat >

_projections

double

_threshold

Protected Attributes inherited from cv::face::FaceRecognizer

Return

Name

Description

std::map< int, String >

_labelsInfo

Member Function Documentation#

create()#

static Ptr< FisherFaceRecognizer > cv::face::FisherFaceRecognizer::create(
int num_components = 0,
double threshold = DBL_MAX )

Notes:#

  • Training and prediction must be done on grayscale images, use cvtColor to convert between the color spaces.

  • THE FISHERFACES METHOD MAKES THE ASSUMPTION, THAT THE TRAINING AND TEST IMAGES ARE OF EQUAL SIZE. (caps-lock, because I got so many mails asking for this). You have to make sure your input data has the correct shape, else a meaningful exception is thrown. Use resize to resize the images.

  • This model does not support updating.

Model internal data:#

  • num_components see FisherFaceRecognizer::create.

  • threshold see FisherFaceRecognizer::create.

  • eigenvalues The eigenvalues for this Linear Discriminant Analysis (ordered descending).

  • eigenvectors The eigenvectors for this Linear Discriminant Analysis (ordered by their eigenvalue).

  • mean The sample mean calculated from the training data.

  • projections The projections of the training data.

  • labels The labels corresponding to the projections.

Parameters

  • num_components — The number of components (read: Fisherfaces) kept for this Linear Discriminant Analysis with the Fisherfaces criterion. It’s useful to keep all components, that means the number of your classes c (read: subjects, persons you want to recognize). If you leave this at the default (0) or set it to a value less-equal 0 or greater (c-1), it will be set to the correct number (c-1) automatically.

  • threshold — The threshold applied in the prediction. If the distance to the nearest neighbor is larger than the threshold, this method returns -1.

Source file#

The documentation for this class was generated from the following file: