필터 지우기
필터 지우기

How to calculate Area ??

조회 수: 4 (최근 30일)
Mariam Sheha
Mariam Sheha 2013년 6월 13일
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
Walter Roberson
Walter Roberson 2013년 6월 13일
When you say "already get it's parameters", could you be more specific about what information you already have?
Mariam Sheha
Mariam Sheha 2013년 6월 13일
FOR EXAMPLE: Bounding Box Parmeters for image: 113.5000 138.5000 407.0000 259.0000

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2013년 6월 13일
편집: the cyclist 2013년 6월 13일
If you have the vertices of the convex hull, use the polyarea() command.
  댓글 수: 2
Mariam Sheha
Mariam Sheha 2013년 6월 13일
thanx alot , but what if i have more than one vertices for that image
(convex hull i calculate: is for segmented image located at bounding box)
Walter Roberson
Walter Roberson 2013년 6월 14일
polyarea() with a single vertex would tell you that you had area 0. Area is not meaningful until you have at least three vertices. polyarea() is somethng you would apply to the array of vertices.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Image Analyst
Image Analyst 2013년 6월 13일
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
Image Analyst
Image Analyst 2013년 6월 14일
You must have a really old version - time to upgrade. It's been in there for a few years now.
Mariam Sheha
Mariam Sheha 2013년 6월 14일
o0o0ops ok, i thought that i am updated using Matlab 10, i will try to upgrade it... Thanks for the note :)

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2013년 6월 13일
Bounding boxes are usually represented as [x y height width] . In that representation, the area is the height multiplied by the width.
  댓글 수: 1
Mariam Sheha
Mariam Sheha 2013년 6월 13일
Thanks alot, i get your point and i tried it manually and it works, so you mean their are no ready function for that..

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by