This function retrieves contours from binary image. The function modifies
the source image content.
Output parameter"First Contour Ref" will contain the pointer to
the first outer contour. User can use IVision_GetNextSeq.vi and
IVision_GetNextSeq_V.vi to get other contours.The source must be a 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 Threshold, AdaptiveThreshold or Canny functions.
This function can retrieve contours in different mode:
EXTERNAL: retrives only the extreme outer contours
LIST: retrieves all the contours and puts them in the list
CCOMP: retrieves all the contours and organizes them into two-level
hierarchy: top level are external boundaries of the components, second level
are bounda boundaries of the holes
TREE: retrieves all the contours and reconstructs the full hierarchy of
nested contours .

Approximates one or more curves and returns the approximation result. In
case of multiple curves approximation the resultant tree will have the same
structure as the input one (1:1 correspondence). See IVision_FindContours.vi
for description of hierarchical contour structures.

Calculates up-right bounding rectangle of contour.
![]()
Calculates area of the contour.
![]()
Calculates perimeter of the contour.
![]()
Find blob attributes like area, perimeter, mass center, rect, orientation
and eccentricity.
![]()
Compare two shapes.

Creates binary tree representation for the input contour and returns the
pointer to its root. If the parameter threshold is less than or equal to 0, the
function creates full binary tree representation. If the threshold is greater
than 0, the function creates representation with the precision threshold: if
the vertices with the interceptive area of its base line are less than
threshold, the tree should not be built any further.

restores the contour from its binary tree representation. The parameter
criteria determines the accuracy and/or the number of tree levels used for
reconstruction, so it is possible to build approximated contour. The function returns
reconstructed contour.

calculates the value of the matching measure for two contour trees. The
similarity measure is calculated level by level from the binary tree roots. If
at the certain level difference between contours becomes less than threshold,
the reconstruction process is interrupted and the current difference is
returned.

The function draws contour outlines in the image if thickness>=0 or fills
area bounded by the contours if thickness<0.
Input image is where the contours are to be drawn. Like in any other drawing
function, the contours are clipped with the ROI.
