Remove thin dark feature by morphological closing:
Use morphological closing to remove pepper noise from a color photo:
Closing removes holes that are smaller than the structuring elements:
Remove small holes in foreground objects:
Specify an explicit structuring element: