| MIL 10 Reference
| Customize Help
| Save Settings

MimHistogramEqualize



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Perform a histogram equalization of an image.
Syntax
void MimHistogramEqualize(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT64 Operation, //in
MIL_DOUBLE Alpha, //in
MIL_DOUBLE Min, //in
MIL_DOUBLE Max //in
)
Description

This function performs a histogram equalization of the specified source image. Results are written to a destination buffer, which can be either an image buffer or a LUT buffer.

This function first performs a histogram of the source image buffer. The histogram is then used to calculate a transformation LUT that can be used to enhance the source image (with MimLutMap()). If the destination buffer is a LUT, the transformation LUT is copied into the destination LUT. If the destination buffer is an image, the source buffer is remapped through the transformation LUT to produce the destination image.

Note that floating-point values will be cast to MIL_UINT32 values before performing the histogram. Therefore, unexpected results can occur if a floating-point value is larger than the MIL_UINT32 range.

You can limit this function's results to a region of an image buffer using a region of interest (ROI) set using MbufSetRegion(). The ROI must be defined in raster format (M_RASTER or M_VECTOR_AND_RASTER). An error is generated if the ROI is only in vector format (M_VECTOR).

If you specify multiple image buffers with an ROI, this function performs a histogram using the source ROI, and writes to the destination only those pixels that intersect between the source ROI and the destination ROI. This is consistent with the behavior of this function when ROIs are not specified.

If MimHistogramEqualize() is not producing the results you expect, try performing an adaptive histogram equalization, using MimHistogramEqualizeAdaptive()). Though an adaptive histogram equalization can take longer to execute (more calculations to process), it can help minimize the over-amplification of noise and the potential for saturation. Unlike MimHistogramEqualize(), MimHistogramEqualizeAdaptive() is not available with MIL-Lite.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SrcImageBufId

Specifies the identifier of the data source of the operation. This parameter will be treated as an unsigned image buffer identifier.

If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.

DstImageBufId

Specifies the identifier of the destination of the results. This parameter must be given an image buffer or LUT buffer identifier.

If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.

Operation

Specifies the equalization operation to perform. This parameter can be set to the following values. Note that the cumulative probability distribution, Pf(f), of the input image is approximated by its cumulative histogram:

Refer to "Pratt, William K. Digital Image Processing . United States: John Wiley & Sons, 1978. 318.".
function map For specifying the type of equalization to perform
CollapseValue Description
Collapse M_EXPONENTIAL

Specifies an equalization density function which generates an Exponential distribution.

Output probability density model:

Transfer function:

(summarize)
Collapse M_HYPER_CUBE_ROOT

Specifies an equalization density function which generates a Hyperbolic Cube Root distribution.

Output probability density model:

Transfer function:

(summarize)
Collapse M_HYPER_LOG

Specifies an equalization density function which generates a Hyperbolic Logarithmic distribution.

Output probability density model:

Transfer function:

(summarize)
Collapse M_RAYLEIGH

Specifies an equalization density function which generates a Rayleigh distribution.

Output probability density model:

Transfer function:

(summarize)
Collapse M_UNIFORM

Specifies an equalization density function which generates a Uniform distribution.

Output probability density model:

Transfer function:

(summarize)
Alpha

Specifies the adjustment parameter. Alpha is used with the Operation parameter values M_EXPONENTIAL and M_RAYLEIGH. For other Operation parameter values, set Alpha to M_NULL.

In the case of the M_EXPONENTIAL operation, a greater Alpha yields a lower occurrence of the most frequent pixels of the histogram in the resulting image buffer.

In the case of the M_RAYLEIGH operation, the greater the alpha is, the greater the occurrence of the most frequent pixels of the histogram in the resulting image buffer.

Min

Specifies the lowest pixel value to equalize.

Max

Specifies the highest pixel value to equalize.

Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
UNSIGNED PROC VECTOR PROC VECTOR EXPONENTIAL HYPER CUBE ROOT HYPER LOG RAYLEIGH UNIFORM