regionprops calculation

hi sir,this is my result of measuring bounding box,area and perimeter Bounding Box are: 30.50 30.50 422.00 412.00 Centroid are: 240.47 236.34 Area: 133907.00 Perimeter: 1567.80
As far as Im concerned, 422 is width,412 is height of bounding.then if I times for example 422*412 to find the area. It shud be 173864. then why the area above just only 133907? same to perimeter. actually to find perimeter, 2*width+2*height=1668. then why it's 1567 only!!!

답변 (2개)

Walter Roberson
Walter Roberson 2012년 5월 15일

0 개 추천

Bounding Box gives the rectangle that includes all pixels. Area does not give the area of the rectangle, it gives the area of the item within the rectangle.

댓글 수: 4

Tulips
Tulips 2012년 5월 15일
actually in regionprops, the area/perimeter value will be cover the area/perimeter of bounding box or not?pls advie.thx
Walter Roberson
Walter Roberson 2012년 5월 15일
Not.
Tulips
Tulips 2012년 5월 15일
it means that my answer was correct!!thanks sir!
Walter Roberson
Walter Roberson 2012년 5월 15일
I am not sure which part was your answer. Your point starting "As far as Im concerned" about what the area "should be", disagrees with the definition of "Area" used in MATLAB.

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

Image Analyst
Image Analyst 2012년 5월 15일

0 개 추천

40 thousand pixels - that's a big difference. Sounds like your area doesn't take up the full area of the box, like a circle wouldn't take up the full area of its bounding box.

댓글 수: 4

Tulips
Tulips 2012년 5월 15일
that's why I asked . my result above is correct or not..?Is it true that the area does not give the area of rectangle,?just like mr walter roberson said?
Walter Roberson
Walter Roberson 2012년 5월 15일
You can read the documentation:
http://www.mathworks.com/help/toolbox/images/ref/regionprops.html#bqkf8hc
'Area' — Scalar; the actual number of pixels in the region.
'BoundingBox' — The smallest rectangle containing the region
You might also be interested in FilledArea
Tulips
Tulips 2012년 5월 15일
so my result is correct.becoz it's clearly said that area just cover the number of pixel in region not the bounding box area. thanks guys!
Image Analyst
Image Analyst 2012년 5월 15일
Your result for the bounding box was correct. Your and regionprops()'s answers for the area are also correct because the blob you are getting the area of is smaller than the bounding box of the blob. Like I said, the area of a circle is smaller than the area of its bounding box. So everything agrees, as long as you understand what's going on.

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

카테고리

도움말 센터File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

질문:

2012년 5월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by