| Customize Help
| Save Settings


Function Map
Perform the registration operation on the given point clouds and write the resulting transformation matrices into the pairwise 3D registration result buffer.
void M3dregCalculate(
MIL_ID Context3dregId, //in
const MIL_ID *ContainerBufIdArrayPtr, //in
MIL_INT NumContainers, //in
MIL_ID Result3dregId, //in
MIL_INT64 ControlFlag //in

This function calculates the optimal registration (alignment) of the overlapping region shared between each point cloud and its reference point cloud, and calculates the transformation needed to achieve this registration. Once the transformation that maps each point cloud's working coordinate system onto its reference point cloud's working coordinate system is calculated, all point clouds can be mapped onto the global coordinate system.

Every point cloud is associated with a registration element in the 3D registration context, and that registration element provides the rough location of the point cloud relative to another point cloud (the reference point cloud), or in the global coordinate system (for example, the third container in the array is associated with the third registration element).

This function takes points in one point cloud, pairs them with points in the other point cloud, and tries to minimize the root-mean-square (RMS) error of the distance between all the paired points with each iteration of the registration operation. The iterations continue, trying to reduce the RMS error in each iteration, until at least one stop condition occurs. You can specify the stop conditions using M3dregControl() with M_MAX_ITERATIONS, M_RMS_ERROR_THRESHOLD, and M_RMS_ERROR_RELATIVE_THRESHOLD. You can also use M3dregControl() with M_STOP_CALCULATE to stop the execution of M3dregCalculate().

During the first iteration of the registration operation, a point cloud is transformed to its rough location. The rough location is specified using M3dregSetLocation(), and the preregistration mode is set using M3dregControl() with M_PREREGISTRATION_MODE.

Similar to the pairwise 3D registration context, the pairwise 3D registration result buffer contains registration result elements, each of which stores the results of the registration operation for each point cloud. Each point cloud in the array of containers is associated with the registration result element with the same index. Results include the calculated transformation matrix which aligns the working coordinate system of a point cloud to its reference (retrieved using M3dregCopyResult() with M_REGISTRATION_MATRIX), as well as status information (retrieved using M3dregGetResult() with M_STATUS).

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 if there is complementary information.
This function is not supported on the selected boards.

Specifies the identifier of the pairwise 3D registration context to use for the registration operation. The context must have been previously allocated using M3dregAlloc().

Accepts the address of one of the following:
  • array of type MIL_ID [optionally, in C++: a reference to a constant std::vector<MIL_ID> ] (and a maximum array rank for C# of 1)
    Required array size:(NumContainers)

Specifies the address of the array containing the identifiers of the point cloud containers. The point clouds must be 3D-processable; use MbufInquireContainer() with M_3D_PROCESSABLE to ensure that the containers contain 3D-processable point clouds. The number of containers supplied in the array should be less than or equal to the number of registration elements in the registration context.


Specifies the size of the array passed to ContainerBufIdArrayPtr.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the ContainerBufIdArrayPtr parameter.

function map For specifying the number of containers in the array
Click to summarizeValue Description
Click to summarize 2 <= Value < M3dregInquire(ParamId,

Specifies the size of the array.


Specifies the pairwise 3D registration result buffer identifier in which to store results. The result buffer must have been previously allocated using M3dregAllocResult().


Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; mil3dreg.lib.
DLL Requires mil.dll; mil3dreg.dll.