See http://opencv.willowgarage.com/documentation/cpp/index.html
I don't see anything for clustering/centroids, but you might try FindContours: http://opencv.willowgarage.com/documentation/cpp/structural_analysis_and_shape_descriptors.html#findcontours .
It sounds like you want to do visualization analysis and this library is more suited to machine vision.
Potatoswatter
2010-01-07 09:12:15