cpd {LOMAR} | R Documentation |
cpd
Description
Affine and rigid registration of two point sets using the coherent point drift algorithm. See: Myronenko A., Song X. (2010): "Point-Set Registration: Coherent Point Drift", IEEE Trans. on Pattern Analysis and Machine Intelligence, vol. 32, issue 12, pp. 2262-2275.
Usage
cpd(
X,
Y,
w = 0,
weights = NULL,
scale = FALSE,
maxIter = 100,
subsample = NULL,
tol = 1e-04
)
Arguments
X |
reference point set, a N x D matrix |
Y |
point set to transform, a M x D matrix, |
w |
noise weight in the range [0, 1) |
weights |
a M x N matrix of point correspondence weights |
scale |
logical (default: FALSE), whether to use scaling |
maxIter |
maximum number of iterations to perform (default: 100) |
subsample |
if set, use this randomly selected fraction of the points |
tol |
tolerance for determining convergence |
Value
a list of
Y: transformed point set,
R: rotation matrix,
t: translation vector,
s: scaling factor,
P: matrix of correspondence probabilities between the two point sets,
sigma: final variance,
iter: number of iterations performed,
converged: boolean, whether the algorithm has converged.
Examples
data.file1 <- system.file("test_data", "parasaurolophusA.txt", package = "LOMAR",
mustWork = TRUE)
PS1 <- read.csv(data.file1, sep = '\t', header = FALSE)
data.file2 <- system.file("test_data", "parasaurolophusB.txt", package = "LOMAR",
mustWork = TRUE)
PS2 <- read.csv(data.file2, sep = '\t', header = FALSE)
transformation <- cpd(PS1, PS2, maxIter = 10, tol = 1e-3)
## Not run:
# Visualize registration outcome
library(rgl)
plot3d(PS1, col = "blue")
points3d(PS2, col = "green")
points3d(transformation[['Y']], col = "magenta")
## End(Not run)