http://www.emgu.com
The grab cut algorithm for segmentation

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: 2.4.10.1935 (2.4.10.1935)

Syntax

C#
public static void CvGrabCut(
	IntPtr img,
	IntPtr mask,
	ref Rectangle rect,
	IntPtr bgdModel,
	IntPtr fgdModel,
	int iterCount,
	GRABCUT_INIT_TYPE type
)
Visual Basic
Public Shared Sub CvGrabCut ( 
	img As IntPtr,
	mask As IntPtr,
	ByRef rect As Rectangle,
	bgdModel As IntPtr,
	fgdModel As IntPtr,
	iterCount As Integer,
	type As GRABCUT_INIT_TYPE
)
Visual C++
public:
static void CvGrabCut(
	IntPtr img, 
	IntPtr mask, 
	Rectangle% rect, 
	IntPtr bgdModel, 
	IntPtr fgdModel, 
	int iterCount, 
	GRABCUT_INIT_TYPE type
)
F#
static member CvGrabCut : 
        img : IntPtr * 
        mask : IntPtr * 
        rect : Rectangle byref * 
        bgdModel : IntPtr * 
        fgdModel : IntPtr * 
        iterCount : int * 
        type : GRABCUT_INIT_TYPE -> unit 

Parameters

img
Type: System..::..IntPtr
The 8-bit 3-channel image to be segmented
mask
Type: System..::..IntPtr
Input/output 8-bit single-channel mask. The mask is initialized by the function when mode is set to GC_INIT_WITH_RECT. Its elements may have one of following values: 0 (GC_BGD) defines an obvious background pixels. 1 (GC_FGD) defines an obvious foreground (object) pixel. 2 (GC_PR_BGR) defines a possible background pixel. 3 (GC_PR_FGD) defines a possible foreground pixel.
rect
Type: System.Drawing..::..Rectangle%
The rectangle to initialize the segmentation
bgdModel
Type: System..::..IntPtr
Temporary array for the background model. Do not modify it while you are processing the same image.
fgdModel
Type: System..::..IntPtr
Temporary arrays for the foreground model. Do not modify it while you are processing the same image.
iterCount
Type: System..::..Int32
The number of iternations
type
Type: Emgu.CV.CvEnum..::..GRABCUT_INIT_TYPE
The initilization type

See Also