View source: R/utils_objects.R
object_rgb | R Documentation |
Given an image and a matrix of labels that identify each object, the function extracts the red, green, and blue values from each object.
object_rgb(img, labels)
img |
An |
labels |
A mask containing the labels for each object. This can be
obtained with |
A data.frame with n
rows (number of pixels for all the objects) and
the following columns:
id
: the object id;
R
: the value for the red band;
G
: the value for the blue band;
B
: the value for the green band;
library(pliman)
img <- image_pliman("soybean_touch.jpg")
# segment the objects using the "B" (blue) band (default)
labs <- object_label(img, watershed = TRUE)
rgb <- object_rgb(img, labs[[1]])
head(rgb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.