| MIL 10 Reference
| Customize Help
| Save Settings

MimHistogram



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox GPU processing driver

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
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.

[Matrox GPU processing driver]

The source image buffer must be unsigned monochrome 1- (packed binary), 8- or 16-bit, or floating-point.

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.

[Matrox GPU processing driver]

Generation of 8-bit histograms has been optimized as a very fast process.

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