Learn R Programming

imager (version 0.42.19)

coord.index: Coordinates from pixel index

Description

Compute (x,y,z,cc) coordinates from linear pixel index.

Usage

coord.index(im, index)

Value

a data.frame of coordinate values

Arguments

im

an image

index

a vector of indices

Author

Simon Barthelme

See Also

index.coord for the reverse operation

Examples

Run this code
cind <- coord.index(boats,33)
#Returns (x,y,z,c) coordinates of the 33rd pixel in the array
cind
all.equal(boats[33],with(cind,at(boats,x,y,z,cc)))
all.equal(33,index.coord(boats,cind))

Run the code above in your browser using DataLab