I need to find the longest long axis of the minimum ellipse of the components generated using CCL (to use as a thres开发者_如何学JAVAhold). I used matlab for generating connected components (bwlabel method).
I am new to matlab and any help is highly appreciated.
Thanks in advance
Have a look at REGIONPROPS.
stats = regionprops(ccl,'MajorAxisLength');
majAx = cat(1, stats.MajorAxisLength);
%# find the longest long axis, and the
%# index into connComp.PixelIdxList
%# of the object with the longest long axis
[longestLongAxis,idxOfLongFeature] = max(majAx);
精彩评论