Click or drag to resize
CvInvokeFindContours Method
http://www.emgu.com
Retrieves contours from the binary image and returns the number of retrieved contours. The pointer firstContour is filled by the function. It will contain pointer to the first most outer contour or IntPtr.Zero if no contours is detected (if the image is completely black). Other contours may be reached from firstContour using h_next and v_next links. The sample in cvDrawContours discussion shows how to use contours for connected component detection. Contours can be also used for shape analysis and object recognition - see squares.c in OpenCV sample directory The function modifies the source image content

Namespace: Emgu.CV
Assembly: Emgu.CV.World (in Emgu.CV.World.dll) Version: 3.1.0.2282 (3.1.0.2282)
Syntax
public static void FindContours(
	IInputOutputArray image,
	IOutputArray contours,
	IOutputArray hierarchy,
	RetrType mode,
	ChainApproxMethod method,
	Point offset = null
)

Parameters

image
Type: Emgu.CVIInputOutputArray
The source 8-bit single channel image. Non-zero pixels are treated as 1s, zero pixels remain 0s - that is image treated as binary. To get such a binary image from grayscale, one may use cvThreshold, cvAdaptiveThreshold or cvCanny. The function modifies the source image content
contours
Type: Emgu.CVIOutputArray
Detected contours. Each contour is stored as a vector of points.
hierarchy
Type: Emgu.CVIOutputArray
Optional output vector, containing information about the image topology.
mode
Type: Emgu.CV.CvEnumRetrType
Retrieval mode
method
Type: Emgu.CV.CvEnumChainApproxMethod
Approximation method (for all the modes, except CV_RETR_RUNS, which uses built-in approximation).
offset (Optional)
Type: System.DrawingPoint
Offset, by which every contour point is shifted. This is useful if the contours are extracted from the image ROI and then they should be analyzed in the whole image context

Return Value

Type: 
The number of countours
See Also