ColorHistogram Method
Syntax
CWIMAQVision.ColorHistogram SourceImage, Plane1Histogram, Plane2Histogram, Plane3Histogram, ColorFormat [, NumberOfClasses = 256] [, Plane1Report] [, Plane2Report] [, Plane3Report] [, MaskImage]
Return Type
On success, this method returns 0. On failure, this method returns a negative number.
Purpose
Obsolete—Use ColorHistogram3 instead. Calculates the histogram, or pixel distribution, of a color image.
Remarks
Use this method with image types RGB32 and HSL32. MaskImage must be a U8 image.
Parameters
SourceImage As CWIMAQImage
The color image used to compute the histogram.
Plane1Histogram As Variant
On return, the histogram report of the red (RGB), or the hue (HSL, HSV, HSI) plane.
Plane2Histogram As Variant
On return, the histogram report of the green (RGB), or the saturation (HSL, HSV, HSI) plane.
Plane3Histogram As Variant
On return, the histogram report of the blue (RGB), the luminance (HSL), the value (HSV), or the intensity (HSI) plane.
ColorFormat As CWIMAQColorFormats
The color space in which to perform the histogram.
NumberOfClasses As Variant
[Optional] The number of classes into which the method separates the pixels.
This parameter has a default value of 256.
Plane1Report As Variant
[Optional] On return, a CWIMAQHistogramReport object containing detailed statistics from the histogram calculated on the red or the hue plane, depending on the value of ColorFormat.
Plane2Report As Variant
[Optional] On return, a CWIMAQHistogramReport object containing detailed statistics from the histogram calculated on the green or the saturation plane, depending on the value of ColorFormat.
Plane3Report As Variant
[Optional] On return, a CWIMAQHistogramReport object containing detailed statistics from the histogram calculated on the blue, lightness, value, or intensity plane, depending on the value of ColorFormat.
MaskImage As Variant
[Optional] A CWIMAQImage object that indicates the region to use for computing the histogram. The method calculates the histogram using only those pixels in the image whose corresponding pixels in the mask are non-zero. Do not set this parameter if you want to perform a histogram on the entire image.