| Customize Help
| Save Settings

MimHistogram



Function Map
Synopsis
Generate the intensity histogram of an image.
Syntax
void MimHistogram(
MIL_ID SrcImageBufId, //in
MIL_ID HistResultImId //in
)
Description

This function calculates the histogram (or pixel intensity distribution) of the specified source image and stores the results in the specified result buffer.

You can control the bin size of the calculated histogram, and the number of smoothing iterations to perform on it, by calling MimControl() with M_HIST_BIN_SIZE_MODE and M_HIST_SMOOTHING_ITERATIONS. By default, a histogram has 1 value per bin, and has not been smoothed.

To read the resulting histogram values from the result buffer, use MimGetResult1d() or MimGetResult(), and specify M_CUMULATIVE_VALUE, M_HIST_..., M_PERCENTILE_VALUE, or M_VALUE as the result type.

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).

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 source image buffer. The image buffer must be 1-band.

Buffer data will be treated as unsigned, if MimControl() with M_HIST_BIN_SIZE_MODE is set to M_DEFAULT or M_REGULAR. That is, floating-point values will be cast to MIL_UINT values before generating the histogram. In this case, unexpected results can occur if a floating-point value exceeds the MIL_UINT range.

Signed buffers are remapped in the result such that the minimum value is 0, if you set M_HIST_BIN_SIZE_MODE to M_FIT_SRC_DATA, M_FIT_SRC_RANGE, or M_FREEDMAN.

8-, 16-, and 32-bit source image buffers are supported, unless you set M_HIST_BIN_SIZE_MODE to M_FREEDMAN. In this case, 8- and 16-bit source image buffers are supported.

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.

HistResultImId

Specifies the identifier of the destination for the histogram results. This parameter must be given the identifier of an image processing result buffer that was allocated with MimAllocResult() and has an M_HIST_LIST type.

If the result buffer has fewer entries than the full range of source values, the pixel values that are out of range will not be included in the histogram. If, however, the result buffer has more entries than the full range of source values, the entries that are out of range will have an undetermined value.

Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC VECTOR