The relative vertical position of the smallest connected black component
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi guys.... I want your help in MATLAB to find the vertical position of the smallest connected black component.
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 12 Mai 2011
CC = bwconncomp(~BW);
[junk, idx] = min(cellfun(@numel,CC.PixelIdxList))
[r c] = ind2sub(size(BW),CC.PixelIdxList{idx});
%How do you want to define vertical position? Middle, top bottom
mean(r); %middle by weight
min(r); %top point
max(r); %bottom point
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Labels and Annotations 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!