imaqMathTransform
Usage
int imaqMathTransform(Image* dest, const Image* source, MathTransformMethod method, float rangeMin, float rangeMax, float power, const Image* mask);
Purpose
Transforms an image by applying a transfer function to the value of each pixel. The function applies the transform T(x) over a specified input range [rangeMin, rangeMax] in the following manner:
T(x) = dynamicMin if x <= rangeMin
f(x) if rangeMin < x <= rangeMax
dynamicMax if x > rangeMax
where
dynamicMin = 0 (8-bit images) or the smallest initial pixel value (16-bit and floating point images)
dynamicMax = 255 (8-bit images) or the largest initial pixel value (16-bit and floating point images)
dynamicRange = dynamicMax - dynamicMin
The function scales f(x) so that f(rangeMin) = dynamicMin and f(rangeMax) = dynamicMax. f(x) behaves on (rangeMin, rangeMax) according to the method you select.
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. |
method | MathTransformMethod | The transform function to use. |
rangeMin | float | The smallest pixel value on which the function applies the transform. |
rangeMax | float | The largest pixel value on which the function applies the transform. |
power | float | If you set method to IMAQ_TRANSFORM_POWX or IMAQ_TRANSFORM_POW1X, power specifies the power to which the function raises the value. |
mask | const Image* | An optional mask. This image must be an IMAQ_IMAGE_U8 image. The function transforms only those source pixels whose corresponding mask pixels are non-zero. All other pixels remain unchanged. Set this parameter to NULL to apply the transform to the entire source image. |
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(). |