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)
More...
#include <opencv2/face/mace.hpp>
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: [239]
this implementation is largely based on: https://code.google.com/archive/p/pam-face-authentication (GSOC 2009)
use it like:
vector<Mat> pos_images = ...
mace->train(pos_images);
Mat query = ...
bool
same = mace->same(query);
static cv::Ptr< MACE > create(int IMGSIZE=64)
constructor
virtual bool same(cv::InputArray query) const =0
correlate query img and threshold to min class value
you can also use two-factor authentication, with an additional passphrase:
String owners_passphrase =
"ilikehotdogs";
mace->salt(owners_passphrase);
vector<Mat> pos_images = ...
mace->train(pos_images);
Mat query = ...
cout << "enter passphrase: ";
string pass;
getline(cin, pass);
mace->salt(pass);
bool same = mace->same(query);
std::string String
Definition: cvstd.hpp:149
save/load your model:
mace->train(pos_images);
mace->save("my_mace.xml");
reloaded->same(some_image);
static cv::Ptr< MACE > load(const String &filename, const String &objname=String())
constructor
◆ create()
| static cv::Ptr<MACE> cv::face::MACE::create |
( |
int |
IMGSIZE = 64 | ) |
|
|
static |
| Python: |
|---|
| cv.face.MACE.create( | [, IMGSIZE] | ) -> | retval |
| cv.face.MACE_create( | [, IMGSIZE] | ) -> | retval |
constructor
- Parameters
-
| IMGSIZE | images will get resized to this (should be an even number) |
◆ load()
| Python: |
|---|
| cv.face.MACE.load( | filename[, objname] | ) -> | retval |
| cv.face.MACE_load( | filename[, objname] | ) -> | retval |
◆ salt()
| virtual void cv::face::MACE::salt |
( |
const cv::String & |
passphrase | ) |
|
|
pure virtual |
| Python: |
|---|
| cv.face.MACE.salt( | passphrase | ) -> | None |
optionally encrypt images with random convolution
- Parameters
-
| passphrase | a crc64 random seed will get generated from this |
◆ same()
| Python: |
|---|
| cv.face.MACE.same( | query | ) -> | retval |
correlate query img and threshold to min class value
- Parameters
-
| query | a Mat with query image |
◆ train()
| Python: |
|---|
| cv.face.MACE.train( | images | ) -> | None |
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 vector<Mat> with the train images |
The documentation for this class was generated from the following file: