is an option for various array and image processing functions that specifies whether diagonally adjacent corners should be considered neighbors of particular elements.


CornerNeighbors
is an option for various array and image processing functions that specifies whether diagonally adjacent corners should be considered neighbors of particular elements.
Details

- The following settings can be used for CornerNeighbors:
-
False in 2D and
in 3D
True in 2D and
in 3D
- CornerNeighbors->False has four neighbors in 2D and six neighbors in 3D.
- CornerNeighbors->True has eight neighbors in 2D and 26 neighbors in 3D.
Examples
open all close allScope (3)
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:
Related Guides
Text
Wolfram Research (2008), CornerNeighbors, Wolfram Language function, https://reference.wolfram.com/language/ref/CornerNeighbors.html (updated 2014).
CMS
Wolfram Language. 2008. "CornerNeighbors." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/CornerNeighbors.html.
APA
Wolfram Language. (2008). CornerNeighbors. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CornerNeighbors.html
BibTeX
@misc{reference.wolfram_2025_cornerneighbors, author="Wolfram Research", title="{CornerNeighbors}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CornerNeighbors.html}", note=[Accessed: 07-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_cornerneighbors, organization={Wolfram Research}, title={CornerNeighbors}, year={2014}, url={https://reference.wolfram.com/language/ref/CornerNeighbors.html}, note=[Accessed: 07-August-2025]}