View source: R/utils_objects.R
object_to_color | R Documentation |
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.
object_to_color(
img,
pick_palettes = FALSE,
background = NULL,
foreground = NULL,
index = "NB",
color = "blue",
plot = TRUE,
...
)
img |
An image object. |
pick_palettes |
Logical argument indicating wheater the user needs to
pick up the color palettes for foreground and background for the image. If
|
foreground , background |
A color palette for the foregrond and background, respectively (optional). |
index |
A character value (or a vector of characters) specifying the
target mode for conversion to binary image. See the available indexes with
|
color |
The color to apply in the image objects. Defaults to |
plot |
Plots the modified image? Defaults to |
... |
Additional arguments passed on to |
An object of class Image
if (interactive() && requireNamespace("EBImage")) {
library(pliman)
img <- image_pliman("la_leaves.jpg")
img2 <- object_to_color(img, index = "G-R")
image_combine(img, img2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.