OpenCV
3.1.0
Open Source Computer Vision
|
kmeans -based class to train visual vocabulary using the bag of visual words approach. : More...
#include "features2d.hpp"
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< Mat > | descriptors |
int | size |
kmeans -based class to train visual vocabulary using the bag of visual words approach. :
cv::BOWKMeansTrainer::BOWKMeansTrainer | ( | int | clusterCount, |
const TermCriteria & | termcrit = TermCriteria() , |
||
int | attempts = 3 , |
||
int | flags = KMEANS_PP_CENTERS |
||
) |
The constructor.
|
virtual |
|
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.
Clusters train descriptors.
descriptors | Descriptors 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.
|
protected |
|
protected |
|
protected |
|
protected |