imaqMultithreshold
Usage
int imaqMultithreshold(Image* dest, const Image* source, const ThresholdData* ranges, int numRanges);
Purpose
Thresholds an image into multiple classes. The function classifies each pixel into the first threshold range of which it is a member. If a pixel is not a member of any of the given ranges, the function sets it to 0. For example, given two threshold ranges:
rangeMin | rangeMax | useNewValue | newValue |
80 | 150 | TRUE | 10 |
120 | 200 | FALSE | ignored |
The function operates as follows:
- The function replaces pixel values below 80 with 0.
- The function replaces pixel values from 80 to 150 with 10.
- The function does not change pixel values from 151 to 200.
- The function replaces pixel values above 200 with 0.
For more information about thresholding, refer to imaqThreshold().
Image Types Supported
IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL
Parameters
Name
|
Type
|
Description
|
---|---|---|
dest | Image* | The destination image. |
source | const Image* | The source image. |
ranges | const ThresholdData* | An array of threshold ranges. This array is required and cannot be NULL. |
numRanges | int | The number of elements in the ranges array. |
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 imaqGetLastError(). |