views:

54

answers:

1

Hi all,

I am writing a program in C# in which I have a set of 200 points displayed on an image. However, the points tend to cluster in various regions, and I am looking to find a way to "cluster." In other words, maybe draw a circle/ellipse around the clustered points.

Has anyone seen any way to do this? I have heard about K-means clustering, but I am not sure how to implement it in C#.

Any favorite implementations out there?

Cheers, Brett

A: 

K-Means will give you the centre of the cluster and a list of component points. You could then draw a circle around that point at a radius which is the maximum (or mean) distance of the component points. Or you could calculate the Convex Hull of the points and use this as an "envelope" around the cluster.

A useful extension of K-Means is the k-means++ modification which does a better job of choosing initial coordinates.

winwaed