View Source Evision.BOWTrainer (Evision v0.1.13)

Link to this section Summary

Types

t()

Type that represents an Evision.BOWTrainer struct.

Functions

Adds descriptors to a training set.

Python prototype (for reference):

Return

Has overloading in C++

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
  • 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):

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

Python prototype (for reference):

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

Has overloading in C++

Python prototype (for reference):

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
  • 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):

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

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

Return
  • retval: int

Python prototype (for reference):

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

Returns a training set of descriptors.

Return
  • retval: std::vector<Mat>

Python prototype (for reference):

getDescriptors() -> retval