Learn R Programming

imager (version 0.42.10)

coord.index: Coordinates from pixel index

Description

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

Usage

coord.index(im, index)

Arguments

im

an image

index

a vector of indices

Value

a data.frame of coordinate values

See Also

index.coord for the reverse operation

Examples

Run this code
# NOT RUN {
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