You can try to use this file exchange function.
It the otsu algorithm base on multi-class segementation.
For multiclass, you can use im2bw
Question
I have a sequence of 2D grayscale images for which I would like to run the k-means clustering algorithm on. 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
p.s. Also, if possible I'd prefer not to use a function from the statistics toolbox, if somebody can recommend something else (such as a mex function). It would be much appreciated.
Solution
You can try to use this file exchange function.
It the otsu algorithm base on multi-class segementation.
For multiclass, you can use im2bw