MATLAB: How to fill the vacancy in a binary image

binaryhole fillingimageImage Processing Toolbox

hi there is a binary image how can I fill the vacancy(blue) in the yellow region?

Best Answer

Use imfill():
binaryImage = imfill(binaryImage, 'holes');