1. A method of processing an image having a plurality of nodes, comprising: processing the image by minimizing an energy function having a plurality of terms; determining a first probability that the first node and the second node are similar is greater than a second probability that the first node and the second node are different; and if the first probability is greater than the second probability, then modifying at least one of the plurality of terms in the energy function, the one of the plurality of terms depending on values associated with a first and a second node in the plurality of nodes.