MimHistogramEqualize()函数

Synopsis

Perform a histogram equalization of an image.

Format

void MimHistogramEqualize(SrcImageBufId, DestImageBufOrLutBufId, Method, Alpha, Min, Max)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufOrLutBufId; Destination image or LUT buffer identifier
long Method; Type of equalization
double Alpha; Adjustment parameter
double Min; Lowest pixel value to equalize
double Max; Highest pixel value to equalize

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.

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

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

The Method parameter specifies the type of equalization to perform. The following methods and their associated density functions are available:

Required distribution Output probability density model Transfer functions
Uniform
M_UNIFORM
image image
Exponential
M_EXPONENTIAL
image image
Rayleigh
M_RAYLEIGH
image image
Hyperbolic cube root
M_HYPER_CUBE_ROOT
image image
Hyperbolic logarithmic
M_HYPER_LOG
image image

The cumulative probability distribution of the input image is approximated by its cumulative histogram:

BM33

Refer to Digital Image Processing, William K. Pratt, United States, John Wiley & Sons, 1978, p.318.

The Alpha parameter is used with M_EXPONENTIAL and M_RAYLEIGH methods. In the case of the M_EXPONENTIAL method, 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 method, the greater the alpha is, the greater the occurrence of the most frequent pixels of the histogram in the resulting image buffer.

The Min and Max parameters specify the range of pixels that will be remapped.

Note

Floating point values will be cast as unsigned long values before performing the histogram. Therefore, unexpected results can occur if a floating point value is larger than the unsigned long range.

See also

MimLutMap, MimHistogram

《MimHistogramEqualize()函数》上有1条评论

评论已关闭。