C++ implementation of GrabCut algorithm