OpenCV  3.4.19
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | List of all members
cv::face::LBPHFaceRecognizer Class Referenceabstract

#include <opencv2/face/facerec.hpp>

Inheritance diagram for cv::face::LBPHFaceRecognizer:
cv::face::FaceRecognizer cv::Algorithm

Public Member Functions

virtual int getGridX () const =0
 
virtual int getGridY () const =0
 
virtual std::vector< cv::MatgetHistograms () const =0
 
virtual cv::Mat getLabels () const =0
 
virtual int getNeighbors () const =0
 
virtual int getRadius () const =0
 
virtual double getThreshold () const CV_OVERRIDE=0
 
virtual void setGridX (int val)=0
 
virtual void setGridY (int val)=0
 
virtual void setNeighbors (int val)=0
 
virtual void setRadius (int val)=0
 
virtual void setThreshold (double val) CV_OVERRIDE=0
 
- Public Member Functions inherited from cv::face::FaceRecognizer
virtual bool empty () const CV_OVERRIDE=0
 
virtual String getLabelInfo (int label) const
 Gets string information by label. More...
 
virtual std::vector< int > getLabelsByString (const String &str) const
 Gets vector of labels by string. More...
 
int predict (InputArray src) const
 
void predict (InputArray src, int &label, double &confidence) const
 Predicts a label and associated confidence (e.g. distance) for a given input image. More...
 
virtual void predict (InputArray src, Ptr< PredictCollector > collector) const =0
 
  • if implemented - send all result of prediction to collector that can be used for somehow custom result handling
More...
 
virtual void read (const String &filename)
 Loads a FaceRecognizer and its model state. More...
 
virtual void read (const FileNode &fn) CV_OVERRIDE=0
 
virtual void setLabelInfo (int label, const String &strInfo)
 Sets string info for the specified model's label. More...
 
virtual void train (InputArrayOfArrays src, InputArray labels)=0
 Trains a FaceRecognizer with given data and associated labels. More...
 
virtual void update (InputArrayOfArrays src, InputArray labels)
 Updates a FaceRecognizer with given data and associated labels. More...
 
virtual void write (const String &filename) const
 Saves a FaceRecognizer and its model state. More...
 
virtual void write (FileStorage &fs) const CV_OVERRIDE=0
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
virtual String getDefaultName () const
 
virtual void save (const String &filename) const
 
void write (FileStorage &fs, const String &name) const
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 

Static Public Member Functions

static Ptr< LBPHFaceRecognizercreate (int radius=1, int neighbors=8, int grid_x=8, int grid_y=8, double threshold=DBL_MAX)
 
- Static Public Member Functions inherited from cv::Algorithm
template<typename _Tp >
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file. More...
 
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String. More...
 
template<typename _Tp >
static Ptr< _Tp > read (const FileNode &fn)
 Reads algorithm from the file node. More...
 

Additional Inherited Members

- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 
- Protected Attributes inherited from cv::face::FaceRecognizer
std::map< int, String_labelsInfo
 

Member Function Documentation

◆ 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 
)
static
Python:
cv.face.LBPHFaceRecognizer.create([, radius[, neighbors[, grid_x[, grid_y[, threshold]]]]]) -> retval
cv.face.LBPHFaceRecognizer_create([, radius[, neighbors[, grid_x[, grid_y[, threshold]]]]]) -> retval
Parameters
radiusThe radius used for building the Circular Local Binary Pattern. The greater the radius, the smoother the image but more spatial information you can get.
neighborsThe 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_xThe 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_yThe 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.
thresholdThe threshold applied in the prediction. If the distance to the nearest neighbor is larger than the threshold, this method returns -1.

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:

◆ getGridX()

virtual int cv::face::LBPHFaceRecognizer::getGridX ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getGridX() -> retval
See also
setGridX

◆ getGridY()

virtual int cv::face::LBPHFaceRecognizer::getGridY ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getGridY() -> retval
See also
setGridY

◆ getHistograms()

virtual std::vector<cv::Mat> cv::face::LBPHFaceRecognizer::getHistograms ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getHistograms() -> retval

◆ getLabels()

virtual cv::Mat cv::face::LBPHFaceRecognizer::getLabels ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getLabels() -> retval

◆ getNeighbors()

virtual int cv::face::LBPHFaceRecognizer::getNeighbors ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getNeighbors() -> retval
See also
setNeighbors

◆ getRadius()

virtual int cv::face::LBPHFaceRecognizer::getRadius ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getRadius() -> retval
See also
setRadius

◆ getThreshold()

virtual double cv::face::LBPHFaceRecognizer::getThreshold ( ) const
pure virtual
Python:
cv.face.LBPHFaceRecognizer.getThreshold() -> retval

◆ setGridX()

virtual void cv::face::LBPHFaceRecognizer::setGridX ( int  val)
pure virtual
Python:
cv.face.LBPHFaceRecognizer.setGridX(val) -> None

See also
getGridX

◆ setGridY()

virtual void cv::face::LBPHFaceRecognizer::setGridY ( int  val)
pure virtual
Python:
cv.face.LBPHFaceRecognizer.setGridY(val) -> None

See also
getGridY

◆ setNeighbors()

virtual void cv::face::LBPHFaceRecognizer::setNeighbors ( int  val)
pure virtual
Python:
cv.face.LBPHFaceRecognizer.setNeighbors(val) -> None

See also
getNeighbors

◆ setRadius()

virtual void cv::face::LBPHFaceRecognizer::setRadius ( int  val)
pure virtual
Python:
cv.face.LBPHFaceRecognizer.setRadius(val) -> None

See also
getRadius

◆ setThreshold()

virtual void cv::face::LBPHFaceRecognizer::setThreshold ( double  val)
pure virtual
Python:
cv.face.LBPHFaceRecognizer.setThreshold(val) -> None

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