How to calculate solidity of different shapes

7 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by