Reputation: 185
I want to cluster some (x,y) coordinates based on distance using agglomerative hierarchical clustering as number of clusters are not known before. Is there any library that supports this task? Iam doing in c++ using Opencv libraries.
Upvotes: 0
Views: 1293
Reputation: 5354
In Gesture Recognition Toolkit (GRT) there is a simple module for hierarchical clustering. This is a "bottom up" approach as you need, where each observation starts in its own cluster, and pairs of clusters are merged as one moves up the hierarchy.
You can train the method by:
UnlabelledData
: The only thing you really need to know about the UnlabelledData
class is that you must set the number of input dimensions of your dataset before you try and add samples to the training dataset.
0
when you add a new sample to your dataset. This is because the class label of 0
is reserved for the special null gesture class.MatrixDouble
: MatrixDouble
is the default datatype for storing M
by N
dimensional data, where M
is the number of rows and N
is the number of columns.
Furthermore you can save or load your models from/to a file and get the clusters by getClusters()
.
Upvotes: 1
Reputation: 1652
This is a link for K-Means clustering in OpenCV for Python. Shouldn't be too hard to convert this to c++ code once you understand the logic
Upvotes: 1