| MIL 10 Reference
| Customize Help
| Save Settings

MimStatMultiple



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

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
Calculates and stores a variety of statistics from the specified source images.
Syntax
void MimStatMultiple(
MIL_ID StatMultipleContextImId, //in
MIL_ID SrcImageBufId, //in
MIL_ID StatMultipleResultImId, //in
MIL_INT64 ControlFlag //in
)
Description

This function accumulates statistics of the specified type for each pixel location across the different source images, passed upon iterative calls to this function. One value is calculated for every pixel in the source image, for each statistical operation performed. The results, passed in the specified result buffer, contain all the results for the same pixel location from multiple different images from previous calls to this function.

You can read the statistics from the result buffer using MimGetResult2d() or MimDraw().

Before using this function, you must configure which statistics to perform, using MimControl().

Once the multiple statistic image processing context is configured, preprocess the context and result buffer by calling MimStatMultiple() with M_PREPROCESS. If the preprocess operation is not done explicitly (using M_PREPROCESS), it will be done when MimStatMultiple() is first called. When preprocessing explicitly, the source image buffer can be set to M_NULL if you explicitly specify the size of the target area using MimControl() with M_SIZE_X and M_SIZE_Y. If, however, the source image buffer is provided, it will be used in the preprocess operation, to better optimize future calls.

To remove the calculated statistics associated with the specified source image from the results buffer, call MimStatMultiple() with M_CALCULATE + M_REMOVE. To reset the results generated from finding the extremes of each pixel's value (such as, M_MIN), use M_RESET_EXTREMES. The result buffer cannot be completely reset; you must free it using MimFree(), and then a allocate new result buffer using MimAlloc() with M_STAT_MULTIPLE_CONTEXT.

Note that making sequential calls to this function using the same result buffer but with multiple source images of different sizes will produce unpredictable results and is not recommended.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
StatMultipleContextImId

Specifies the identifier of the image processing context that specifies the statistics to calculate. The image processing context must have been allocated using MimAlloc() with M_STAT_MULTIPLE_CONTEXT.

SrcImageBufId

Specifies the identifier of the source image buffer. The buffer used must be a 1-band image buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

When preprocessing the multiple statistic image processing context and result buffer, set this parameter to the identifier of a typical source image buffer. To exclude this buffer from preprocessing, set this parameter to M_NULL and set the height and width of the area in the source buffer for which you need statistics, using MimControl() with M_SIZE_X and M_SIZE_Y; otherwise an error will occur.

StatMultipleResultImId

Specifies the identifier of the result buffer. The buffer must have been allocated using MimAllocResult() with M_STAT_MULTIPLE_RESULT.

ControlFlag

Specifies the operation to perform on the source image.

function map To specify the operation to perform
CollapseValue Description
Collapse M_CALCULATE +

Calculates the statistics specified using MimControl().

Collapse M_PREPROCESS

Preprocesses the specified image processing context and image processing result buffer. Note that, if not called explicitly, this operation will be performed automatically upon the first call to MimStatMultiple().

If the identifier of the source image buffer is not set to M_NULL, information about the source image buffer will be used in the preprocessing operation.

(summarize)
Collapse M_RESET_EXTREMES

Resets the results generated from M_MIN, M_MIN_ABS, M_MAX, and M_MAX_ABS operations. Note that, when resetting the minimum and maximum results, the SrcImageBufId parameter must be set to M_NULL.

(summarize)
Combination constant for M_CALCULATE.

You can add the following value to the above-mentioned value to removethe results related to the specified source image buffer from the accumulated results in the specified result buffer.

function map To remove the calculated results
CollapseCombination value Description
Collapse M_REMOVE

Removes the results related to the specified source image. This removes the results of the calculations, performed on the specified source image, from the accumulated results in the result buffer.

Note that to reset the minimum and maximum statistical results, use M_RESET_EXTREMES. The minimum and maximum statistical results cannot be removed.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
STAT MULTIPLE CONTEXT PROC NONE CALCULATE PREPROCESS RESET EXTREMES REMOVE