The registration operation begins with a preregistration iteration, iteration 0. This transforms a point cloud so that the distance between its points, and the reference point cloud's points, is small enough for the ICP algorithm to start.
There are two possible modes for performing the preregistration iteration, specified using M3dregControl() with M_PREREGISTRATION_MODE.
If M_PREREGISTRATION_MODE is set to M_USER_DEFINED, the specified preregistration transformation matrix that is stored in the pairwise 3D registration context will be applied to the point cloud during the preregistration iteration.
By default, the pairwise registration context does not contain a preregistration transformation matrix; you need to specify one using M3dregSetLocation().
There are two common ways to specify the transformation matrix for the preregistration:
Copy the results from a previous call to M3dregCalculate() using M3dregSetLocation().
Manually define the values of the transformation matrix. To do so, allocate a transformation matrix object using M3dgeoAlloc() with M_TRANSFORMATION_MATRIX, and then set the matrix's values using M3dgeoMatrixPut() or M3dgeoMatrixSetTransform(). Then, copy the transformation matrix object into the pairwise 3D registration context using M3dregSetLocation().
If M_PREREGISTRATION_MODE is set to M_CENTROID, the point cloud is translated so that the mean position of all its points, called its centroid, overlaps the reference point cloud's centroid.
By default, this preregistration transformation only consists of a translation; there is no rotation. However, if a preregistration transformation matrix is supplied using M3dregSetLocation(), and M_PREREGISTRATION_MODE is set to M_CENTROID, the point cloud will be rotated according to the specified preregistration transformation matrix and translated so that the centroids share the same coordinates. The translation component of the specified preregistration matrix is ignored.