rgb.measure | R Documentation |
Color sampling from a set of pre-warped images
rgb.measure(
imagedir,
image.names,
delaunay.map,
px.radius = 2,
linearize.color.space = F
)
imagedir |
directory of images to measure. Only images with landmarks will be processed. The landmark file names are assumed to exactly match the image names. |
image.names |
A vector of image names to look for in imagedir. These images should be unwarped or deformed to a common reference shape. |
delaunay.map |
delaunay triangulation object |
px.radius |
The size of the circular neighborhood (in pixels) to sample color around each triangulated point. |
linearize.color.space |
should the sampled color data be transformed into linear color space |
The function will return $sampled.color– an N_points x 3 (RGB) x N_observations array of sampled color values. A tri.surf.points class object will also be returned as $delaunay.
#covariate data and consensus lms
specimen.factors <- read.csv(system.file("extdata", "specimen_factors.csv", package = "Colormesh"), header = F)
consensus <- tps2array(system.file("extdata", "consensus_LM_coords.TPS", package = "Colormesh"))
test.image <- image_reader(paste0(path.package("Colormesh"),"/extdata/unwarped_images/"), "GPLP_unw_001.jpg")
delaunay.map <- tri.surf(consensus, point.map = c(1,8:17,2, 18:19,3,20:27,4, 28:42,5,43:52,6,53:54,7,55:62), 3, test.image)
rgb.test <- rgb.measure(imagedir = paste0(path.package("Colormesh"),"/extdata/unwarped_images/"), image.names = specimen.factors[,2], delaunay.map = delaunay.map, linearize.color.space = F)
plot(rgb.test, individual = 5)
plot(rgb.test, individual = 5, style = "comparison")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.