org.opencv.face

## Class MACE

- java.lang.Object
- - org.opencv.core.Algorithm
  - - org.opencv.face.MACE

-     public class MACE
      extends Algorithm

  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: CITE: Savvides04 this implementation is largely based on: https://code.google.com/archive/p/pam-face-authentication (GSOC 2009) use it like: `Ptr<face::MACE> mace = face::MACE::create(64); vector<Mat> pos_images = ... mace->train(pos_images); Mat query = ... bool same = mace->same(query);` 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: `Ptr<face::MACE> mace = face::MACE::create(64); mace->train(pos_images); mace->save("my_mace.xml"); // later: Ptr<MACE> reloaded = MACE::load("my_mace.xml"); reloaded->same(some_image);`

- - ### Field Summary

    - ### Fields inherited from class org.opencv.core.Algorithm

      `nativeObj`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MACE(long addr)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MACE` | `__fromPtr__(long addr)`
    `static MACE` | `create()` constructor
    `static MACE` | `create(int IMGSIZE)` constructor
    `protected void` | `finalize()`
    `static MACE` | `load(String filename)` constructor
    `static MACE` | `load(String filename, String objname)` constructor
    `void` | `salt(String passphrase)` optionally encrypt images with random convolution
    `boolean` | `same(Mat query)` correlate query img and threshold to min class value
    `void` | `train(List<Mat> 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

    - ### Methods inherited from class org.opencv.core.Algorithm

      `clear, empty, getDefaultName, getNativeObjAddr, save`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MACE

          protected MACE(long addr)

  - ### Method Detail

    - #### __fromPtr__

          public static MACE __fromPtr__(long addr)

    - #### create

          public static MACE create(int IMGSIZE)

      constructor
      Parameters:
        `IMGSIZE` - images will get resized to this (should be an even number)
      Returns:
        automatically generated

    - #### create

          public static MACE create()

      constructor
      Returns:
        automatically generated

    - #### load

          public static MACE load(String filename,
                                  String objname)

      constructor
      Parameters:
        `filename` - build a new MACE instance from a pre-serialized FileStorage
        `objname` - (optional) top-level node in the FileStorage
      Returns:
        automatically generated

    - #### load

          public static MACE load(String filename)

      constructor
      Parameters:
        `filename` - build a new MACE instance from a pre-serialized FileStorage
      Returns:
        automatically generated

    - #### same

          public boolean same(Mat query)

      correlate query img and threshold to min class value
      Parameters:
        `query` - a Mat with query image
      Returns:
        automatically generated

    - #### salt

          public void salt(String passphrase)

      optionally encrypt images with random convolution
      Parameters:
        `passphrase` - a crc64 random seed will get generated from this

    - #### train

          public void train(List<Mat> 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 vector<Mat> with the train images

    - #### finalize

          protected void finalize()
                           throws Throwable

      Overrides:
        `finalize` in class `Algorithm`
      Throws:
        `Throwable`

Generated on Wed Oct 9 2019 16:55:37 UTC / OpenCV 3.4.8