How would I use the k-means function from the stats toolbox on an image sequence?

I have a sequence of 2D grayscale images on which I would like to run the k-means clustering algorithm. My data is in the form m x n x p where p is the number of frames.
The matlab code available in the statistics toolbox expects the data X to be in the form n-by-p data matrix where the "Rows of X correspond to points, columns correspond to variables."
Can I use this code? How do I adapt my data to be in the expected format?
Thanks in Advance,
n

1 件のコメント

Walter Roberson
Walter Roberson 2014 年 4 月 4 日
Are you trying to cluster between images, or only within a given image?

サインインしてコメントする。

 採用された回答

Meshooo
Meshooo 2014 年 4 月 4 日

0 投票

First change your 2D gray scale images to double images using I1 = im2double(Z1) then apply the kmeans function to I1, I2, etc..

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

質問済み:

2013 年 11 月 19 日

コメント済み:

2014 年 4 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by