Image Analysis, regionprops and find

Good morning,
I am working on Image analysis. I recognize darker shapes of an Image.Moreover, I would like to apply restrictions on the areas and circularity of the detected shapes.
First I detect any area darker than my threshold and then apply restrictions as follows: (ECD is equivalent circular diameter)
_ poreMeasurement = regionprops(labeledImage, originalImage, 'all');
% Limits in ECD
minSize = find([poreMeasurement.EquivDiameter] > minRadius*2/scale);
maxSize = find([poreMeasurement.EquivDiameter] < maxRadius*2/scale);
% Limits in Circularity
minC = find(poreMeasurement(:).Area./(poreMeasurement(:).Perimeter.^2) > minimumC/(4*pi));
maxC = find([poreMeasurement.Area]/([poreMeasurement.Perimeter].^2) < maximumC/(4*pi));
BW2 = ismember(labeledImage, intersect(intersect(minSize,maxSize),intersect(minC,maxC)));
Restrictions I apply to limit the range of area between minSize and maxSize work well. However I an confused when it comes to introduce simple calculations in the find command. Circularity is 4*pi*Area/(Perimeter^2) and the error comes from the way I am writing this part. I have an error:
" ??? Error using ==> rdivide Too many input arguments."
Do you have have any clue on how to "treat" the properties of regionprops to be able to do simple calculatiosn therein?
Thank you in advance !
David

 採用された回答

David
David 2012 年 2 月 9 日

0 投票

Ok, solved. The correct code was :
minC = find([poreMeasurement.Area]./[poreMeasurement.Perimeter]./[poreMeasurement.Perimeter] > minimumC/(4*pi));
maxC = find([poreMeasurement.Area]./[poreMeasurement.Perimeter]./[poreMeasurement.Perimeter] < maximumC/(4*pi));

1 件のコメント

Image Analyst
Image Analyst 2012 年 2 月 9 日
Yes, that's what may be a not-too-commonly-known trick. You can get (extract) all of the values out of a particular field of the structure array returned by regionprops by enclosing the structure.fieldName in square brackets, like you did.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

質問済み:

2012 年 2 月 9 日

編集済み:

2013 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by