This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

CornerNeighbors

CornerNeighbors
is an option for various array and image processing functions that specifies whether diagonally adjacent corners should be considered neighbors of particular elements.
Eight-connected components:
Four-connected components:
Eight-connected components:
In[1]:=
Click for copyable input
Out[1]//MatrixForm=
 
Four-connected components:
In[1]:=
Click for copyable input
Out[1]//MatrixForm=
Finding the morphological perimeter of an object:
This image contains either one or 16 objects, depending on the setting of CornerNeighbors:
The result of geodesic dilation may depend on the definition of connectivity:
New in 7