Modeling Image Analysis Problems Using Markov Random Fields