MimHistogramEqualizeAdaptive
| Board | Supported |
|---|---|
| Host System | Yes |
| V4L2 | Yes |
| Clarity UHD | Yes |
| Concord PoE | No |
| GenTL | Yes |
| GevIQ | Yes |
| GigE Vision | Yes |
| Indio | No |
| Iris GTX | Yes |
| Radient eV-CL | Yes |
| Rapixo CL | Yes |
| Rapixo CoF | Yes |
| Rapixo CXP | Yes |
| USB3 Vision | Yes |
Perform an adaptive histogram equalization on an image.
Syntax
void MimHistogramEqualizeAdaptive(
AIL_ID AdaptiveEqualizeContextImId, //in
AIL_ID SrcImageBufId, //in
AIL_ID DstImageBufId, //out
AIL_INT64 ControlFlag //in
)
Description
This function enhances the contrast of the specified source image by applying a Contrast Limited Adaptive Histogram Equalization (CLAHE). The resulting image is placed in the destination image buffer.
This function first partitions the specified source image into a set of rectangular sections of equal size, referred to as tiles, and calculates histograms for each one. The histograms are then used to transform the image and produce an enhanced (equalized) version of it. By default, MimHistogramEqualizeAdaptive uses 8 tiles along the image's X- and Y-direction. To modify the number of tiles, call MimControl with M_NUMBER_OF_TILES_X and M_NUMBER_OF_TILES_Y. Though MimHistogramEqualizeAdaptive can take longer to execute than a conventional histogram equalization (MimHistogramEqualize), it can help minimize the over-amplification of noise and the potential for saturation, particularly in images with inconsistent lighting where some sections are significantly brighter than others.
By default, the maximum percentage of pixels that can be represented by a histogram bin is limited to 1% of all the pixels in its respective tile. Exceeding values are distributed evenly among that histogram's other bins. To modify this behavior, use the M_CLIP_LIMIT control.
You can also modify the number of histogram bins for each tile, as well as the equalization operation performed, using the M_HIST_SIZE and M_OPERATION controls. By default, MimHistogramEqualizeAdaptive determines the number of histogram bins automatically according to the specified source image and performs a uniform-type of equalization.
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, results are limited to the portion of the ROIs that intersect.
Parameters
AdaptiveEqualizeContextImId (in, AIL_ID)
Specifies the identifier of the adaptive histogram equalization context. The context must have been allocated using MimAlloc with M_HISTOGRAM_EQUALIZE_ADAPTIVE_CONTEXT.
SrcImageBufId (in, AIL_ID)
Specifies the identifier of the source image buffer. The buffer must be a 1-band, 8- or 16-bit image buffer allocated using MbufAlloc... with M_IMAGE + M_PROC. The type of the source image buffer must be the same as the destination image buffer. To inquire this information, use MbufInquire with M_TYPE.
DstImageBufId (out, AIL_ID)
Specifies the identifier of the destination image buffer. The buffer must be a 1-band, 8- or 16-bit image buffer allocated using MbufAlloc... with M_IMAGE + M_PROC. The type of the destination image buffer must be the same as the source image buffer. To inquire this information, use MbufInquire with M_TYPE.
ControlFlag (in, AIL_INT64)
Reserved for future expansion and must be set to M_DEFAULT.