Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » OpenCV » Structural Analysis and Shape Descriptors » cvDrawContours

cvDrawContours


Module: OpenCV

Draws contour outlines or filled contours.

Name Type Range Description
inImage Image Input image.
inContours PathArray All the input contours.
inContourIdx Integer -1 - Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
inColor Pixel Color of the contours.
inThickness Integer 1 - Thickness of lines the contours are drawn with. If it is negative, the contour interiors are drawn.
inLineType RegionConnectivity Line connectivity.
inHierarchy IntegerArrayArray* Optional information about hierarchy. It is only needed if you want to draw only some of the contours.
inMaxLevel Integer Maximal level for drawn contours. If it is 0, only the specified contour is drawn. If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account when there is hierarchy available.
inOffset Location* Contour shift parameter.
outImage Image Output image.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Each array in inHierarchy must be an array made from 4 elements.
DomainError inContourIdx is greater than number of contours in cvDrawContours.
DomainError Number of elements in inHierarchy must be the same as in inContours in cvDrawContours.

Complexity Level

This filter is available on Basic Complexity Level.