Deterministic Algorithm for Nonlinear Markov Random Field Model