Class cv::face::LBPHFaceRecognizer#

Collaboration diagram for cv::face::LBPHFaceRecognizer:

Public Member Functions#

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::FaceRecognizer

Return

Name

Description

std::map< int, String >

_labelsInfo

Member Function Documentation#

getGridX()#

int cv::face::LBPHFaceRecognizer::getGridX()

See also

setGridX

getGridY()#

int cv::face::LBPHFaceRecognizer::getGridY()

See also

setGridY

getHistograms()#

std::vector< cv::Mat > cv::face::LBPHFaceRecognizer::getHistograms()

getLabels()#

cv::Mat cv::face::LBPHFaceRecognizer::getLabels()

getNeighbors()#

int cv::face::LBPHFaceRecognizer::getNeighbors()

See also

setNeighbors

getRadius()#

int cv::face::LBPHFaceRecognizer::getRadius()

See also

setRadius

getThreshold()#

double cv::face::LBPHFaceRecognizer::getThreshold()

See also

setThreshold

setGridX()#

void cv::face::LBPHFaceRecognizer::setGridX(int val)

See also

getGridX

setGridY()#

void cv::face::LBPHFaceRecognizer::setGridY(int val)

See also

getGridY

setNeighbors()#

void cv::face::LBPHFaceRecognizer::setNeighbors(int val)

See also

getNeighbors

setRadius()#

void cv::face::LBPHFaceRecognizer::setRadius(int val)

See also

getRadius

setThreshold()#

void cv::face::LBPHFaceRecognizer::setThreshold(double val)

See also

getThreshold

create()#

static Ptr< LBPHFaceRecognizer > cv::face::LBPHFaceRecognizer::create(
int radius = 1,
int neighbors = 8,
int grid_x = 8,
int grid_y = 8,
double threshold = DBL_MAX )

Notes:#

  • The Circular Local Binary Patterns (used in training and prediction) expect the data given as grayscale images, use cvtColor to convert between the color spaces.

  • This model supports updating.

Model internal data:#

Parameters

  • radius — The radius used for building the Circular Local Binary Pattern. The greater the radius, the smoother the image but more spatial information you can get.

  • neighbors — The number of sample points to build a Circular Local Binary Pattern from. An appropriate value is to use 8 sample points. Keep in mind: the more sample points you include, the higher the computational cost.

  • grid_x — The number of cells in the horizontal direction, 8 is a common value used in publications. The more cells, the finer the grid, the higher the dimensionality of the resulting feature vector.

  • grid_y — The number of cells in the vertical direction, 8 is a common value used in publications. The more cells, the finer the grid, the higher the dimensionality of the resulting feature vector.

  • 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: