How to calculate Area ??
Mostra commenti meno recenti
Hey every body....
I am asking "how can i compute area of the bounding box and convex hull where i had already get it's parameters?"
Thank you
2 Commenti
Walter Roberson
il 13 Giu 2013
When you say "already get it's parameters", could you be more specific about what information you already have?
Mariam Sheha
il 13 Giu 2013
Risposta accettata
Più risposte (2)
Image Analyst
il 13 Giu 2013
For the bounding boxes, you can simply multiply the last two numbers
area=BoundingBox(3)*BoundingBox(4);
Or you can ask regionprops to calculate the areas of the convex hulls. You just need to pass your binary image into bwconvhull() and then into regionprops
chulls = bwconvhull(binaryImage);
measurements = regionprops(chulls, 'Area', 'BoundingBox');
% Compute the areas of each convex hull:
allAreas = [measurements.Area];
% Compute the area of each bounding box.
boundingBoxes = [blobMeasurements.BoundingBox];
allBBAreas = boundingBoxes(3:4:end) .* boundingBoxes(4:4:end);
3 Commenti
Mariam Sheha
il 13 Giu 2013
Thanx alot ; Rally your answer is very usefull.... only i wana to ask if you are sure that their is a command named: bwconvhull because it's undefined ?!!
Thank you :)
Image Analyst
il 14 Giu 2013
You must have a really old version - time to upgrade. It's been in there for a few years now.
Mariam Sheha
il 14 Giu 2013
Walter Roberson
il 13 Giu 2013
0 voti
Bounding boxes are usually represented as [x y height width] . In that representation, the area is the height multiplied by the width.
1 Commento
Mariam Sheha
il 13 Giu 2013
Thanks alot, i get your point and i tried it manually and it works, so you mean their are no ready function for that..
Categorie
Scopri di più su Data Import and Analysis in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!