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

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

getDefaultName

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(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: int.

    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([{atom(), term()}, ...] | nil) :: t() | {:error, String.t()}

constructor

Keyword Arguments
  • iMGSIZE: int.

    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(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
@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(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(), [{atom(), 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(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

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

Python prototype (for reference only):

read(fn_) -> None
@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(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.t().

    a Mat with query image

Return
  • retval: bool

Python prototype (for reference only):

same(query) -> retval
@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(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(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}

Stores algorithm parameters in a file storage

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

Python prototype (for reference only):

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

write

Positional Arguments
  • self: Evision.Face.MACE.t()
  • fs: Evision.FileStorage.t()
  • name: String

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None