Structure Analysis       

This palette contains functions for contour finding, blob analysis, match shape, draw contour and more.

Note: A vi icon with yellow background means they work on color images. With gray background means they only work on single channel image. With half yellow and half gray background means they work on both color and single channel image. Others vi icon background are for either examples or high level vis. For controls descriptions, you need to go to the vi in LabVIEW, use help (ctrl+H) and move mouse over the controls to see them.


IVision_FindContours.vi

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 .

Connector Pane

IVision_FindContours.vi


IVision_ApproxPolyDP.vi

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.

Connector Pane

IVision_ApproxPolyDP.vi


IVision_GetContourBoundingRect.vi

Calculates up-right bounding rectangle of contour.

Connector Pane

IVision_GetContourBoundingRect.vi


IVision_GetContourArea.vi

Calculates area of the contour.

Connector Pane

IVision_GetContourArea.vi


IVision_GetContourPerimeter.vi

Calculates perimeter of the contour.

Connector Pane

IVision_GetContourPerimeter.vi


IVision_GetContourAttributes.vi

Find blob attributes like area, perimeter, mass center, rect, orientation and eccentricity.

Connector Pane

IVision_GetContourAttributes.vi


IVision_MatchShape.vi

Compare two shapes.

Connector Pane

IVision_MatchShape.vi


IVision_CreateContourTree.vi

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.

Connector Pane

IVision_CreateContourTree.vi


IVision_ContourFromConTree.vi

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.

Connector Pane

IVision_ContourFromConTree.vi


IVision_MatchContourTrees.vi

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.

Connector Pane

IVision_MatchContourTrees.vi


IVision_DrawContours.vi

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.

Connector Pane

IVision_DrawContours.vi