Loadable Function: [bw2, idx] = bwfill(bw1, c, r, n)

Perform a flood-fill operation on the binary image bw1.

The flood-filling starts in the pixel (r, c). If r and c are vectors of the same length, each pixel pair (r(i), c(i)) will be a starting point for a flood-fill operation. The argument n changes the neighborhood connectivity (of the holes) for the flood-fill operation. n can be either 4 or 8, and has a default value of 8.

Note that n is the connectivity of the foreground, and not of the background, even though the function acts on the background.

The output is the processed image bw2 and the indexes of the filled pixels idx

Loadable Function: [bw2, idx] = bwfill(bw1, "holes", n)

If the string "holes" is given instead of starting points for the flood-fill operation, the function finds interior holes in bw1 and fills them.

Note: bwfill is not recommended. Please use "imfill" instead.

See also: imfill.

Package: image