Core Optical, Inc.
HistogramProcessor EqualizeHistogramInPlace Method Industrial Strength, Scientific Grade
Applies the Histogram Equalization algorithm in-place to the data object.

Namespace: PrecisionImage.HistogramProcessing
Assembly: PrecisionImage (in PrecisionImage.dll) Version: (

public void EqualizeHistogramInPlace(
	SourceData sourceData,
	int channel,
	Int32Rect regionOfInterest = null,
	HistogramResolution histogramResolution = HistogramResolution.EightBit,
	BinaryMask binaryMask = null,
	OutputWindowing outputWindow = null


Type: PrecisionImage SourceData
A SourceData type containing the image data.
Type: OnlineSystem Int32
An OnlineInt32 type indicating the data channel to process.
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
An OnlineInt32Rect type indicating the region of interest. Coordinates are zero-index based. This parameter is optional and defaults to the entire image.
histogramResolution (Optional)
Type: PrecisionImage.HistogramProcessing HistogramResolution
A HistogramResolution enumeration specifying the resolution of the histogram used internally by the algorithm when characterizing and redistributing the data. This parameter is optional and defaults to 8-bit histogram resolution.
binaryMask (Optional)
Type: PrecisionImage.BinarizationAndMorphology BinaryMask
A BinaryMask type specifying a mask indicating areas of the image to bypass. Masked regions are not altered, nor are they used internally when determining the initial histogram. This parameter is optional.
outputWindow (Optional)
Type: PrecisionImage.Visualization OutputWindowing
An OutputWindowing type used to specify the extents of the histogram rescaling. This parameter is optional and defaults to the original minimum and maximum values of the sourceData object if no region of interest is specified. If a region of interest is specified, the output windowing behavior is to clip at the region of interest minimum and maximum values.

OnlineSystem ArgumentNullException Thrown when sourceData is null.
OnlineSystem ArgumentOutOfRangeException Thrown when channel is negative or out of range.
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies a rectangular region not completely contained within the dimensions of the source data.
OnlineSystem ArgumentOutOfRangeException Thrown when the number of rows and/or columns in binaryMask do not match those of sourceData.
OnlineSystem ArgumentOutOfRangeException Thrown when the minimum clipping value of outputWindow exceeds the maximum value.
OnlineSystem ArgumentException Thrown when outputWindow does not contain scale information for the specified data channel.

This method applies the Histogram Equalization algorithm in-place to the data contained within the specified channel of sourceData. The data is redistributed so that the probabilty distribution function of the data is as flat as possible, maximizing image entropy. The histogram of the data can be redistributed between it's local minimum and maximum values (default behavior) or redistributed to some arbitrary range specified by the OutputWindowing parameter.

Histogram equalization is an inherently discrete operation i.e. the data is discretized into a series of histogram bins before and after equalization. To ensure optimum results and minimize discretization error, specify a HistogramResolution that most closely resembles the nature of the original data. For example, if the sourceData is originally sourced from a 16-bit image, specify histogramResolution to be SixteenBit.

Note that this method will alter the values contained within the sourceData object.

See Also