Last data update: 2014.03.03

R: Combining images
combineR Documentation

Combining images

Description

Merges images to create image sequences.

Usage

combine(x, y, ...)

Arguments

x

An Image object, an array, or a list containing Image objects and arrays.

y

An Image object or an array.

...

Image objects or arrays.

Details

The function combine uses abind to merge multi-dimensional arrays along the dimension depending on the color mode of x. If x is a Grayscale image or an array, image objects are combined along the third dimension, whereas when x is a Color image they are combined along the forth dimension, leaving room on the third dimension for color channels.

Value

An Image object or an array.

Author(s)

Gregoire Pau, Andrzej Oles, 2013

See Also

Image

Examples

  ## combination of color images
  img = readImage(system.file("images", "sample-color.png", package="EBImage"))[257:768,,]
  x = combine(img, flip(img), flop(img))
  display(x, all=TRUE)

  ## Blurred images
  x = resize(img, 128, 128)
  xt = list()
  for (t in seq(0.1, 5, len=9)) xt=c(xt, list(gblur(x, s=t)))
  xt = combine(xt)
  display(xt, title='Blurred images', all=TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(EBImage)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/EBImage/combine.Rd_%03d_medium.png", width=480, height=480)
> ### Name: combine
> ### Title: Combining images
> ### Aliases: combine combine,array,array-method
> ###   combine,matrix,matrix-method combine,Image,Image-method
> ###   combine,list,missing-method combine,ANY,NULL-method
> ###   combine,NULL,ANY-method combine,NULL,NULL-method
> 
> ### ** Examples
> 
>   ## combination of color images
>   img = readImage(system.file("images", "sample-color.png", package="EBImage"))[257:768,,]
>   x = combine(img, flip(img), flop(img))
>   display(x, all=TRUE)
> 
>   ## Blurred images
>   x = resize(img, 128, 128)
>   xt = list()
>   for (t in seq(0.1, 5, len=9)) xt=c(xt, list(gblur(x, s=t)))
>   xt = combine(xt)
>   display(xt, title='Blurred images', all=TRUE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>