OpenCV  3.0.0-rc1
Open Source Computer Vision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
cv::BOWKMeansTrainer Class Reference

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

#include "features2d.hpp"

Inheritance diagram for cv::BOWKMeansTrainer:
cv::BOWTrainer

Public Member Functions

 BOWKMeansTrainer (int clusterCount, const TermCriteria &termcrit=TermCriteria(), int attempts=3, int flags=KMEANS_PP_CENTERS)
 The constructor. More...
 
virtual ~BOWKMeansTrainer ()
 
virtual Mat cluster () const
 
virtual Mat cluster (const Mat &descriptors) const
 Clusters train descriptors. More...
 
- Public Member Functions inherited from cv::BOWTrainer
 BOWTrainer ()
 
virtual ~BOWTrainer ()
 
void add (const Mat &descriptors)
 Adds descriptors to a training set. More...
 
virtual void clear ()
 
int descriptorsCount () const
 Returns the count of all descriptors stored in the training set. More...
 
const std::vector< Mat > & getDescriptors () const
 Returns a training set of descriptors. More...
 

Protected Attributes

int attempts
 
int clusterCount
 
int flags
 
TermCriteria termcrit
 
- Protected Attributes inherited from cv::BOWTrainer
std::vector< Matdescriptors
 
int size
 

Detailed Description

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

Constructor & Destructor Documentation

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

The constructor.

See also
cv::kmeans
virtual cv::BOWKMeansTrainer::~BOWKMeansTrainer ( )
virtual

Member Function Documentation

virtual Mat cv::BOWKMeansTrainer::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 cv::BOWTrainer.

virtual Mat cv::BOWKMeansTrainer::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 cv::BOWTrainer.

Member Data Documentation

int cv::BOWKMeansTrainer::attempts
protected
int cv::BOWKMeansTrainer::clusterCount
protected
int cv::BOWKMeansTrainer::flags
protected
TermCriteria cv::BOWKMeansTrainer::termcrit
protected

The documentation for this class was generated from the following file: