calculate an affine transformation matrix
calculate an affine transformation matrix
computeTransform(x, y, type = c("rigid", "similarity", "affine", "tps"), reflection = FALSE, lambda = 1e-08, weights = NULL, centerweight = FALSE, threads = 1)
x |
fix landmarks. Can be a k x m matrix or mesh3d. |
y |
moving landmarks. Can be a k x m matrix or mesh3d. |
type |
set type of affine transformation: options are "rigid", "similarity" (rigid + scale) and "affine", |
reflection |
logical: if TRUE "rigid" and "similarity" allow reflections. |
lambda |
numeric: regularisation parameter of the TPS. |
weights |
vector of length k, containing weights for each landmark (only used in type="rigid" or "similarity"). |
centerweight |
logical or vector of weights: if weights are defined and
centerweigths=TRUE, the matrix will be centered according to these weights instead of the
barycenter. If centerweight is a vector of length |
threads |
number of threads to use in TPS interpolation. |
x
and y
can also be a pair of meshes with corresponding vertices.
returns a 4x4 (3x3 in 2D case) transformation matrix or an object of class "tpsCoeff" in case of type="tps".
all lines containing NA, or NaN are ignored in computing the transformation.
data(boneData) trafo <- computeTransform(boneLM[,,1],boneLM[,,2]) transLM <- applyTransform(boneLM[,,2],trafo)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.