View Source Evision.BOWTrainer (Evision v0.1.21)

Link to this section Summary

Types

t()

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

Link to this section Types

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

Type that represents an Evision.BOWTrainer struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

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

Adds descriptors to a training set.

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

  • descriptors: Evision.Mat.

    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()) :: :ok | {: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

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.

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

Return

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: std::vector<Mat>

Python prototype (for reference only):

getDescriptors() -> retval