You are here : matlabImage Processingbwarea

bwarea() - Image Processing

total = bwarea(BW) estimates
the area of the objects in binary image BW. total is
a scalar whose value corresponds roughly to the total number of on pixels
in the image, but might not be exactly the same because different
patterns of pixels are weighted differently.


Syntax

total = bwarea(BW)


Example

Calculate the Area of Objects in a Binary ImageOpen This Example
Read the image and display it.BW = imread('circles.png');
imshow(BW);

Calculate the area of objects in the image.bwarea(BW)

ans =

   1.4187e+04


Output / Return Value


Limitations


Alternatives / See Also


Reference