MATLAB: Find area from binary image.

imageImage Processing Toolbox

Hello,
I have this binary image:
I want to encircle it with ellipse or any kind of boundary like below:
After this, I have to fill the area inside the boundary and want to found out the area of this boundary. How to do so?
Thanks.

Best Answer

Try this:
binaryImage = bwconvhull(binaryImage, 'union');
area = bwarea(binaryImage);
% or for a simple sum of pixels:
area = sum(binaryImage(:));