imaqLowPass

NI Vision for LabWindows/CVI Function

imaqLowPass

Usage

int imaqLowPass(Image* dest, Image* source, int width, int height, float tolerance, const Image* mask);

Purpose

Filters an image using a non-linear filter. For each pixel, the algorithm considers the neighborhood specified by the given filter sizes. If the current pixel value varies from the value of its neighbors more than the specified tolerance, the function sets the pixel value to the average value of its neighborhood. If the current pixel value varies from the value of its neighbors less than the specified tolerance, the function does not change the value of the pixel.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL

Parameters

Name

Type

Description

dest Image* The destination image.
source Image* The image to filter. The filter modifies the border of the source image. The border must be at least half as large as the larger of the neighborhood dimensions.
width int The width of the rectangular neighborhood around the pixel on which the function operates. This number must be odd.
height int The height of the rectangular neighborhood around the pixel on which the function operates. This number must be odd.
tolerance float The maximum allowable variance.
mask const Image* An optional mask image. This image must be an IMAQ_IMAGE_U8 image. The function filters only those pixels in the source image whose corresponding pixels in the mask are non-zero. Set this parameter to NULL to apply the filter 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().

Parameter Discussion

source—This function modifies the source image. If you need the original image, create a copy of the image using imaqDuplicate() before using this function.