Ask Your Question
0

Change distance function for kmeans clustering

asked Jan 10 '13

jstr gravatar image

Hi there,

I have a question concerning the kmeans method for clustering data-points. By default this method uses the L2 norm (euclidean distance) to cluster the provided data. Is there any possibility for using another distance metric?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Jan 10 '13

No, you cannot use another method for kmeans without OpenCV library modification. kmeans function calls normL2Sqr_ function from stat.cpp for distance calculation. You can change this call on your function with the same signature.

PS: Willowgarage pages with OpenCV documentation is outdated. Use official OpenCV documentation at http://docs.opencv.org/

Preview: (hide)

Comments

3

It would be good if the outdated documentation at least contains a link to the actual one. It is really easy to find old versions of the docs. For instance googling for cvtColor shows willowgarage docs at 2nd and 3rd place.

rics gravatar imagerics (Jan 10 '13)edit

Question Tools

Stats

Asked: Jan 10 '13

Seen: 2,108 times

Last updated: Jan 10 '13