| Customize Help
| Save Settings

M3dmetControl



Function Map
Synopsis
Control a setting for a 3D metrology context.
Syntax
void M3dmetControl(
MIL_ID Context3dmetId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue //in
)
Description

This function allows you to control a setting of a 3D metrology context. These settings control the execution of M3dmetFit() and M3dmetStat(). You can typically inquire these settings using M3dmetInquire().

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, M3dmetControl() internally calls the MIL_DOUBLE version of this function (M3dmetControlDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (M3dmetControlInt64()).
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
Context3dmetId

Specifies the identifier of the fit 3D metrology context or statistics 3D metrology context to control. The 3D metrology context must have been previously allocated on the required system using M3dmetAlloc().

ControlType

Specifies the setting to control.

See the Parameter associations section for possible values that can be specified.

ControlValue

Specifies the value needed for the control.

See the Parameter associations section for possible values that can be specified.

The tables below list possible values for the ControlType and ControlValue parameters.

The following ControlType and ControlValue parameter settings can be specified for statistics 3D metrology contexts, and control which statistics M3dmetStat() calculates.

function map To control a statistics 3D metrology context
Click to summarizeControlType Description
ControlValue
Click to summarize M_STAT_MAX

Sets whether to calculate the maximum distance between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the maximum distance.

Click to summarize M_ENABLE

Specifies to calculate the maximum distance.

Click to summarize M_STAT_MAX_ABS

Sets whether to calculate the maximum absolute distance between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the maximum absolute distance.

Click to summarize M_ENABLE

Specifies to calculate the maximum absolute distance.

Click to summarize M_STAT_MEAN

Sets whether to calculate the average distance between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the average distance.

Click to summarize M_ENABLE

Specifies to calculate the average distance.

Click to summarize M_STAT_MIN

Sets whether to calculate the minimum distance between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the minimum distance.

Click to summarize M_ENABLE

Specifies to calculate the minimum distance.

Click to summarize M_STAT_MIN_ABS

Sets whether to calculate the minimum absolute distance between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the minimum absolute distance.

Click to summarize M_ENABLE

Specifies to calculate the minimum absolute distance.

Click to summarize M_STAT_NUMBER

Sets whether to record the number of points that meet the condition specified when calling M3dmetStat() (using the Condition, CondLow and CondHigh parameters). INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to record the number of points that meet the specified condition.

Click to summarize M_ENABLE

Specifies to record the number of points that meet the specified condition.

Click to summarize M_STAT_RMS

Sets whether to calculate the root-mean-square (RMS) error between the point cloud or depth map, and the specified reference object. MIL calculates the RMS error using the following formula: INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the RMS error.

Click to summarize M_ENABLE

Specifies to calculate the RMS error.

Click to summarize M_STAT_STANDARD_DEVIATION

Sets whether to calculate the standard deviation of all the distances calculated between the point cloud or depth map, and the specified reference object. MIL calculates the standard deviation using the following formula: INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the standard deviation.

Click to summarize M_ENABLE

Specifies to calculate the standard deviation.

Click to summarize M_STAT_SUM

Sets whether to calculate the sum of all the distances calculated between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the sum of all the distances.

Click to summarize M_ENABLE

Specifies to calculate the sum of all the distances.

Click to summarize M_STAT_SUM_ABS

Sets whether to calculate the sum of all the absolute distances calculated between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the sum of all absolute distances.

Click to summarize M_ENABLE

Specifies to calculate the sum of all absolute distances.

Click to summarize M_STAT_SUM_OF_SQUARES

Sets whether to calculate the sum of squared distances between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to calculate the sum of squared distances.

Click to summarize M_ENABLE

Specifies to calculate the sum of squared distances.

The following ControlType and ControlValue parameter settings can be specified for a fit 3D metrology context, and control how M3dmetFit() performs the fit operation.

function map To control a fit 3D metrology context
Click to summarizeControlType Description
ControlValue
Click to summarize M_ESTIMATION_MODE

Sets how to compute an initial fit estimate between the point cloud or depth map, and the specified reference object. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_RANDOM_SAMPLING.

Click to summarize M_FROM_GEOMETRY

Specifies that an initial fit estimate is determined using a geometry object that is copied into the fit 3D metrology context using M3dmetCopy() with M_ESTIMATE_GEOMETRY.

The 3D geometry object must have been previously allocated using M3dgeoAlloc() with M_GEOMETRY, and must have been successfully defined. Supported 3D geometries include cylinder, line, plane, and sphere. Note that fitting a 3D box geometry is not supported.

(summarize)
Click to summarize M_NO_SAMPLING

Specifies that an initial fit estimate is calculated using all available points in a point cloud or depth map.

It is recommended that you only use this mode when there is a low percentage of outliers among the points of the point cloud or depth map.

(summarize)
Click to summarize M_RANDOM_SAMPLING

Specifies that an initial fit estimate is determined using a random sampling consensus (RANSAC) algorithm.

This mode tries to find the best fit of a 3D geometry object to a point cloud by trying to fit the reference object to several random samplings of the point cloud or depth map, and uses the best fit (with the lowest root-mean-squared (RMS) error) as the best initial approximation.

Random sampling consensus assumes that the best fit of the MIL object will use the random sampling of points that contains the fewest outliers. Using an initial fit estimate that ignores outliers will prevent M3dmetFit() from fitting the MIL object incorrectly.

To optimize the likelihood of a good initial fit estimate, you can specify a value for M_EXPECTED_OUTLIER_PERCENTAGE.

(summarize)
Click to summarize M_EXPECTED_OUTLIER_PERCENTAGE

Sets the expected percentage of outliers among the points of the point cloud or depth map to be fitted.

This setting is only applicable when M_ESTIMATION_MODE is M_RANDOM_SAMPLING. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 40.

Click to summarize 0.0 < Value < 100.0

Specifies the expected percentage of outliers among the points of the point cloud or depth map to be fitted.

Click to summarize M_FIT_ITERATIONS_MAX

Sets the maximum number of iterations to use during the fit operation.

If this value is set to 0, M3dmetFit() returns the result of the initial fit estimate, as specified using M3dmetControl() with M_ESTIMATION_MODE. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 5.

Click to summarize Value >= 0

Specifies the maximum number of iterations to use during the fit operation.

Click to summarize M_INLIER_AMOUNT_THRESHOLD

Sets a minimum number of inliers required for the fit operation to end.

After each iteration of the fit operation, the total number of inliers and the RMS error are calculated. If the number of inliers exceeds M_INLIER_AMOUNT_THRESHOLD, and the average RMS error is less than M_RMS_ERROR_THRESHOLD, the fit operation will stop.

A point is considered an inlier when its distance from the reference geometry is less than the value passed to the OutlierDistance parameter when M3dmetFit() is called. The status of the fit operation can be retrieved using M3dmetGetResult() with M_STATUS. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_INFINITE.

Click to summarize M_INFINITE

Specifies that there is no minimum number of inliers.

Click to summarize Value >= 0

Specifies the minimum number of inliers.

Click to summarize M_RMS_ERROR_THRESHOLD

Sets the maximum RMS error required for the fit operation to end.

After each iteration of the fit operation, the average RMS error is calculated. If the average RMS error is less than M_RMS_ERROR_THRESHOLD, and the number of inliers exceeds M_INLIER_AMOUNT_THRESHOLD, the fit operation will stop. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value >= 0.0

Specifies the maximum RMS error.

Type-specific versions of the function when using a C compiler under 64-bit
void M3dmetControlInt64 (MIL_ID Context3dmetId, MIL_INT64 ControlType, MIL_INT64 ControlValue)
Parameters

Context3dmetId

See Context3dmetId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

void M3dmetControlDouble (MIL_ID Context3dmetId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue)
Parameters

Context3dmetId

See Context3dmetId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; mil3dmet.lib.
DLL Requires mil.dll; mil3dmet.dll.
STAT MAX DEFAULT DISABLE ENABLE STAT MAX ABS DEFAULT DISABLE ENABLE STAT MEAN DEFAULT DISABLE ENABLE STAT MIN DEFAULT DISABLE ENABLE STAT MIN ABS DEFAULT DISABLE ENABLE STAT NUMBER DEFAULT DISABLE ENABLE STAT RMS DEFAULT DISABLE ENABLE STAT STANDARD DEVIATION DEFAULT DISABLE ENABLE STAT SUM DEFAULT DISABLE ENABLE STAT SUM ABS DEFAULT DISABLE ENABLE STAT SUM OF SQUARES DEFAULT DISABLE ENABLE ESTIMATION MODE DEFAULT FROM GEOMETRY NO SAMPLING RANDOM SAMPLING EXPECTED OUTLIER PERCENTAGE DEFAULT FIT ITERATIONS MAX DEFAULT INLIER AMOUNT THRESHOLD DEFAULT INFINITE RMS ERROR THRESHOLD DEFAULT