Skip to contents

pget returns the values of the pixels at the specified x and y coordinates in the image.

Usage

pget(image, x, y)

Arguments

image

An Image object.

x

A vector of x locations (columns) in the image.

y

A vector of y locations (rows) in the image.

Value

A matrix. The number of columns of the matrix depends on the number of channels in the image. Each row corresponds to a pair of x/y coordinates.

See also

Author

Simon Garnier, garnier@njit.edu

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
pget(balloon, c(1, 100, 200), c(200, 100, 1))
#>   [,1] [,2] [,3]
#> B  152  198  148
#> G  132  183  132
#> R  115  170  117