# Texture Analysis and Statistic Models

Let's assume we have a random binary texture image $$X(i,j)$$ that comes from a Markov-Gibbs model with zero boundary conditions.

The probability distribution Gibbs function is: $$Pr(X)=\frac{1}{Z}\exp(-\frac{1}{T}U(X))$$ If we also have an Ising model with cliques of 1 or 2 pixels, if there are horizontal or vertical neighbours, then its energy is given from the following formula:

$$U(X)=\sum_i\sum_j{[aX(i,j)+b_1 X(i,j)X(i-1,j)+b_2X(i,j)X(i,j-1)]}$$

I want to prove that the above energy function can be written in the following form:
$$U(X)=a\cdot card(X)+b_1 \cdot card(X \ominus B_h)+b_2 \cdot card(X\ominus B_u)$$
where $$B_h=\{(0,0),(1,0)\}$$ and $$B_u=\{(0,0),(0,1)\}$$ are structural elements and $$card(X)$$ is the number of pixels of binary image $$X$$.

Which is the right way to approach this problem? Any help is appreciated! Thanks in advance!