CvFindContours Method (CvArr, CvMemStorage, CvSeqCvPoint, Int32, ContourRetrieval, ContourChain, CvPoint) OpenCvSharp Class Library
Retrieves contours from the binary image and returns the number of retrieved contours.

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static int FindContours(
	CvArr image,
	CvMemStorage storage,
	out CvSeq<CvPoint> firstContour,
	int headerSize,
	ContourRetrieval mode,
	ContourChain method,
	CvPoint offset
)

Parameters

image
Type: OpenCvSharpCvArr
The source 8-bit single channel image. Non-zero pixels are treated as 1’s, zero pixels remain 0’s - 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.
storage
Type: OpenCvSharpCvMemStorage
Container of the retrieved contours.
firstContour
Type: OpenCvSharpCvSeqCvPoint
Output parameter, will contain the pointer to the first outer contour.
headerSize
Type: SystemInt32
Size of the sequence header, >=sizeof(CvChain) if method=CV_CHAIN_CODE, and >=sizeof(CvContour) otherwise.
mode
Type: OpenCvSharpContourRetrieval
Retrieval mode.
method
Type: OpenCvSharpContourChain
Approximation method.
offset
Type: OpenCvSharpCvPoint
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: Int32
The number of retrieved contours.
See Also

Reference