MATLAB: How to calculate area in a binary image

@image analystareabinary imageimage enhancementimage processingImage Processing Toolbox

I have two questions to ask:
1) How to calculate area at the white region in binary image?
2) How to convert the answer of area unit that get from matlab into cm^2 or mm^2 (SI UNIT)?
here I attach the original image and binary image (this image is marine growth on the fiberglass plate)

Best Answer

Hi Asmalina,
1) To find the area in pixel size we just need to find the number of white pixel which would be
area = bwarea(bw);%bw is your binary threshold image
The unit would be pixel
2) To find the area in real world units , you need to find out how big one pixel is in appropraite units, if you working with DICOM image refer to this answer.
Another way is we can find the percentage of white area so if you have the plate area , you can find out the actual white area then.
to find out the percentage area:
percentageWhite = nnz(bw) / numel(bw);