@Namespace(value="cv") @NoOffset @Properties(inherit=opencv_features2d.class) public class BOWTrainer extends Pointer
/** \brief 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. :
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
BOWTrainer(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Mat descriptors)
\brief Adds descriptors to a training set.
|
void |
clear() |
Mat |
cluster()
\overload
|
Mat |
cluster(Mat descriptors)
\brief Clusters train descriptors.
|
int |
descriptorsCount()
\brief Returns the count of all descriptors stored in the training set.
|
MatVector |
getDescriptors()
\brief Returns a training set of descriptors.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public BOWTrainer(Pointer p)
Pointer.Pointer(Pointer)
.public void add(@Const @ByRef Mat descriptors)
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.
@Const @ByRef public MatVector getDescriptors()
public int descriptorsCount()
public void clear()
@ByVal public Mat cluster(@Const @ByRef Mat 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.
Copyright © 2020. All rights reserved.