1. The method of processing an image having a plurality of nodes comprising the steps of: processing the image by minimizing an energy function having a plurality of terms; determining a first probability that a first node and a second node are similar; determining a second probability that the first node and the second node are different; wherein, the first determination probability is greater than the second determination probability and; if the first probability is greater than the second probability, 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 the first node and the second node in the plurality of nodes.