필터 지우기
필터 지우기

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