imaqClampMax

NI Vision for LabWindows/CVI Function

imaqClampMax

Usage

int imaqClampMax(Image* image, RotatedRect searchRect, RakeDirection direction, float* distance, const FindEdgeOptions* options, const CoordinateTransform2* transform, PointFloat* firstEdge, PointFloat* lastEdge);

Purpose

Measures a distance from the sides of the search area towards the center of the search area. This function locates edges along a set of parallel search lines called a rake. The function detects the edges based on their contrast and slope. The function calculates a hit-line to the object through the first edge it detects. The function calculates a second hit-line to the object through the last edge it detects. The function measures the distance between those two lines.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL

Parameters

Name

Type

Description

image Image* The image that the function uses for distance measurement.
searchRect RotatedRect The coordinate location of the rectangular search area of the distance measurement.
direction RakeDirection The direction the function search for edges along the search lines.
distance float* Upon return, the distance measured between the two parallel hit-lines. This parameter is required and cannot be NULL.
options const FindEdgeOptions* Describes how you want the function to detect edges and what information the function should overlay onto the image.
transform const CoordinateTransform2* An optional specification of the coordinate transform for searchRect. This parameter specifies how to transform the location of the distance measurement based on the difference between the reference coordinate system and the measurement coordinate system. Set this parameter to NULL if you do not need to transform searchRect.
firstEdge PointFloat* On return, the coordinate location of the first edge used to measure the distance. If you do not need this information, set this parameter to NULL.
lastEdge PointFloat* On return, the coordinate location of the last edge used to measure the distance. If you do not need this information, set this parameter to NULL.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqDispose().

Parameter Discussion

options—Set the options parameter to NULL to use the default options, as follows:

threshold 40
width 4
steepness 2
subsamplingRatio 5
showSearchArea FALSE
showSearchLines FALSE
showEdgesFound FALSE
showResult TRUE