Learn R Programming

patternize (version 0.0.5)

sampleRGB: Interactive function to sample RGB value from pixel or square area in an image.

Description

Interactive function to sample RGB value from pixel or square area in an image.

Usage

sampleRGB(image, resampleFactor = NULL, crop = c(0, 0, 0, 0), type = "point")

Value

RGB vector

Arguments

image

Image imported as a RasterStack.

resampleFactor

Integer for downsampling used by redRes.

crop

Vector c(xmin, xmax, ymin, ymax) that specifies the pixel coordinates to crop the original image.

type

Set 'point' to extract RGB from a single point or 'area' to extract from a square area defined by setting two points (default = 'point').

Examples

Run this code
image <- raster::stack(system.file("extdata", "BC0077.jpg", package = "patternize"))
RGB <- sampleRGB(image, resampleFactor = 1)

Run the code above in your browser using DataLab