# MATLAB: Total area of a region of binary image

area of regionboundariesconnected componentsImage Processing Toolboximage segmentation

Hi every ones I have a question of area of region of binary image.
That mean I have a list of boundary of a region in a image. Use bwboundaries or use bwlabel. Now I want to find there is total how many pixel – areas ( include black and white) in this area ?
I can't use regionprops funtion in matlab because it return only number of black pixel.
pixelSum1 = bwarea(binaryImage);pixelSum2 = sum(binaryImage(:));
labeledImage = bwlabel(binaryImage);measurements = regionprops(labeledImage, 'Area');allAreas = [measurements.Area];  % List of all the blob areas.totalAreaOfAllBlobs = sum(allAreas); % Will be the same as pixelSum2