Class cv::face::MACE#
Minimum Average Correlation Energy Filter useful for authentication with (cancellable) biometrical features. (does not need many positives to train (10-50), and no negatives at all, also robust to noise/salting) View details
#include <opencv2/face/mace.hpp>Collaboration diagram for cv::face::MACE:
Public Member Functions#
Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Clears the algorithm state. |
|
|
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. |
|
|
Reads algorithm parameters from a file storage. |
|
|
||
|
|
|
|
Stores algorithm parameters in a file storage. |
|
|
Static Public Member Functions#
Static Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
|
Loads algorithm from the file. |
|
|
Loads algorithm from a String. |
|
Reads algorithm from the file node. |
Additional Inherited Members#
Protected Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Detailed Description#
Minimum Average Correlation Energy Filter useful for authentication with (cancellable) biometrical features. (does not need many positives to train (10-50), and no negatives at all, also robust to noise/salting)
see also: Savvides04
this implementation is largely based on: https://code.google.com/archive/p/pam-face-authentication (GSOC 2009)
use it like:
you can also use two-factor authentication, with an additional passphrase:
String owners_passphrase = "ilikehotdogs";
Ptr<face::MACE> mace = face::MACE::create(64);
mace->salt(owners_passphrase);
vector<Mat> pos_images = ...
mace->train(pos_images);
// now, users have to give a valid passphrase, along with the image:
Mat query = ...
cout << "enter passphrase: ";
string pass;
getline(cin, pass);
mace->salt(pass);
bool same = mace->same(query);
save/load your model:
Member Function Documentation#
salt()#
void cv::face::MACE::salt(const cv::String & passphrase)
optionally encrypt images with random convolution
Parameters
passphrase— a crc64 random seed will get generated from this
same()#
bool cv::face::MACE::same(cv::InputArray query)
correlate query img and threshold to min class value
Parameters
query— a Mat with query image
train()#
void cv::face::MACE::train(cv::InputArrayOfArrays images)
train it on positive features compute the mace filter: h = D(-1) * X * (X(+) * D(-1) * X)(-1) * C also calculate a minimal threshold for this class, the smallest self-similarity from the train images
Parameters
images— a vectorwith the train images
create()#
static cv::Ptr< MACE > cv::face::MACE::create(int IMGSIZE = 64)
constructor
Parameters
IMGSIZE— images will get resized to this (should be an even number)
load()#
static cv::Ptr< MACE > cv::face::MACE::load(
const String & filename,
const String & objname = String() )
constructor
Parameters
filename— build a new MACE instance from a pre-serialized FileStorageobjname— (optional) top-level node in the FileStorage
Source file#
The documentation for this class was generated from the following file:
opencv2/face/mace.hpp