Encapsulation of MAXFLOW graphcut code of Boykov and Kolmogorov