What is the most efficient way to obtain the centroid of each cluster of centroids in the matrix produced by 'kmeans' cluster analysis?

3 ビュー (過去 30 日間)
I am counting geese in large flocks in aerial photos using the 'detectSURFFeatures' function to identify individual geese. This gives me multiple feature centroids clustered at each goose image, which I analyze with 'kmeans'. I am currently sorting the resulting matrix of centroid values on cluster labels and using loops to calculate the mean centroid value for each cluster (see attached code).

採用された回答

Image Analyst
Image Analyst 2016 年 12 月 3 日
The most efficient way would be to get the second return argument of kmeans(). I mean, it gives you the cluster centers so why not accept them?

その他の回答 (1 件)

Tony
Tony 2016 年 12 月 4 日
That's what I thought reading the documentation, but wasn't sure. Thank you again for help with application of cluster analysis.

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by