imaqStraightEdge

NI Vision for LabWindows/CVI Function

imaqStraightEdge

Usage

StraightEdgeReport2* imaqStraightEdge(const Image* image, const ROI* roi, SearchDirection searchDirection, const EdgeOptions2* edgeOptions, const StraightEdgeOptions* straightEdgeOptions);

Purpose

Finds straight edges inside an ROI in an image.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL

Parameters

Name

Type

Description

image const Image* The image in which to find edges.
roi const ROI* The ROI to find straight edges inside.
searchDirection SearchDirection The direction to search for straight lines. The first contour of roi must be a rectangle, rotated rectangle, or a 4-sided closed contour.
edgeOptions const EdgeOptions2* Specifies the parameters that are used to compute the edge profile and detect edges.
straightEdgeOptions const StraightEdgeOptions* Specifies the options used to fit a line in the roi.

Return Value

Type

Description

StraightEdgeReport2* On success, this function returns a structure of information about the edges found. On failure, this function returns NULL. To get extended error information, call imaqGetLastError(). When you are finished with this structure, dispose of it by calling imaqDispose().

Parameter Discussion

edgeOptions—Set edgeOptions to NULL to use the following default values:

polarity IMAQ_SEARCH_FOR_ALL_EDGES
kernelSize 3
width 3
minThreshold 10.0
interpolationType IMAQ_BILINEAR_FIXED
columnProcessingMode IMAQ_MEDIAN_COLUMNS

straightEdgeOptions—Set straightEdgeOptions to NULL to use the following default values:

numLines 1
searchMode IMAQ_USE_BEST_PROJECTION_EDGE
minScore 10.0
maxSize 1000.0
orientation 0.0
angleRange 10.0
angleTolerance 1.0
stepSize 3
minSignalToNoiseRatio 0.0
minCoverage 25.0
houghIterations 5