object_rgb {pliman}R Documentation

Extract red, green and blue values from objects

Description

Given an image and a matrix of labels that identify each object, the function extracts the red, green, and blue values from each object.

Usage

object_rgb(img, labels)

Arguments

img

An Image object

labels

A mask containing the labels for each object. This can be obtained with EBImage::bwlabel() or EBImage::watershed()

Value

A data.frame with n rows (number of pixels for all the objects) and the following columns:

Examples

if (interactive() && requireNamespace("EBImage")) {
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)
}

[Package pliman version 3.0.0 Index]