Loading...
Searching...
No Matches
cv::face::LBPHFaceRecognizer Class Referenceabstract
#include <opencv2/face/facerec.hpp>
Inheritance diagram for cv::face::LBPHFaceRecognizer:
Public Member Functions | |
virtual int | getGridX () const =0 |
virtual int | getGridY () const =0 |
virtual std::vector< cv::Mat > | getHistograms () 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. | |
virtual std::vector< int > | getLabelsByString (const String &str) const |
Gets vector of labels by string. | |
virtual double | getThreshold () const =0 |
threshold parameter accessor - required for default BestMinDist collector | |
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. | |
virtual void | predict (InputArray src, Ptr< PredictCollector > collector) const =0 |
| |
virtual void | read (const FileNode &fn) CV_OVERRIDE=0 |
virtual void | read (const String &filename) |
Loads a FaceRecognizer and its model state. | |
virtual void | setLabelInfo (int label, const String &strInfo) |
Sets string info for the specified model's label. | |
virtual void | setThreshold (double val)=0 |
Sets threshold of model. | |
virtual void | train (InputArrayOfArrays src, InputArray labels)=0 |
Trains a FaceRecognizer with given data and associated labels. | |
virtual void | update (InputArrayOfArrays src, InputArray labels) |
Updates a FaceRecognizer with given data and associated labels. | |
virtual void | write (const String &filename) const |
Saves a FaceRecognizer and its model state. | |
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. | |
virtual bool | empty () const |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. | |
virtual String | getDefaultName () const |
virtual void | read (const FileNode &fn) |
Reads algorithm parameters from a file storage. | |
virtual void | save (const String &filename) const |
void | write (const Ptr< FileStorage > &fs, const String &name=String()) const |
virtual void | write (FileStorage &fs) const |
Stores algorithm parameters in a file storage. | |
void | write (FileStorage &fs, const String &name) const |
Static Public Member Functions | |
static Ptr< LBPHFaceRecognizer > | create (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. | |
template<typename _Tp > | |
static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
Loads algorithm from a String. | |
template<typename _Tp > | |
static Ptr< _Tp > | read (const FileNode &fn) |
Reads algorithm from the file node. | |
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 |
- 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.
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:
- radius see LBPHFaceRecognizer::create.
- neighbors see LBPHFaceRecognizer::create.
- grid_x see LLBPHFaceRecognizer::create.
- grid_y see LBPHFaceRecognizer::create.
- threshold see LBPHFaceRecognizer::create.
- histograms Local Binary Patterns Histograms calculated from the given training data (empty if none was given).
- labels Labels corresponding to the calculated Local Binary Patterns Histograms.
◆ getGridX()
|
pure virtual |
- See also
- setGridX
◆ getGridY()
|
pure virtual |
- See also
- setGridY
◆ getHistograms()
|
pure virtual |
◆ getLabels()
|
pure virtual |
◆ getNeighbors()
|
pure virtual |
- See also
- setNeighbors
◆ getRadius()
|
pure virtual |
- See also
- setRadius
◆ getThreshold()
|
pure virtual |
- See also
- setThreshold
Implements cv::face::FaceRecognizer.
◆ setGridX()
|
pure virtual |
- See also
- getGridX
◆ setGridY()
|
pure virtual |
- See also
- getGridY
◆ setNeighbors()
|
pure virtual |
- See also
- getNeighbors
◆ setRadius()
|
pure virtual |
- See also
- getRadius
◆ setThreshold()
|
pure virtual |
- See also
- getThreshold
Implements cv::face::FaceRecognizer.
The documentation for this class was generated from the following file:
- opencv2/face/facerec.hpp