View Source Evision.ImgHash.PHash (Evision v0.2.9)

Summary

Types

t()

Type that represents an ImgHash.PHash 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

create

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

Reads algorithm parameters from a file storage

Stores algorithm parameters in a file storage

Types

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

Type that represents an ImgHash.PHash 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.ImgHash.PHash.t()

Python prototype (for reference only):

clear() -> None
@spec compare(Keyword.t()) :: any() | {:error, String.t()}
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
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(Keyword.t()) :: any() | {:error, String.t()}
@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.PHash.t()

  • inputArr: Evision.Mat.

    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.PHash.t()

  • inputArr: Evision.Mat.

    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 create() :: t() | {:error, String.t()}

create

Return
  • retval: Evision.ImgHash.PHash.t()

Python prototype (for reference only):

create() -> retval
@spec create(Keyword.t()) :: any() | {:error, String.t()}
@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.ImgHash.PHash.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.ImgHash.PHash.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(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 save(Keyword.t()) :: any() | {:error, String.t()}
@spec save(t(), binary()) :: t() | {:error, String.t()}

save

Positional Arguments
  • self: Evision.ImgHash.PHash.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(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