please, how to calculate the number of pixels in boundingbox ?

3 views (last 30 days)
hi i saiful. I would like to ask which way to count the number of pixels contained on objects in boundingbox, use the command regionprops

Accepted Answer

Walter Roberson
Walter Roberson on 17 Jun 2015
Multiply the width of the bounding box by the height of the bounding box.
  3 Comments
Walter Roberson
Walter Roberson on 17 Jun 2015
For example,
info = regionprops(BinaryImage, 'BoundingBox');
number_of_pixels = info.BoundingBox(3) * info.BoundingBox(4);

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!