digiKam
|
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) |
|
explicit |
OpenCVDNNFaceRecognizer:Master class to control entire recognition using OpenFace algorithm.
Digikam::OpenCVDNNFaceRecognizer::~OpenCVDNNFaceRecognizer | ( | ) |
void Digikam::OpenCVDNNFaceRecognizer::clearTraining | ( | const QList< int > & | idsToClear, |
const QString & | trainingContext | ||
) |
clear specified trained data
References Digikam::FaceDb::clearDNNTraining(), and Digikam::FaceDbAccess::db().
|
static |
Returns a cvMat created from the cvinputImage, optimized for recognition
|
static |
Returns a cvMat created from the inputImage, optimized for recognition
Referenced by Digikam::OpenCVDNNFaceRecognizer::Private::ParallelRecognizer::operator()(), Digikam::OpenCVDNNFaceRecognizer::Private::ParallelTrainer::operator()(), and recognize().
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.
int Digikam::OpenCVDNNFaceRecognizer::recognize | ( | QImage * | inputImage | ) |
Try to recognize the given image. Returns the identity id. If the identity cannot be recognized, returns -1. TODO: verify workflow to economize this routine
References DB, Digikam::OpenCVDNNFaceRecognizer::Private::extractors, Digikam::OpenCVDNNFaceRecognizer::Private::method, OpenCV_KNN, Digikam::OpenCVDNNFaceRecognizer::Private::predictDb(), Digikam::OpenCVDNNFaceRecognizer::Private::predictKDTree(), Digikam::OpenCVDNNFaceRecognizer::Private::predictKNN(), Digikam::OpenCVDNNFaceRecognizer::Private::predictSVM(), prepareForRecognition(), SVM, and Tree.
Referenced by Digikam::FacialRecognitionWrapper::recognizeFaces().
bool Digikam::OpenCVDNNFaceRecognizer::registerTrainingData | ( | const cv::Mat & | preprocessedImage, |
int | label | ||
) |
register training data for unit test
References Digikam::KDTree::add(), Digikam::OpenCVDNNFaceRecognizer::Private::extractors, Digikam::OpenCVDNNFaceRecognizer::Private::method, Tree, and Digikam::OpenCVDNNFaceRecognizer::Private::tree.
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().
void Digikam::OpenCVDNNFaceRecognizer::setThreshold | ( | float | threshold | ) |
set maximum square distance of 2 vector
References Digikam::OpenCVDNNFaceRecognizer::Private::threshold.
Referenced by Digikam::FacialRecognitionWrapper::Private::applyParameters().
void Digikam::OpenCVDNNFaceRecognizer::train | ( | const QList< QImage * > & | images, |
const int | label, | ||
const QString & | context | ||
) |
Register faces corresponding to an identity
References Digikam::OpenCVDNNFaceRecognizer::Private::newDataAdded.
Referenced by Digikam::FacialRecognitionWrapper::Private::trainIdentityBatch().
int Digikam::OpenCVDNNFaceRecognizer::verifyTestData | ( | const cv::Mat & | preprocessedImage | ) |
predict label of test data for unit test
References Digikam::OpenCVDNNFaceRecognizer::Private::extractors, Digikam::OpenCVDNNFaceRecognizer::Private::method, Digikam::OpenCVDNNFaceRecognizer::Private::predictKDTree(), and Tree.