LocalThreshold Method

NI Vision for Visual Basic

LocalThreshold Method

Syntax

CWIMAQVision.LocalThreshold SourceImage, DestImage, Options

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Automatically thresholds an image into a binary image based on the requested local adaptive thresholding method.

Remarks

Use this method with U8 and I16 images. All of the images you pass to this method must be of the same type.

The window size you specify in Options should be sized as large as possible but small enough that each window contains pixels under similar lighting conditions. This method will produce inconsistent results for windows that contain uniform pixel values.

Parameters

SourceImage As CWIMAQImage

The image to threshold.

DestImage As CWIMAQImage

The resulting image.

Options As CWIMAQLocalThresholdOptions

Specifies the options to use to perform the local threshold.