kmeans -based class to train visual vocabulary using the bag of visual words approach. : More...
#include <features2d.hpp>
Public Member Functions | |
CV_WRAP | BOWKMeansTrainer (int clusterCount, const TermCriteria &termcrit=TermCriteria(), int attempts=3, int flags=KMEANS_PP_CENTERS) |
The constructor. More... | |
virtual | ~BOWKMeansTrainer () |
virtual CV_WRAP Mat | cluster () const CV_OVERRIDE |
virtual CV_WRAP Mat | cluster (const Mat &descriptors) const CV_OVERRIDE |
Clusters train descriptors. More... | |
Public Member Functions inherited from cv::BOWTrainer | |
BOWTrainer () | |
virtual | ~BOWTrainer () |
CV_WRAP void | add (const Mat &descriptors) |
Adds descriptors to a training set. More... | |
CV_WRAP const std::vector< Mat > & | getDescriptors () const |
Returns a training set of descriptors. More... | |
CV_WRAP int | descriptorsCount () const |
Returns the count of all descriptors stored in the training set. More... | |
virtual CV_WRAP void | clear () |
Protected Attributes | |
int | clusterCount |
TermCriteria | termcrit |
int | attempts |
int | flags |
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_WRAP cv::BOWKMeansTrainer::BOWKMeansTrainer | ( | int | clusterCount, |
const TermCriteria & | termcrit = TermCriteria() , |
||
int | attempts = 3 , |
||
int | flags = KMEANS_PP_CENTERS |
||
) |
The constructor.
|
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 |