using graph cuts to regularize the foreground background labeling