Fill image holes or regions.
The image to be filled can be binary bw or grayscale I. Regions are a series of connected elements whose values are lower than at least one of its neighbor elements.
The option "holes"
, default for grayscale images, can be used
to fill all holes, i.e., regions without border elements.
Alternatively, the argument locations are coordinates for elements in the regions to be filled. It can be a a n-by-1 vector of linear indices or a n-by-d matrix of subscript indices where n is the number of points and d is the number of dimensions in the image.
The argument conn specifies the connectivity used for filling
the region and defaults to
conndef (ndims (img,
which is 4 for
the case of 2 dimensional images.
"minimal"
)
im = [0 1 0 1 0 1 0 1 0]; imfill (im, "holes") ans = 0 1 0 1 1 1 0 1 0
See also: bwfill, bwselect, imreconstruct.
Package: image