MIL_ID ContextId, | //in |
MIL_ID TargetBufId, | //in |
MIL_ID ResultId, | //in |
MIL_INT64 ControlFlag | //in |
This function calculates features and validates geometric tolerances in the target image buffer. To do so, MmetCalculate() uses the target image's edge map. For more information on edge maps, see the Extracting the edges section of Chapter 8: Edge Finder.
To control the Metrology module's calculation and validation behavior, you can set context constraints using MmetControl(). You can also use MmetControl() to alter settings for features and tolerances that you have already added to the context. To add features to the context, use MmetAddFeature(). To add geometric tolerances to the context and define geometric relationships between features, use MmetAddTolerance().
Results of a metrology calculation are stored in the specified result buffer and can be obtained using MmetGetResult().
If the target image is not calibrated, results are calculated in the pixel coordinate system (pixel units). If the target image is calibrated, results are calculated in the world coordinate system (real-world units), but they can be retrieved in either world or pixel units. Note that, if the target image is calibrated, feature values, metrology regions, and tolerances are considered as real-world values and are retrieved in world units.
Note that in the presence of distortion, some results are meaningless when converted from real-world to pixel units (for example, angle and scale results). For example, if a feature appears warped in the target image, but the calibration context compensates for this during the calculation, the resulting angle is meaningful in the real-world coordinate system, and meaningless in the pixel coordinate system.
If complex distortions exist, you must first correct the image before using it with the Metrology module.
Specifies the identifier of the metrology context. The metrology context must have been previously allocated on the required system using MmetAlloc().
Specifies the identifier of the target image buffer from which to extract edges to calculate features and validate geometric tolerances. Typically, the target image buffer should be 1-band 8-bit unsigned. Other buffer depths and types are generally accepted, but can slightly decrease performance. When the target image buffer is 32-bit float, metrology uses floating-point precision calculations.
This image buffer must not have a region of interest (ROI) associated with it (MbufSetRegion()). Using an image buffer with an ROI will cause an error. You can only use metrology regions established with MmetSetRegion().
Specifies the metrology result buffer in which to write the results of the calculation. The metrology result buffer must have been previously allocated on the required system using MmetAllocResult().
Header | Include mil.h. |
Library | Use mil.lib; milmetrol.lib. |
DLL | Requires mil.dll; milmetrol.dll. |