Learn R Programming

Morpho (version 2.1)

pcAlign: align two pointclouds/meshes by their principal axes

Description

align two pointclouds/meshes by their principal axes

Usage

pcAlign(x, y, optim = TRUE, subsample = NULL)

## S3 method for class 'matrix': pcAlign(x, y, optim = TRUE, subsample = NULL)

## S3 method for class 'mesh3d': pcAlign(x, y, optim = TRUE, subsample = NULL)

Arguments

x
matrix or mesh3d
y
matrix or mesh3d
optim
logical if TRUE, all possible PC-axis are tested and the rotation with the smallest RMSE between configs will be used.
subsample
integer use subsampled points to decrease computation time

Value

  • rotated and translated version of x to the center and principal axes of y.

Details

x and y will first be centered and aligned by their PC-axes. If optim=TRUE,all possible 8 ordinations of PC-axes will be tested and the one with the smallest RMSE between the transformed version of x and the closest points on y will be used. Then the rotated version of x is translated to the original center of mass of y.