2011-03-24 127 views
0

我需要找到使用CCL生成的组件的最小椭圆的最长轴(用作阈值)。我用matlab生成连接组件(bwlabel方法)。Matlab - 最小椭圆的最长轴

我是新来matlab和任何帮助高度赞赏。

在此先感谢

回答

0

看一看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);