AutoBThreshold Method

NI Vision for Visual Basic

AutoBThreshold Method

Syntax

CWIMAQVision.AutoBThreshold SourceImage, Method, LookupTable, ThresholdValue

Return Type

Long

Returns 0 if no error; returns a negative number to indicate an error.

Purpose

Obsolete—Use AutoThreshold2 instead. The Automatic Binary Threshold applies a threshold to an image that initially possesses 256 gray levels that divide the image into two classes. A statistical calculation is done to determine the optimal threshold.

Remarks

Use this method with U8 images.

Parameters

SourceImage As CWIMAQImage

The image to process.

Method As CWIMAQAutoThresholdMethods

The threshold method to use.

LookupTable As Variant

Returns a lookup table containing 256 elements encoded in 0 and 1. If the threshold value is 160, the values between 0 and 159 become zero and the values between 160 and 255 become 1. This array can be directly used by CWIMAQVision.UserLookup.

ThresholdValue As Long

Returns the computed threshold value.

See Also

AutoThreshold