An efficient algorithm for image segmentation, Markov random fields and related problems | Synapse