View Source Evision.ImgHash.ImgHashBase (Evision v0.1.38)

Summary

Types

t()

Type that represents an ImgHash.ImgHashBase struct.

Functions

Clears the algorithm state

Compare the hash value between inOne and inTwo

Computes hash of the input image

Computes hash of the input image

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

getDefaultName

Reads algorithm parameters from a file storage

Stores algorithm parameters in a file storage

Types

@type t() :: %Evision.ImgHash.ImgHashBase{ref: reference()}

Type that represents an ImgHash.ImgHashBase struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

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

Clears the algorithm state

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.t()

Python prototype (for reference only):

clear() -> None
Link to this function

compare(self, hashOne, hashTwo)

View Source
@spec compare(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in()) ::
  number() | {:error, String.t()}

Compare the hash value between inOne and inTwo

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.t()

  • hashOne: Evision.Mat.t().

    Hash value one

  • hashTwo: Evision.Mat.t().

    Hash value two

Return
  • retval: double

@return value indicate similarity between inOne and inTwo, the meaning of the value vary from algorithms to algorithms

Python prototype (for reference only):

compare(hashOne, hashTwo) -> retval
@spec compute(t(), Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | {:error, String.t()}

Computes hash of the input image

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.t()

  • inputArr: Evision.Mat.t().

    input image want to compute hash value

Return
  • outputArr: Evision.Mat.t().

    hash of the image

Python prototype (for reference only):

compute(inputArr[, outputArr]) -> outputArr
Link to this function

compute(self, inputArr, opts)

View Source
@spec compute(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Computes hash of the input image

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.t()

  • inputArr: Evision.Mat.t().

    input image want to compute hash value

Return
  • outputArr: Evision.Mat.t().

    hash of the image

Python prototype (for reference only):

compute(inputArr[, outputArr]) -> outputArr
@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.ImgHash.ImgHashBase.t()
Return
  • retval: bool

Python prototype (for reference only):

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

getDefaultName

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.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 read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}

Reads algorithm parameters from a file storage

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.t()
  • fn_: Evision.FileNode.t()

Python prototype (for reference only):

read(fn_) -> None
@spec save(t(), binary()) :: t() | {:error, String.t()}

save

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.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 write(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}

Stores algorithm parameters in a file storage

Positional Arguments
  • self: Evision.ImgHash.ImgHashBase.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.ImgHash.ImgHashBase.t()
  • fs: Evision.FileStorage.t()
  • name: String

Has overloading in C++

Python prototype (for reference only):

write(fs, name) -> None