Class BOWKMeansTrainer
- Namespace
- Emgu.CV.Features2D
- Assembly
- Emgu.CV.dll
Kmeans-based class to train visual vocabulary using the bag of visual words approach.
public class BOWKMeansTrainer : UnmanagedObject, IDisposable
- Inheritance
-
BOWKMeansTrainer
- Implements
- Inherited Members
Constructors
BOWKMeansTrainer(int, MCvTermCriteria, int, KMeansInitType)
Create a new BOWKmeans trainer
public BOWKMeansTrainer(int clusterCount, MCvTermCriteria termcrit, int attempts = 3, KMeansInitType flags = KMeansInitType.PPCenters)
Parameters
clusterCount
intNumber of clusters to split the set by.
termcrit
MCvTermCriteriaSpecifies maximum number of iterations and/or accuracy (distance the centers move by between the subsequent iterations). Use empty termcrit for default.
attempts
intThe number of attempts. Use 3 for default
flags
KMeansInitTypeKmeans initialization flag. Use PPCenters for default.
Properties
DescriptorCount
Get the number of descriptors
public int DescriptorCount { get; }
Property Value
Methods
Add(Mat)
Add the descriptors to the trainer
public void Add(Mat descriptors)
Parameters
descriptors
MatThe descriptors to be added to the trainer
Cluster(IOutputArray)
Cluster the descriptors and return the cluster centers
public void Cluster(IOutputArray cluster)
Parameters
cluster
IOutputArrayThe cluster centers
DisposeObject()
Release all the unmanaged memory associated with this object
protected override void DisposeObject()