Package org.opencv.features2d
Class BOWTrainer
- java.lang.Object
- 
- org.opencv.features2d.BOWTrainer
 
- 
- Direct Known Subclasses:
- BOWKMeansTrainer
 
 public class BOWTrainer extends java.lang.ObjectAbstract 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. :
- 
- 
Field SummaryFields Modifier and Type Field Description protected longnativeObj
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedBOWTrainer(long addr)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BOWTrainer__fromPtr__(long addr)voidadd(Mat descriptors)Adds descriptors to a training set.voidclear()Matcluster()Matcluster(Mat descriptors)Clusters train descriptors.intdescriptorsCount()Returns the count of all descriptors stored in the training set.protected voidfinalize()java.util.List<Mat>getDescriptors()Returns a training set of descriptors.longgetNativeObjAddr()
 
- 
- 
- 
Method Detail- 
getNativeObjAddrpublic long getNativeObjAddr() 
 - 
__fromPtr__public static BOWTrainer __fromPtr__(long addr) 
 - 
addpublic void add(Mat descriptors) Adds descriptors to a training set.- Parameters:
- descriptors- Descriptors 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.
 
 - 
getDescriptorspublic java.util.List<Mat> getDescriptors() Returns a training set of descriptors.- Returns:
- automatically generated
 
 - 
descriptorsCountpublic int descriptorsCount() Returns the count of all descriptors stored in the training set.- Returns:
- automatically generated
 
 - 
clearpublic void clear() 
 - 
clusterpublic Mat cluster() 
 - 
clusterpublic Mat cluster(Mat descriptors) Clusters train descriptors.- Parameters:
- 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.
- Returns:
- automatically generated
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 
- 
 
-