MIL_ID ImageBufId, | //in |
MIL_ID ImageBufOrGeometry3dmapId, | //in |
MIL_ID MaskBufId, | //in |
MIL_ID Result3dmapId, | //in |
MIL_INT64 StatType, | //in |
MIL_DOUBLE OutlierDistanceWorld, | //in |
MIL_INT64 ControlFlag, | //in |
MIL_DOUBLE *StatValuePtr | //out |
This function calculates a variety of statistics for the pixels that satisfy the specified condition in a depth map. Results are stored in the specified statistic result buffer.
By default, statistics are computed using the XY world plane (Z=0) as the reference level. Alternatively, you can specify a fully corrected depth map or geometry object to use as a reference level for the calculations.
You can specify a mask image using MaskBufId. Pixels set to 0 in the mask image are excluded from the statistics computation.
Any pixel that is set to the missing data value, either in the source depth map or the reference depth map (if provided) will be excluded from the statistics computation. This could have an impact, for example, when computing the volume of an object. Prior to calling M3dmapStat(), you can fill missing data using M3dmapExtract() with M_FILL_MISSING_DATA_ONLY.
After calling M3dmapStat(), results can be obtained using M3dmapGetResult() on the result buffer.
Specifies the image buffer identifier of the depth map on which to compute statistics. The image buffer must be a 1-band, 8-bit or 16-bit unsigned buffer and must be 3D-corrected.
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.
Specifies what will be used as reference level for statistics computation.
You can set the ImageBufOrGeometry3dmapId parameter to one of the following values.
For specifying the reference
level
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the XY world plane (Z=0) will be used as the reference level. |
||||||||||||||||||||||||||||||||||||||
Geometry object identifier |
Specifies the identifier of the geometry object to use as the reference level. (more details...) |
||||||||||||||||||||||||||||||||||||||
Image buffer identifier |
Specifies the image buffer identifier of the depth map to use as the reference level. (more details...) |
Specifies the identifier of the image buffer to use as a mask, if needed.
You can set the MaskBufId parameter to one of the following values.
For specifying the mask
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies to consider all pixels of the source depth map; no mask will be used. |
||||||||||||||||||||||||||||||||||||||
Image buffer identifier |
Specifies the identifier of the image buffer to use as a mask while computing statistics. (more details...) |
Specifies the result buffer identifier, if needed.
You can set the Result3dmapId parameter to one of the following values.
For specifying the result
buffer
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that no result buffer is needed. (more details...) |
||||||||||||||||||||||||||||||||||||||
3D reconstruction statistics
result buffer identifier |
Specifies the identifier of an M_STAT_RESULT 3D reconstruction result buffer. (more details...) |
Specifies what statistics to compute. When using a result buffer to hold the results, all statistics are computed and this parameter must be set to M_DEFAULT. If a single statistic is needed, StatType specifies which one. In that case, it is not necessary to allocate a result buffer; the result is returned directly at the address given to StatValuePtr.
You can set the StatType parameter to one of the following values.
For specifying the statistics to
compute
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies to compute all possible statistics. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEVIATION_MAX + |
Specifies to calculate the maximum height between depth map and reference level (always positive). |
||||||||||||||||||||||||||||||||||||||
M_DEVIATION_MEAN + |
Specifies to calculate the average height between depth map and reference level. |
||||||||||||||||||||||||||||||||||||||
M_NUMBER_OF_PIXELS_MISSING_DATA |
Specifies to determine the number of pixels that were not taken into account while computing statistics because they were set to the missing data value, either in the depth map or the reference level. |
||||||||||||||||||||||||||||||||||||||
M_NUMBER_OF_PIXELS_OUTLIER + |
Specifies to determine the number of pixels that were not taken into account while computing statistics because the distance between the depth map and the reference level at those coordinates was beyond the outlier threshold. |
||||||||||||||||||||||||||||||||||||||
M_NUMBER_OF_PIXELS_TOTAL |
Specifies to determine the total number of pixels that were considered while computing statistics. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NUMBER_OF_PIXELS_VALID + |
Specifies to determine the number of pixels that were taken into account while computing statistics. |
||||||||||||||||||||||||||||||||||||||
M_VOLUME + |
Specifies to calculate the volume contained between the depth map and the reference level. |
You can add one of the following values to the above-mentioned values to specify which pixels to take into account.
For specifying which pixels to take into
account
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_STAT_ABS |
Specifies to take into account all valid pixels, treating all vertical distances as positive. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STAT_ALL |
Specifies to take into account all valid pixels. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STAT_NEGATIVE |
Specifies to take into account only the pixels for which going from the reference level to the depth map is in the negative Z-direction. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STAT_POSITIVE |
Specifies to take into account only the pixels for which going from the reference level to the depth map is in the positive Z-direction. |
Specifies the outlier distance to use to exclude pixels from the statistics.
You can set the OutlierDistanceWorld parameter to one of the following values.
For specifying the outlier
distance
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_INFINITE. |
||||||||||||||||||||||||||||||||||||||
M_INFINITE |
Specifies an infinite outlier distance; no depth map points will be excluded from the statistics calculation based on their distance from the reference level. |
||||||||||||||||||||||||||||||||||||||
Value >= 0 |
Specifies the outlier vertical distance to use, in world units. (more details...) |
Specifies where to write the results, if needed.
You can set the StatValuePtr parameter to one of the following values.
For specifying where to write the
results
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies to use the result buffer to hold all computed statistics. (more details...) |
||||||||||||||||||||||||||||||||||||||
Address of a MIL_DOUBLE |
Specifies to compute the statistic specified using StatType, and write the result at this address. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; mil3dmap.lib. |
DLL | Requires mil.dll; mil3dmap.dll. |