Description Usage Arguments Value Examples
Sample colors from images based on coordinates
1 2 | color_from_coords(coord, x, col.space = c("RGB", "HSL", "HSV", "HSI", "sRGB",
"YUV", "Lab", "XYZ"))
|
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. |
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
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.