Use grabcut to perform background forground segmentation.

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

Syntax

         
 C#  Visual Basic  Visual C++ 
public Image<Gray, byte> GrabCut(
	Rectangle rect,
	int iteration
)
Public Function GrabCut ( _
	rect As Rectangle, _
	iteration As Integer _
) As Image(Of Gray, Byte)
public:
Image<Gray, unsigned char>^ GrabCut(
	Rectangle rect, 
	int iteration
)

Parameters

rect
Rectangle
The initial rectangle region for the forground
iteration
Int32
The number of iterations to run GrabCut

Return Value

The background forground mask where 2 indicates background and 3 indicates forground

See Also