How to calculate solidity of different shapes
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have an image which contains different shapes:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149854/image.jpeg)
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?
0 Commenti
Risposta accettata
Image Analyst
il 19 Set 2013
Modificato: Image Analyst
il 19 Set 2013
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 Commenti
Image Analyst
il 20 Set 2013
Spostato: DGM
il 29 Dic 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172183/image.jpeg)
naila: See attached file and see if it does what you want.
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!