Click here to show toolbars of the Web Online Help System: show toolbars |
MIL_ID StatContextImId, | //in |
MIL_ID SrcImageBufId, | //in |
MIL_ID StatResultImId, | //in |
MIL_INT64 ControlFlag | //in |
This function calculates a variety of statistics for the pixels that satisfy the specified condition in the source image. Results are stored in the specified statistic result buffer.
This function calculates both statistics and co-occurrence statistics. Before using this function to calculate statistics ( M_STAT...), you must enable the statistical operation to perform, using MimControl() and specify the condition (if any) using M_CONDITION. Co-occurrence statistics ( M_STAT_GLCM...) do not require a condition.
You can read the statistics from the result buffer using, MimGetResult(), MimGetResult1d() MimGetResult2d(), respective to the statistical operation performed. You can also draw statistical results, using MimDraw().
Once the statistic image processing context is configured, preprocess the context and result buffer by calling MimStatCalculate() with M_PREPROCESS. If the preprocess operation is not done explicitly (using M_PREPROCESS), it will be done when MimStatCalculate() is first called. When preprocessing explicitly, the source image buffer can be set to M_NULL if you set the size of the target area ( MimControl() with M_SOURCE_SIZE_X and M_SOURCE_SIZE_Y) to M_DEFAULT. Note that providing the source image buffer better optimizes future calls.
When dealing with a cumulative statistics context, you can remove the calculated statistics associated with the specified source image from the results buffer by call MimStatCalculate() with M_REMOVE. To reset the results generated from finding the extremes of each pixel's value in a cumulative statistics context (such as, M_STAT_MIN), use M_RESET_EXTREMES.
With both the cumulative statistics context or the Statistics image processing context, additional information (such as specific calculated values) can be overridden (by performing the operation again). To reset all the results in the result buffer, free it using MimFree(), and then a allocate new result buffer using MimAllocResult() with M_STATISTICS_RESULT.
The statistics result buffer of a cumulative statistics context can contain the results of an operation performed cumulatively on numerous images by calling this function multiple times, each time using a different source image buffer. Note that in this case, the source images should have the same dimensions, otherwise unpredictable results could occur.
You can limit some of 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. Note that not all statistics operations support ROIs; for a list of those that do, see MimControl().
Specifies the identifier of the image processing context that specifies the statistics to calculate. The image processing context must have been previously allocated using MimAlloc() with either M_STATISTICS_CONTEXT or M_STATISTICS_CUMULATIVE_CONTEXT.
Specifies the identifier of the source image buffer. The buffer used must be a 1-band image buffer.
When preprocessing a 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_SOURCE_SIZE_X and M_SOURCE_SIZE_Y; otherwise, an error will occur.
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 result buffer. The buffer must have been allocated using MimAllocResult() with M_STATISTICS_RESULT.
Specifies the operation to perform on the source image.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Calculates the statistics specified using MimControl(). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Preprocesses the specified image processing context and image processing result buffer. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Removes the results related to the specified source image. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Resets the results generated from M_STAT_MIN, M_STAT_MIN_ABS, M_STAT_MAX, and M_STAT_MAX_ABS operations. |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |