This is the walk-through of the implementation for GrabCut demo.
There are several existing GrabCut implementations on the internet.
Most of them do not provide the source code.
https://mywebspace.wisc.edu/pwang6/personal/
is a very high quality code. Do not give out the source code though. The user cannot change the setting of the parameters like the "k" in the GMM. However, it works very smoothly in vista and XP both 32 bit and 64 bit.
http://www.cs.cmu.edu/~mohitg/segmentation.htm
Provides the source code for C++ and Matlab. However, the quality is not so good. It could crash sometimes, and the parameter setting is not straight-forward.
http://research.justintalbot.org/papers/GrabCut.zip
Provides the C++ code for GrabCut implementation. This source code has very high quality, and it provides the step-by-step of the GMM learning and Graph Cutting. The user could see the change of the energy and the color modes.
The user needs to modify the source code to change the setting of the "k" in the GMM.
To compile this code, OpenCV(http://opencv.willowgarage.com/wiki/) and the GLUT (http://www.opengl.org/resources/libraries/glut/) both need to be installed.
VC and Linux both could compile the source code and get it running.
The details of this implementation are described in:
http://students.cs.byu.edu/~jtalbot/research/Grabcut.pdf
Have fun!