FUNCTION REFERENCE

imclearborder

Remove objects that touch the image border.

Remove objects that touch the image border.

Syntax

J = imclearborder(I)

Syntax

J = imclearborder(I, conn)

For a logical image, removes the connected components (conn 8 by default, or 4) that have a pixel on the image border. For other classes, subtracts the morphological reconstruction by dilation of the border values under I, which removes bright structures connected to the border. J has the class of I.

Example

imclearborder(logical([1 0 0 0; 0 0 0 0; 0 0 1 0; 0 0 0 0]))   % only (3,3) stays

Example

imclearborder(logical([0 0 0; 0 1 0; 0 0 1]), 4)   % [0 0 0; 0 1 0; 0 0 0]

Differences from MATLAB: 2-D only.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.