Hi all.
I have block from an image obtained using:
How best can I cluster similar blocks from my BlockImage matrix using: kmeans?
I also wish to display the distance between; any two intra-cluster blocks, any two blocks from different clusters; any two centroids if possible.
Honestly, am not so sure how to tackle this. Looking at the kmeans examples from the document, is not so intuitive for this particular scenario.
Thanks alot.

 採用された回答

Image Analyst
Image Analyst 2022 年 2 月 21 日

0 投票

6 件のコメント

MatlabEnthusiast
MatlabEnthusiast 2022 年 2 月 21 日
@Image Analyst thanks. Let me look into them. The reason is I want to cluster blocks.
Image Analyst
Image Analyst 2022 年 2 月 21 日
How is this different than just getting a class for every pixel in the image?
MatlabEnthusiast
MatlabEnthusiast 2022 年 2 月 21 日
編集済み: MatlabEnthusiast 2022 年 2 月 21 日
because, I already generated the distinct blocks with pre determined dimensions. So clustering over blocks, I can easily tell how many blocks are in a cluster(hopefully) - thats the aim. Maybe even play with the individual blocks see their effect on the image.
Image Analyst
Image Analyst 2022 年 2 月 21 日
編集済み: Image Analyst 2022 年 2 月 21 日
Maybe this is why I never use im2col(). Explain to me what's going on here:
grayImage = imread('moon.tif');
[rows, columns, numberOfColorChannels] = size(grayImage)
rows = 537
columns = 358
numberOfColorChannels = 1
subplot(1, 2, 1);
imshow(grayImage);
axis on
m = rows;
n = 8;
BlockImage = im2col(grayImage,[m n],'distinct');
subplot(1, 2, 2);
imshow(BlockImage);
axis on
MatlabEnthusiast
MatlabEnthusiast 2022 年 2 月 21 日
you converted the distinct image blocks to a column matrix?
MatlabEnthusiast
MatlabEnthusiast 2022 年 2 月 22 日
but seriously whats happening?

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by