FillingTransform
FillingTransform[image] gives a version of image with all extended minima filled.
FillingTransform[image,marker] fills extended minima in regions where at least one corresponding element of marker is nonzero.
FillingTransform[image,h] fills only extended minima of depth h or less.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.