开发者

Matlab - longest long axis of the minimum ellipse

开发者 https://www.devze.com 2023-02-19 17:07 出处:网络
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 m

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消