8connected
8connected is a term used in discrete mathematics and digital imaging to describe a particular model of neighborhood connectivity on a two-dimensional grid. In an 8connected framework, a grid cell or pixel is considered adjacent to all of its eight surrounding cells: the four orthogonal neighbors (north, east, south, west) and the four diagonal neighbors (northeast, southeast, southwest, northwest). This contrasts with 4-connected connectivity, which includes only the orthogonal neighbors. The choice between 4- and 8-connectedness influences how regions are defined and how paths are traced on the grid.
In image processing, 8connectedness is used for tasks such as connected component labeling and region growing.
In graph-theory terms, an 8connected grid describes a grid graph where each vertex connects to up to
History and terminology: The notions of 4- and 8-connectivity emerged from early digital imaging research to
See also: 4-connectedness; 8-connectedness; 8-neighborhood; connected components; cellular automata.