Let V be a set of intensity values used to define adjacency
4-adjacency: p and q with values in V are 4-adjacent if q ∈ N4(p)
8-adjacency: p and q with values in V are 8-adjacent if q ∈ N8(p)
m-adjacency (mixed adjacency): p and q with values in V are m-adjacent if
q ∈ N4(p),
or q ∈ ND(p) and N4(p) ∩ N4(q) has no pixel with values from V