Class cv::xfeatures2d::BOWTrainer#
Abstract base class for training the bag of visual words vocabulary from a set of descriptors. View details
#include <opencv2/xfeatures2d.hpp>Collaboration diagram for cv::xfeatures2d::BOWTrainer:
Detailed Description#
Abstract base class for training the bag of visual words vocabulary from a set of descriptors.
For details, see, for example, Visual Categorization with Bags of Keypoints by Gabriella Csurka, Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. :
Constructor & Destructor Documentation#
BOWTrainer()#
cv::xfeatures2d::BOWTrainer::BOWTrainer()
~BOWTrainer()#
cv::xfeatures2d::BOWTrainer::~BOWTrainer()
Member Function Documentation#
add()#
void cv::xfeatures2d::BOWTrainer::add(const Mat & descriptors)
Adds descriptors to a training set.
The training set is clustered using clustermethod to construct the vocabulary.
Parameters
descriptors— Descriptors to add to a training set. Each row of the descriptors matrix is a descriptor.
clear()#
void cv::xfeatures2d::BOWTrainer::clear()
cluster()#
Mat cv::xfeatures2d::BOWTrainer::cluster()
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cluster()#
Mat cv::xfeatures2d::BOWTrainer::cluster(const Mat & descriptors)
Clusters train descriptors.
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.
Parameters
descriptors— Descriptors to cluster. Each row of the descriptors matrix is a descriptor. Descriptors are not added to the inner train descriptor set.
descriptorsCount()#
int cv::xfeatures2d::BOWTrainer::descriptorsCount()
Returns the count of all descriptors stored in the training set.
getDescriptors()#
const std::vector< Mat > & cv::xfeatures2d::BOWTrainer::getDescriptors()
Returns a training set of descriptors.
Member Data Documentation#
descriptors#
std::vector< Mat > cv::xfeatures2d::BOWTrainer::descriptors
size#
int cv::xfeatures2d::BOWTrainer::size
Source file#
The documentation for this class was generated from the following file:
opencv2/xfeatures2d.hpp