Applying k means to matrix

조회 수: 1 (최근 30일)
Pat
Pat 2012년 11월 27일
I have the result after dividing same pixels into blocks,
result is in variable out in workspace
27 [1,9]
30 [1,12]
31 [1,13]
32 [1,14]
33 [1,15]
34 [1,16]
35 [1,17]
36 [1,18]
37 [1,19]
38 [1,20]
39 [1,21]
now i have to apply k means for the above result ,i.e for each block i have to apply k means
please help
  댓글 수: 11
Walter Roberson
Walter Roberson 2012년 11월 27일
Okay, so what is your current version of the code (after taking the documentation into account) ?
Pat
Pat 2012년 11월 27일
Walter i tried
assuminug my values are
S=27 [1,9]
30 [1,12]
31 [1,13]
32 [1,14]
33 [1,15]
34 [1,16]
35 [1,17]
36 [1,18]
37 [1,19]
38 [1,20]
39 [1,21]
S=S(:,2);
S=cell2mat(S);
for i=1:length(S)
D=kmeans(S(i(:)),2);
r=reshape(D,1,[]);
end
dont know whether it is correct or not ,and i saw a reference code in
http://www.mathworks.in/matlabcentral/answers/46705-how-images-are-divided-into-sub-images
here the peppers image is divided into many parts,like that i want ti divide image ,such the each subimage has same pixel value,and then apply k means for each block

댓글을 달려면 로그인하십시오.

답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by