imaqColorHistogram

NI Vision for LabWindows/CVI Function

imaqColorHistogram

Usage

ColorHistogramReport* imaqColorHistogram(Image* image, int numClasses, ColorMode mode, const Image* mask);

Purpose

Calculates the histogram, or pixel distribution, of a color image.

Note   This function does not support the CIE L*a*b* or CIE XYZ color modes.

Note   This function is obsolete. The replacement function is imaqColorHistogram2().

Image Types Supported

IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL

Parameters

Name

Type

Description

image Image* The image whose histogram the function calculates.
numClasses int The number of classes into which the function separates the pixels.
mode ColorMode The color space in which to perform the histogram.
mask const Image* An optional mask image. This image must be an IMAQ_IMAGE_U8 image. The function calculates the histogram using only those pixels in the image whose corresponding pixels in the mask are non-zero. Set this parameter to NULL to calculate the histogram of the entire image.

Return Value

Type

Description

ColorHistogramReport* On success, this function returns a report describing the classification of each plane in a HistogramReport. On failure, this function returns NULL. To get extended error information, call imaqGetLastError().When you are finished with the report, dispose of it by calling imaqDispose().