GrabCut

GrabCut is an image segmentation method based on graph cuts.

This is used to construct a Markov random field over the pixel labels, with an energy function that prefers connected regions having the same label, and running a graph cut based optimization to infer their values.

As this estimate is likely to be more accurate than the original, taken from the bounding box, this two-step procedure is repeated until convergence.

[citation needed] Estimates can be further corrected by the user by pointing out misclassified regions and rerunning the optimization.

[citation needed] There are several open source implementations available including OpenCV (as of version 2.1).