View source: R/utils_landmarks.R
landmarks_add | R Documentation |
Interpolates supplementary landmarks that correspond to the mean coordinates of two adjacent landmarks.
landmarks_add(x, n = 3, smooth_iter = 0, plot = TRUE, nrow = NULL, ncol = NULL)
x |
A |
n |
The number of iterations. Defaults to 3. |
smooth_iter |
The number of smoothing iterations to perform. This will
smooth the perimeter of the interpolated landmarks using |
plot |
Creates a plot? Defaults to |
ncol, nrow |
The number of rows or columns in the plot grid when a |
A Matrix of interpolated coordinates.
library(pliman)
# equally spaced landmarks
plot_polygon(contours[[4]])
ldm <- landmarks_regradi(contours[[4]], plot = FALSE)
points(ldm$coords, pch = 16)
segments(mean(ldm$coords[,1]),
mean(ldm$coords[,2]),
ldm$coords[,1],
ldm$coords[,2])
ldm_add <- landmarks_add(ldm, plot = FALSE)
points(ldm_add, col = "red")
points(ldm$coords, pch = 16)
# smoothed version
ldm_add_smo <- landmarks_add(ldm, plot = FALSE, smooth_iter = 10)
lines(ldm_add_smo, col = "blue", lwd = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.