View Source Evision.BOWTrainer (Evision v0.1.37)

Summary

Types

t()

Type that represents an BOWTrainer struct.

Functions

Adds descriptors to a training set.

clear

cluster

Clusters train descriptors.

Returns the count of all descriptors stored in the training set.

Returns a training set of descriptors.

Types

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

Type that represents an BOWTrainer struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec add(t(), Evision.Mat.maybe_mat_in()) :: t() | {:error, String.t()}

Adds descriptors to a training set.

Positional Arguments
  • self: Evision.BOWTrainer.t()

  • descriptors: Evision.Mat.t().

    Descriptors to add to a training set. Each row of the descriptors matrix is a descriptor.

The training set is clustered using clustermethod to construct the vocabulary.

Python prototype (for reference only):

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

clear

Positional Arguments
  • self: Evision.BOWTrainer.t()

Python prototype (for reference only):

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

cluster

Positional Arguments
  • self: Evision.BOWTrainer.t()
Return
  • retval: Evision.Mat.t()

Has overloading in C++

Python prototype (for reference only):

cluster() -> retval
Link to this function

cluster(self, descriptors)

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

Clusters train descriptors.

Positional Arguments
  • self: Evision.BOWTrainer.t()

  • descriptors: Evision.Mat.t().

    Descriptors to cluster. Each row of the descriptors matrix is a descriptor. Descriptors are not added to the inner train descriptor set.

Return
  • retval: Evision.Mat.t()

The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first variant of the method, train descriptors stored in the object are clustered. In the second variant, input descriptors are clustered.

Python prototype (for reference only):

cluster(descriptors) -> retval
@spec descriptorsCount(t()) :: integer() | {:error, String.t()}

Returns the count of all descriptors stored in the training set.

Positional Arguments
  • self: Evision.BOWTrainer.t()
Return
  • retval: int

Python prototype (for reference only):

descriptorsCount() -> retval
@spec getDescriptors(t()) :: [Evision.Mat.t()] | {:error, String.t()}

Returns a training set of descriptors.

Positional Arguments
  • self: Evision.BOWTrainer.t()
Return
  • retval: [Evision.Mat]

Python prototype (for reference only):

getDescriptors() -> retval