| Customize Help
| Save Settings

MimHistogramEqualize



Function Map
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
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 one of 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
Click to summarizeValue Description
Click to summarize M_EXPONENTIAL

Specifies an equalization density function which generates an Exponential distribution.

Output probability density model:

Transfer function:

(summarize)
Click to summarize M_HYPER_CUBE_ROOT

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

Output probability density model:

Transfer function:

(summarize)
Click to summarize M_HYPER_LOG

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

Output probability density model:

Transfer function:

(summarize)
Click to summarize M_RAYLEIGH

Specifies an equalization density function which generates a Rayleigh distribution.

Output probability density model:

Transfer function:

(summarize)
Click to summarize M_UNIFORM

Specifies an equalization density function which generates a Uniform distribution.

Output probability density model:

Transfer function:

(summarize)
Alpha

Specifies the value to use for alpha (α) in the equations for M_EXPONENTIAL and M_RAYLEIGH. For other Operation parameter values, set Alpha to M_NULL.

function map For specifying the alpha value
Click to summarizeValue Description
Click to summarize Value > 0

Specifies the value to use for alpha (α).

For an M_EXPONENTIAL operation, a greater alpha value yields a lower occurrence of the most frequent pixels of the histogram in the resulting image buffer. When operating on an 8-bit unsigned image, a typical value for alpha is between 0.001 and 0.1.

For an 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. When operating on an 8-bit unsigned image, a typical value for alpha is between 10 and 1000.

(summarize)
Min

Specifies the lowest pixel value to equalize.

function map For specifying the lowest pixel value to equalize
Click to summarizeValue Description
Click to summarize Value >= 0

Specifies the lowest pixel value.

Max

Specifies the highest pixel value to equalize.

function map For specifying the highest pixel value to equalize
Click to summarizeValue Description
Click to summarize Min <= Value <= max buffer value

Specifies the highest pixel value.

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