View Source Evision.Face.MACE (Evision v0.2.9)

Summary

Types

t()

Type that represents an Face.MACE struct.

Functions

Clears the algorithm state

constructor

constructor

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

constructor

constructor

Reads algorithm parameters from a file storage

optionally encrypt images with random convolution

correlate query img and threshold to min class value

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

Stores algorithm parameters in a file storage

Types

@type t() :: %Evision.Face.MACE{ref: reference()}

Type that represents an Face.MACE struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec clear(Keyword.t()) :: any() | {:error, String.t()}
@spec clear(t()) :: t() | {:error, String.t()}

Clears the algorithm state

Positional Arguments
  • self: Evision.Face.MACE.t()

Python prototype (for reference only):

clear() -> None
@spec create() :: t() | {:error, String.t()}

constructor

Keyword Arguments
  • iMGSIZE: integer().

    images will get resized to this (should be an even number)

Return
  • retval: cv::Ptr<MACE>

Python prototype (for reference only):

create([, IMGSIZE]) -> retval
@spec create(Keyword.t()) :: any() | {:error, String.t()}
@spec create([{:iMGSIZE, term()}] | nil) :: t() | {:error, String.t()}

constructor

Keyword Arguments
  • iMGSIZE: integer().

    images will get resized to this (should be an even number)

Return
  • retval: cv::Ptr<MACE>

Python prototype (for reference only):

create([, IMGSIZE]) -> retval
@spec empty(Keyword.t()) :: any() | {:error, String.t()}
@spec empty(t()) :: boolean() | {:error, String.t()}

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read

Positional Arguments
  • self: Evision.Face.MACE.t()
Return
  • retval: bool

Python prototype (for reference only):

empty() -> retval
Link to this function

getDefaultName(named_args)

View Source
@spec getDefaultName(Keyword.t()) :: any() | {:error, String.t()}
@spec getDefaultName(t()) :: binary() | {:error, String.t()}

getDefaultName

Positional Arguments
  • self: Evision.Face.MACE.t()
Return

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.

Python prototype (for reference only):

getDefaultName() -> retval
@spec load(Keyword.t()) :: any() | {:error, String.t()}
@spec load(binary()) :: t() | {:error, String.t()}

constructor

Positional Arguments
  • filename: String.

    build a new MACE instance from a pre-serialized FileStorage

Keyword Arguments
  • objname: String.

    (optional) top-level node in the FileStorage

Return
  • retval: cv::Ptr<MACE>

Python prototype (for reference only):

load(filename[, objname]) -> retval
@spec load(binary(), [{:objname, term()}] | nil) :: t() | {:error, String.t()}

constructor

Positional Arguments
  • filename: String.

    build a new MACE instance from a pre-serialized FileStorage

Keyword Arguments
  • objname: String.

    (optional) top-level node in the FileStorage

Return
  • retval: cv::Ptr<MACE>

Python prototype (for reference only):

load(filename[, objname]) -> retval
@spec read(Keyword.t()) :: any() | {:error, String.t()}
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

Positional Arguments

Python prototype (for reference only):

read(fn) -> None
@spec salt(Keyword.t()) :: any() | {:error, String.t()}
@spec salt(t(), binary()) :: t() | {:error, String.t()}

optionally encrypt images with random convolution

Positional Arguments
  • self: Evision.Face.MACE.t()

  • passphrase: String.

    a crc64 random seed will get generated from this

Python prototype (for reference only):

salt(passphrase) -> None
@spec same(Keyword.t()) :: any() | {:error, String.t()}
@spec same(t(), Evision.Mat.maybe_mat_in()) :: boolean() | {:error, String.t()}

correlate query img and threshold to min class value

Positional Arguments
  • self: Evision.Face.MACE.t()

  • query: Evision.Mat.

    a Mat with query image

Return
  • retval: bool

Python prototype (for reference only):

same(query) -> retval
@spec save(Keyword.t()) :: any() | {:error, String.t()}
@spec save(t(), binary()) :: t() | {:error, String.t()}

save

Positional Arguments
  • self: Evision.Face.MACE.t()
  • filename: String

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).

Python prototype (for reference only):

save(filename) -> None
@spec train(Keyword.t()) :: any() | {:error, String.t()}
@spec train(t(), [Evision.Mat.maybe_mat_in()]) :: t() | {:error, String.t()}

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

Positional Arguments
  • self: Evision.Face.MACE.t()

  • images: [Evision.Mat].

    a vector<Mat> with the train images

Python prototype (for reference only):

train(images) -> None
@spec write(Keyword.t()) :: any() | {:error, String.t()}
@spec write(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}

Stores algorithm parameters in a file storage

Positional Arguments

Python prototype (for reference only):

write(fs) -> None
@spec write(t(), Evision.FileStorage.t(), binary()) :: t() | {:error, String.t()}

write

Positional Arguments

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None