intergrate with graphcut