MIL_ID SrcImageBufId, | //in |
MIL_ID StatResultImId, | //in |
MIL_INT64 StatType, | //in |
MIL_INT64 Condition, | //in |
MIL_DOUBLE CondLow, | //in |
MIL_DOUBLE CondHigh | //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.
You can retrieve statistical results using MimGetResult1d() or MimGetResult().
If pixel values in your image represent angles instead of intensities, you can also choose to have MIL treat the pixels as unit vectors, where the angular value of a pixel is considered to be the angle of a vector with a length of one. Treating the pixels as unit vectors allows MIL to calculate directional statistics, which take into account the wrap-around characteristic of angles (so that, for example, the mean of 0 and 360 is either 0 or 360, not 180). For example, instead of selecting to calculate the average value of the hue component of pixels in HSL color images, you should select to calculate their angular mean (M_ANGULAR_DATA_MEAN), since hue is expressed as an angular value. In this case, the angles are treated as unit vectors and added using vector addition before being divided by the number of pixels.
The angles are considered to have been scaled to the type of image buffer. For unsigned buffers, the minimum pixel value is considered as an angle of 0, and one plus the maximum possible pixel intensity value is considered as an angle of 360. For example, an 8-bit buffer would have 0° mapped to a value of 0, while 360° would be mapped to a value of 256 (since the maximum pixel value is 255). For signed buffers, the minimum pixel value is considered as an angle of -180° while one plus the maximum pixel value is considered as an angle of 180°. Floating point buffers have intensity values anywhere between 0 and 1, and these values are linearly mapped between 0° and 360°.
You can limit this function's results to a region of the source image buffer using a region of interest (ROI) set using MbufSetRegion().
Specifies the identifier of the source image for the operation. This parameter must be given a 1-band image buffer identifier.
This image buffer can have an 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).
Specifies the identifier of the destination result buffer for the operation.
This parameter must be given the identifier of an image processing result buffer, allocated using MimAllocResult() function with M_STAT_LIST as the result type.
Specifies the type of statistic to compute.
You can set the StatType parameter to one or more of the following values.
For specifying the type of statistic to
compute
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MAX |
Specifies the maximum pixel value that respects the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_MAX_ABS |
Specifies the maximum absolute pixel value that respects the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_MEAN |
Specifies the mean value of the pixels that respect the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_MIN |
Specifies the minimum pixel value that respects the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_MIN_ABS |
Specifies the minimum absolute pixel value that respects the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_NUMBER + |
Specifies the number of pixels that respect the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_STANDARD_DEVIATION |
Specifies the standard deviation of the pixels values that respect the setting of the Condition parameter. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SUM |
Specifies the sum of the pixel values that respect the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_SUM_ABS |
Specifies the sum of the absolute pixel values that respect the setting of the Condition parameter. |
||||||||||||||||||||||||||||||||||||||
M_SUM_OF_SQUARES |
Specifies the sum of the squared pixel values that respect the setting of the Condition parameter. |
You can use one or more of the following values in combination with each other or with the above-mentioned value, to set which angular statistics to compute.
To calculate these statistics, the pixel values in your image should represent angles since these statistics will treat the pixels as unit vectors.
Note that the result of the addition of the angular data using vector addition is known as the vector sum.
For computing angular
statistics
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ANGULAR_DATA_COHERENCE |
Calculates the coherence of the angular data. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ANGULAR_DATA_MEAN |
Calculates the dominant direction of the unit vectors. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ORIENTATION_DATA_MEAN |
Calculates the dominant orientation of the unit vectors. (more details...) |
To compute all of the different statistics listed in the For specifying the type of statistic to compute table, set StatType to the following:
For computing the statistics
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies that all statistics mentioned in the For specifying the type of statistic to compute table are to be computed. |
Specifies the condition for the statistical computation.
If no condition is required, set the Condition parameter to the value below.
For specifying the condition for the
statistical computation
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that no condition is set. (more details...) |
For conditions that use two limits, set the Condition parameter to one of the values below.
For conditions that use two
limits
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_IN_RANGE |
Specifies that pixels with values between CondLow and CondHigh, inclusive, will be used for statistical calculations. |
||||||||||||||||||||||||||||||||||||||
M_OUT_RANGE |
Specifies that pixels with values less than CondLow, or greater than CondHigh, will be used for statistical calculations. |
For conditions that use one limit, set the Condition parameter to one of the values below.
For conditions that use one
limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EQUAL |
Specifies that only pixels with values equal to CondLow will be used for statistical calculations. |
||||||||||||||||||||||||||||||||||||||
M_GREATER |
Specifies that only pixels with values greater than CondLow will be used for statistical calculations. |
||||||||||||||||||||||||||||||||||||||
M_GREATER_OR_EQUAL |
Specifies that only pixels with values greater than or equal to CondLow will be used for statistical calculations. |
||||||||||||||||||||||||||||||||||||||
M_LESS |
Specifies that only pixels with values less than CondLow will be used for statistical calculations. |
||||||||||||||||||||||||||||||||||||||
M_LESS_OR_EQUAL |
Specifies that only pixels with values less than or equal to CondLow will be used for statistical calculations. |
||||||||||||||||||||||||||||||||||||||
M_MASK |
Specifies that only pixels corresponding to the non-zero pixels in the mask buffer will be used for statistical calculations. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NOT_EQUAL |
Specifies that only pixels with values not equal to CondLow will be used for statistical calculations. |
Specifies the lower limit of the selected condition.
This parameter must be set to one of the following:
For the lower limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that no lower limit is required. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL image buffer identifier |
Specifies a 1-band image buffer used as the mask. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the lower limit. |
Specifies the upper limit of the selected condition.
This parameter must be set to one of the following values.
For the upper limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that no upper limit is required. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the upper limit. |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |