digiKam
Digikam::OpenCVDNNFaceRecognizer Class Reference

Classes

class  Private
 

Public Types

enum  Classifier { SVM = 0 , OpenCV_KNN , Tree , DB }
 

Public Member Functions

void clearTraining (const QList< int > &idsToClear, const QString &trainingContext)
 
 OpenCVDNNFaceRecognizer (Classifier method=Tree)
 OpenCVDNNFaceRecognizer:Master class to control entire recognition using OpenFace algorithm. More...
 
QVector< int > recognize (const QList< QImage * > &inputImages)
 
int recognize (QImage *inputImage)
 
bool registerTrainingData (const cv::Mat &preprocessedImage, int label)
 register training data for unit test More...
 
void setNbNeighBors (int k)
 
void setThreshold (float threshold)
 
void train (const QList< QImage * > &images, const int label, const QString &context)
 
int verifyTestData (const cv::Mat &preprocessedImage)
 predict label of test data for unit test More...
 
 ~OpenCVDNNFaceRecognizer ()
 

Static Public Member Functions

static cv::Mat prepareForRecognition (const cv::Mat &cvinputImage)
 
static cv::Mat prepareForRecognition (QImage &inputImage)
 

Member Enumeration Documentation

◆ Classifier

Enumerator
SVM 
OpenCV_KNN 
Tree 
DB 

Constructor & Destructor Documentation

◆ OpenCVDNNFaceRecognizer()

Digikam::OpenCVDNNFaceRecognizer::OpenCVDNNFaceRecognizer ( Classifier  method = Tree)
explicit

OpenCVDNNFaceRecognizer:Master class to control entire recognition using OpenFace algorithm.

◆ ~OpenCVDNNFaceRecognizer()

Digikam::OpenCVDNNFaceRecognizer::~OpenCVDNNFaceRecognizer ( )

Member Function Documentation

◆ clearTraining()

void Digikam::OpenCVDNNFaceRecognizer::clearTraining ( const QList< int > &  idsToClear,
const QString &  trainingContext 
)

clear specified trained data

References Digikam::FaceDb::clearDNNTraining(), and Digikam::FaceDbAccess::db().

◆ prepareForRecognition() [1/2]

cv::Mat Digikam::OpenCVDNNFaceRecognizer::prepareForRecognition ( const cv::Mat &  cvinputImage)
static

Returns a cvMat created from the cvinputImage, optimized for recognition

◆ prepareForRecognition() [2/2]

cv::Mat Digikam::OpenCVDNNFaceRecognizer::prepareForRecognition ( QImage &  inputImage)
static

◆ recognize() [1/2]

QVector< int > Digikam::OpenCVDNNFaceRecognizer::recognize ( const QList< QImage * > &  inputImages)

Try to recognize a list of given images. Returns a list of identity ids. If an identity cannot be recognized, returns -1.

◆ recognize() [2/2]

int Digikam::OpenCVDNNFaceRecognizer::recognize ( QImage *  inputImage)

◆ registerTrainingData()

bool Digikam::OpenCVDNNFaceRecognizer::registerTrainingData ( const cv::Mat &  preprocessedImage,
int  label 
)

◆ setNbNeighBors()

void Digikam::OpenCVDNNFaceRecognizer::setNbNeighBors ( int  k)

set K parameter of K-Nearest neighbors algorithm

References Digikam::OpenCVDNNFaceRecognizer::Private::kNeighbors.

Referenced by Digikam::FacialRecognitionWrapper::Private::applyParameters().

◆ setThreshold()

void Digikam::OpenCVDNNFaceRecognizer::setThreshold ( float  threshold)

◆ train()

void Digikam::OpenCVDNNFaceRecognizer::train ( const QList< QImage * > &  images,
const int  label,
const QString &  context 
)

◆ verifyTestData()

int Digikam::OpenCVDNNFaceRecognizer::verifyTestData ( const cv::Mat &  preprocessedImage)

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