Segmentation
The code performs semi-automatic binary segmentation based on SLIC superpixels and graph-cuts using the following steps:
- Given an image and sparse markings for foreground and background
- Calculate SLIC over image
- Calculate color histograms for all superpixels
- Calculate color histograms for FG and BG
- Construct a graph that takes into account superpixel-to-superpixel interaction (smoothness term), as well as superpixel-FG/BG interaction (match term)
- Run a graph-cut algorithm to get the final segmentation