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.

Details and OptionsDetails and Options

  • An extended minimum is a connected set of pixels surrounded by pixels that all have a greater value than the pixels in the set.
  • FillingTransform[image] fills all extended minima by lifting their values to the lowest value found among the surrounding pixels.
  • In FillingTransform[image, marker], marker can be given as a matrix or an image of the same dimensions as image.
  • FillingTransform works with 3D as well as 2D binary, grayscale, and other images.
  • FillingTransform by default treats all pixels surrounding a given pixel as adjacent. A given pixel has eight adjacent pixels in 2D and 26 adjacent pixels in 3D.
  • The option setting CornerNeighbors->False treats only the pixels in the coordinate directions as adjacent, which would include four pixels in 2D and six pixels in 3D.
  • FillingTransform takes a Padding option. The default setting is Padding->0, corresponding to a black background.
  • For grayscale images, FillingTransform[image, h, Padding->1] effectively computes the h-minima transform.
New in 8 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »