Equalize Method

NI Vision for Visual Basic

Equalize Method

Syntax

CWIMAQVision.Equalize SourceImage, DestImage, Histogram, HistogramReport, MinValue, MaxValue [, MaskImage]

Return Type

Long

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

Purpose

Obsolete—Use Equalize2 instead.

Creates a histogram equalization of an image. The method redistributes the pixel values of an image to create a linear accumulated histogram. You must execute CWIMAQVision.Histogram prior to this method to supply HistogramReport as input for Equalize. The precision of the method depends on the histogram precision, which in turn depends on the number of classes used in the histogram.

Remarks

Use this method with U8, I16, and SGL images. MaskImage must be a U8 image.

The modification to the pixel value depends on the histogram contents, regardless of the image type. All pixels that fall into the same histogram class have an identical value after equalization.

Parameters

SourceImage As CWIMAQImage

The image to process.

DestImage As CWIMAQImage

The resulting image.

Histogram As Variant

The histogram values in an array. The elements found in this array are the number of pixels per class. The n classes contain all pixel values belonging to the interval

[Starting Value + (n+1) * Interval Width, Starting Value + n * Interval Width -1].

HistogramReport As CWIMAQHistogramReport

The histogram of the source image that is supplied as an output of the CWIMAQVision.Histogram function. It is necessary to input the same image to both CWIMAQVision.Histogram and this function.

MinValue As Variant

The smallest value used for processing. After processing, all pixel values that were equal to or less than the MinValue (in the original image) are set to 0 for an 8-bit image or to the smallest pixel value found in the original image for 16-bit and 32-bit images.

MaxValue As Variant

The largest value used for processing. After processing, all pixel values that were equal to or greater than the MaxValue (in the original image) are set to 255 for an 8-bit image or to the largest pixel value found in the original image for 16-bit and 32-bit images.

MaskImage As Variant

[Optional] A CWIMAQImage object that specifies the region in the image to use for computing the histogram. Only pixels in the original image that correspond to a nonzero pixel in the mask is replaced. All pixels not corresponding to this criteria maintain their original value. The complete image is modified if this input is not specified.

See Also

Equalize2