color_from_coords: Sample colors from images based on coordinates

Description Usage Arguments Value Examples

Description

Sample colors from images based on coordinates

Usage

1
2
color_from_coords(coord, x, col.space = c("RGB", "HSL", "HSV", "HSI", "sRGB",
  "YUV", "Lab", "XYZ"))

Arguments

coord

data.frame with x (column 1) and y (column 2) coordinates for N samples. Usually the output of coords_from_image

x

is of class cimg

col.space

character, one of "HSL", "HSV", "HSI", "sRGB", "YUV", "Lab", "XYZ" of the putput color space model

pg

logical if all values inside a polygone should be returned. In this case the points drawn are the vertices of the polygon.

Value

list with three elements

points color values of points

polygon color values within the polygon spanned by the points

background color values no covered by the polygon

Examples

1
2
3
4
#' a.m <- load.image("https://upload.wikimedia.org/wikipedia/commons/0/02/2006-10-25_Amanita_muscaria_crop.jpg")
xy <- coords_from_image(a.m, n = 2)
col <- color_from_coords(coord = xy, x = a.m, col.space = "HSL")
col

FranzKrah/rCSBI documentation built on May 14, 2019, 7:41 a.m.