connect the missing black pixels in binary image

I have the following input binary image.
In this image, the boundary is not closed. Please suggest any method that will connect the missing black pixels in the image such that the output image looks like the one attached.
Thanks, Irtaza

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by