フィルターのクリア

How to calculate solidity of different shapes

6 ビュー (過去 30 日間)
naila
naila 2013 年 9 月 19 日
移動済み: DGM 2023 年 12 月 29 日
I have an image which contains different shapes:
I want to calculate the solidity of each shape individually and pick the one which has greatest solidity;
Can any one help me regarding this?

採用された回答

Image Analyst
Image Analyst 2013 年 9 月 19 日
編集済み: Image Analyst 2013 年 9 月 19 日
Did you use regionprops() to get all of them? If so, then just sort
% Label the binary image.
labeledImage = bwlabel(binaryImage);
% Measure the solidity of all the blobs.
measurements = regionprops(labeledImage, 'Solidity');
% Sort in oder of decreasing solidity.
[sortedS, sortIndexes] = sort([measurements.Solidity], 'descend');
% Get the solidity of the most solid blob
highestSolidity = sortedS(1);
% Get the label of the most solid blob
labelWithHighestSolidity = sortIndexes(1);
  12 件のコメント
Image Analyst
Image Analyst 2013 年 9 月 20 日
移動済み: DGM 2023 年 12 月 29 日
naila: See attached file and see if it does what you want.
naila
naila 2013 年 9 月 22 日
移動済み: DGM 2023 年 12 月 29 日
Thank You very much Sir... This is all what I need...; Thanks for your time;

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by