MATLAB: How to calculate the area of certain portion of an image

how to calculate the area of certain portion of an image ?Image Processing Toolbox

how to calculate the area of certain portion of an image ?

Best Answer

Call regionprops(). See my Image Segmentation Tutorial. It goes over all of that:
For example with a simple thresholding:
binaryImage = grayImage > 90;
measurements = regionprops(binaryImage, 'Area');
allAreas = [measurements.Area];