The relative vertical position of the smallest connected black component

1 回表示 (過去 30 日間)
hamza
hamza 2011 年 5 月 12 日
Hi guys.... I want your help in MATLAB to find the vertical position of the smallest connected black component.

採用された回答

Sean de Wolski
Sean de Wolski 2011 年 5 月 12 日
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 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by