Markov random fields (MRFs) are probabilistic models that can model images using neighborhoods of pixels that satisfy the Markov property. MRFs allow modeling textures and segmenting images into objects. Inference in MRFs can be done using Markov chain Monte Carlo methods like the Gibbs sampler or Metropolis algorithm to sample from the distributions. MRFs have been used for image segmentation by modeling pixel labels as an MRF and maximizing the joint probability of labels and image pixels.