Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages

Implementation of bounding-box-based figure-ground segmentation "grabCut" algorithm by Rother et al., SIGGRAPH 2004. The bounding box can be provided interactively by the user or supplied on the commandline.


bin/grabCut -profile -verbose -m 1000 -w 128.0 -x <IMAGE_FILENAME>

The following screenshot shows example results from an original image (top left) and foreground mask (top right). The foreground mask was generated from user input. The final segmentation mask (bottom left) and segmented image (bottom right) are also shown.


Higher-order potentials can be added to grabCut to improve the segmentation quality especially when the foreground object is occluded. Here we use k-means to define the higher-order cliques and a robust Potts model to enfore consistency.


bin/highOrderGrabCut -verbose -highorder 64.0 -pairwise 64.0 -m 5000 -x <IMAGE_FILENAME>

The following screenshot shows exmaple results using higher-order consistency.


Instead of the user having to provide a mask interactively the grabCut and highOrderGrabCut applications allow a mask to be provided on the commandline. The mask should be a grayscale image the same size as the original image. The value for each pixel then determines how the pixel will be treated by the GrabCut algorithm as follows:

See Also
Applications and Project Descriptions