View source: R/interpolation.R
interp | R Documentation |
This function provides 2D and 3D (linear or cubic) interpolation for pixel values. Locations need to be provided as a data.frame with variables x,y,z, and c (the last two are optional).
interp(im, locations, cubic = FALSE, extrapolate = TRUE)
im |
the image (class cimg) |
locations |
a data.frame |
cubic |
if TRUE, use cubic interpolation. If FALSE, use linear (default FALSE) |
extrapolate |
allow extrapolation (to values outside the image) |
loc <- data.frame(x=runif(10,1,width(boats)),y=runif(10,1,height(boats))) #Ten random locations
interp(boats,loc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.