This is a basis function used in simulation algorithms on the Ising
and Potts models. It counts how many of the four neighbours
of \(x_{a,b}\) are of the same colour as this
pixel.
Usage
xneig4(x, a, b, col)
Value
integer between 0 and 4 giving the number of neighbours with the same colour