Learn R Programming

imager (version 0.14)

interp: Interpolate image values

Description

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).

Usage

interp(im, locations, cubic = FALSE)

Arguments

im
the image (class cimg)
locations
a data.frame
cubic
if TRUE, use cubic interpolation. If FALSE, use linear (default FALSE)

Examples

Run this code
im <- load.image(system.file('extdata/parrots.png',package='imager'))
loc <- data.frame(x=runif(10,1,width(im)),y=runif(10,1,height(im))) #Ten random locations
interp(im,loc)

Run the code above in your browser using DataLab