concatenate concatenates two images into one, either
vertically or horizontally.
Arguments
- image1, image2
Imageobjects with the same bitdepth and number of channels, and either the same width (ifdirection = "vertical") or the same height (ifdirection = "horizontal").- direction
A character string indicating the direction of concatenation. It can be either
"vertical"(the default) or"horizontal".- 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 and will not replace the content ofimagebut will replace that oftarget. Note thattargetmust have the same bitdepth and number of channels asimage1andimage2. Ifdirection = "vertical", the height oftargetmust be the sum of the heights ofimage1andimage2. Ifdirection = "horizontal", the width oftargetmust be the sum of the widths ofimage1andimage2.
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.
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
two_balloons <- concatenate(balloon, balloon)