object_to_color: Apply color to image objects

View source: R/utils_objects.R

object_to_colorR Documentation

Apply color to image objects

Description

The function applies the color informed in the argument color to segmented objects in the image. The segmentation is performed using image indexes. Use image_index() to identify the better candidate index to segment objects.

Usage

object_to_color(img, index = "NB", color = "blue", plot = TRUE, ...)

Arguments

img

An image object.

index

A character value (or a vector of characters) specifying the target mode for conversion to binary image. See the available indexes with pliman_indexes() and image_index() for more details.

color

The color to apply in the image objects. Defaults to "blue".

plot

Plots the modified image? Defaults to TRUE.

...

Additional arguments passed on to image_binary().

Value

An object of class Image

Examples

library(pliman)
img <- image_pliman("la_leaves.jpg")
img2 <- object_to_color(img, index = "G-R")
image_combine(img, img2)


pliman documentation built on Oct. 15, 2023, 1:06 a.m.