Help please, I want to find out the Centroid, Area, and the Moment of Inertia of any closed curve, from an axis line drawn under that shape. Then How to make a GUI program that displays one two-dimensional area shape along with its centroid marked on
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Azad Al Kiki
le 26 Avr 2020
Commenté : Azad Al Kiki
le 27 Avr 2020
Help please, I want to find out the Centroid, Area, and the Moment of Inertia of any closed curve, from an axis line drawn under that shape.
Then How to make a GUI program that displays one two-dimensional area shape along with its centroid marked on the area. It also calculates its moment of inertia for the area and displays the result? The user input is an image file that contains an arbitrary shape of closed curve on top of horizontal line that indicates the axis about which the moment of inertia is measured (refer to the image below). The length scale is defined by user referring to the distance between the axis and the centroid firstly determined.
I figured out from searching how to slect the enclosed shape, and calculate the area, but I dont know how to find out the distance from the axis line that is drwan under that curve to the determined centeroid??

2 commentaires
Réponse acceptée
Image Analyst
le 26 Avr 2020
Area and centroid are trivial. You just do
props = regionprops(mask, 'Area', 'Centroid');
For the moments of inertia, see my attached demo that computes image moments. I'm sure you will know how to make the obvious changes to have the line be your axis.
Plus de réponses (1)
darova
le 26 Avr 2020
- binarize image (0 and 1)
- label image with bwlabel (to find inside part of large blob)
- use regionprops with centroid and area options (use area property to find appopriate centroid)
0 commentaires
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!