A fork from http://vision.middlebury.edu/MRF/code/