Pixel Neighbors

The black pixels are considered to be neighbors of the red pixel in the following schemes.

4-connected 8-connected 6P-connected 6N-connected

one region or two?

Depending on the definition of connectivity the black pixels below form either one or two connected regions.

border connectivity

If the border is 8-connected then the interior is 4-connected and vice versa.

Metrics

City Block metric

D4 distance, 1-norm, |x2-x1|+|y2-y1|

Chessboard metric

D8 distance, infinity-norm, max(|x2-x1|,|y2-y1|)

average metric

Average of cityblock and chessboard metrics

Euclidian metric

Pythogorean metric

The diagram below shows the contours of equal distance for the 1-norm (diamond), 2-norm (circle), and infinity-norm (square)


Maintained by John Loomis, last updated 29 May 1998