Renesas / opencv-lib

Dependents:   RZ_A2M_Mbed_samples

Embed: (wiki syntax)

« Back to documentation index

BOWKMeansTrainer Class Reference

BOWKMeansTrainer Class Reference
[Object Categorization]

kmeans -based class to train visual vocabulary using the *bag of visual words* approach. More...

#include <features2d.hpp>

Inherits cv::BOWTrainer.

Public Member Functions

CV_WRAP BOWKMeansTrainer (int clusterCount, const TermCriteria &termcrit=TermCriteria(), int attempts=3, int flags=KMEANS_PP_CENTERS)
 The constructor.
virtual CV_WRAP Mat cluster () const
virtual CV_WRAP Mat cluster (const Mat &descriptors) const
 Clusters train descriptors.
CV_WRAP void add (const Mat &descriptors)
 Adds descriptors to a training set.
CV_WRAP const std::vector< Mat > & getDescriptors () const
 Returns a training set of descriptors.
CV_WRAP int descriptorsCount () const
 Returns the count of all descriptors stored in the training set.

Detailed Description

kmeans -based class to train visual vocabulary using the *bag of visual words* approach.

:

Definition at line 1259 of file features2d.hpp.


Constructor & Destructor Documentation

CV_WRAP BOWKMeansTrainer ( int  clusterCount,
const TermCriteria termcrit = TermCriteria(),
int  attempts = 3,
int  flags = KMEANS_PP_CENTERS 
)

The constructor.

See also:
cv::kmeans

Member Function Documentation

CV_WRAP void add ( const Mat descriptors ) [inherited]

Adds descriptors to a training set.

Parameters:
descriptorsDescriptors 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.

virtual CV_WRAP Mat cluster ( const Mat descriptors ) const [virtual]

Clusters train descriptors.

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

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.

Implements BOWTrainer.

virtual CV_WRAP Mat cluster (  ) const [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements BOWTrainer.

CV_WRAP int descriptorsCount (  ) const [inherited]

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

CV_WRAP const std::vector<Mat>& getDescriptors (  ) const [inherited]

Returns a training set of descriptors.