1 view (last 30 days)

Show older comments

I want to calculate the area of only white part as shown in the figure. I had used - bwarea(image). But I am not sure whether its calculating correct area or not. As I just need the white portion area.

Any help is much appreciated.

Thank you in advance!!

Image Analyst
on 23 Apr 2021

You simply use nnz on your binary image to get the area in pixels

whiteArea = nnz(mask)

or you could use bwarea() - it uses a somewhat different algorithm for determining area (it's not just counting pixels).

whiteArea = bwarea(mask)

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

Start Hunting!