plot of differernt regions of specific area in a matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I wonder where in the follwing code i can add a condition which i can have the same plot but for regions (connected pixels) which have more than 10 pixels? I really apperciate your help.
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 23 Jun. 2011
Hi Hassan! Try this code:
L = bwlabel(m2 == 2);
lns = 1:max(L(:));
ln = regionprops(L, 'Area');
pm1 = find(ismember(L(:),lns([ln(:).Area]>=10)));
lidx = sortrows([L(pm1) pm1],1);
dplt = mat2cell([(1:size(lidx,1))' m1(lidx(:,2))],...
arrayfun(@(i1)nnz(lidx(:,1)==i1),unique(lidx(:,1))) ,ones(1,2));
n = size(dplt,1);
k=reshape('ymcrgbwk+o*.xv^>--------',[],3);
dplt2 = [dplt mat2cell([repmat(k,fix(n/8),1);k(1:rem(n,8),:)],ones(n,1),3)]';
plot(dplt2{:})
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Map Display finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!