MIL_ID SrcImageBufId, | //in |
MIL_ID DstImageBufId, | //in |
MIL_INT64 Operation, | //in |
MIL_DOUBLE Alpha, | //in |
MIL_DOUBLE Min, | //in |
MIL_DOUBLE Max | //in |
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.
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.
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.
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:
For specifying the type of equalization
to perform
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EXPONENTIAL |
Specifies an equalization density function which generates an Exponential distribution. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HYPER_CUBE_ROOT |
Specifies an equalization density function which generates a Hyperbolic Cube Root distribution. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HYPER_LOG |
Specifies an equalization density function which generates a Hyperbolic Logarithmic distribution. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RAYLEIGH |
Specifies an equalization density function which generates a Rayleigh distribution. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_UNIFORM |
Specifies an equalization density function which generates a Uniform distribution. (more details...) |
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.
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |