imaqDetectExtremes

NI Vision for LabWindows/CVI Function

imaqDetectExtremes

Usage

ExtremeReport* imaqDetectExtremes(const double* pixels, int numPixels, DetectionMode mode, const DetectExtremesOptions* options, int* numExtremes);

Purpose

Finds the location, amplitude, and second derivative of the extremes (either peaks or valleys) in the input array. This function uses an algorithm that fits a quadratic polynomial to sequential groups of data points.

Parameters

Name

Type

Description

pixels const double* The array of pixel data the function processes.
numPixels int The number of pixels in the supplied array. You must supply at least as many pixels as the value you supply for the width element in the options parameter.
mode DetectionMode Determines if the function detects peaks or detects valleys.
options const DetectExtremesOptions* Describes how the function calculates the extremes.
numExtremes int* On return, the number of extremes found by the function. Set this parameter to NULL if you do not need this information.

Return Value

Type

Description

ExtremeReport* On success, this function returns an array of information about each extreme found. On failure, this function returns NULL. To get extended error information, call imaqGetLastError(). When you are finished with the return value, dispose of the pointer by calling imaqDispose().

Parameter Discussion

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

threshold 0
width 3