the concept of markov chains applied to images