merge returns an image from the combination of grayscale
images corresponding to single channels (green, blue, red, or alpha).
Arguments
- x
A list of single channel (grayscale)
Imageobjects.- target
The location where the results should be stored. It can take 2 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast but will replace the content oftarget. Note that iftargetdoes not have the same dimensions as the images inxand the same number of channels as the number of images inx, an error will be thrown.
Value
If target="new", the function returns an Image
object. If target is an Image object, the function
returns nothing and modifies that Image object in place.
Note
Color images are usually represented by 3 channels (possibly 4) in the following order: green (1), blue (2), red (3), and possibly alpha (4).
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_chan <- split(balloon)
balloon_merged <- merge(balloon_chan)