| icp | R Documentation |
Rigid registration of two point sets using the iterative closest point algorithm.
icp(
X,
Y,
weights = NULL,
iterations = 100,
subsample = NULL,
scale = FALSE,
tol = 0.001,
rotation.only = FALSE
)
X |
reference point set, a N x D matrix |
Y |
point set to transform, a M x D matrix, |
weights |
vector of length nrow(Y) containing weights for each point in Y. Not implemented. |
iterations |
number of iterations to perform (default: 100) |
subsample |
can be set either to a number in [0,1] representing the fraction of points to randomly select or a list with vector elements X and Y containing indices of points to select in X and Y |
scale |
logical (default: FALSE), whether to use scaling. |
tol |
tolerance for determining convergence |
rotation.only |
logical (default: FALSE), if TRUE, don't perform translation |
a list of
Y: transformed point set, a M x D matrix,
R: rotation matrix,
t: translation vector,
s: scaling factor,
iter: number of iterations performed,
conv: boolean, whether the algorithm has converged.
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 <- icp(PS1, PS2, iterations = 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.