Table of Contents

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 int

Number of clusters to split the set by.

termcrit MCvTermCriteria

Specifies maximum number of iterations and/or accuracy (distance the centers move by between the subsequent iterations). Use empty termcrit for default.

attempts int

The number of attempts. Use 3 for default

flags KMeansInitType

Kmeans initialization flag. Use PPCenters for default.

Properties

DescriptorCount

Get the number of descriptors

public int DescriptorCount { get; }

Property Value

int

Methods

Add(Mat)

Add the descriptors to the trainer

public void Add(Mat descriptors)

Parameters

descriptors Mat

The descriptors to be added to the trainer

Cluster(IOutputArray)

Cluster the descriptors and return the cluster centers

public void Cluster(IOutputArray cluster)

Parameters

cluster IOutputArray

The cluster centers

DisposeObject()

Release all the unmanaged memory associated with this object

protected override void DisposeObject()