Histogram Method

NI Vision for Visual Basic

Histogram Method

Syntax

CWIMAQVision.Histogram SourceImage, Histogram [, NumberOfClasses = 256] [, MinValue = 0] [, MaxValue = 0] [, HistogramReport] [, MaskImage]

Return Type

Long

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

Purpose

Obsolete—Use Histogram2 instead. Calculates the histogram, or pixel value distribution, of an image.

Remarks

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

Parameters

SourceImage As CWIMAQImage

The image the method uses to compute the histogram.

Histogram As Variant

On return, an array describing the number of pixels that fell into each class.

NumberOfClasses As Variant

[Optional] The number of classes into which the histogram operation separates the pixels in the image.

This parameter has a default value of 256.

MinValue As Variant

[Optional] The minimum pixel value to consider for the histogram. The method does not count pixels with values less than MinValue.

This parameter has a default value of 0.

MaxValue As Variant

[Optional] The maximum pixel value to consider for the histogram. The method does not count pixels with values greater than MaxValue.

This parameter has a default value of 0.

HistogramReport As Variant

[Optional] On return, a CWIMAQHistogramReport object describing the pixel value classification.

MaskImage As Variant

[Optional] A CWIMAQImage object that specifies the region in which the method computes the histogram. The method processes only those pixels in the image whose corresponding pixels in the mask are non-zero. Do not set this parameter if you want to calculate the histogram for the entire image.

See Also

Histogram2