Learn R Programming

imager (version 0.15)

imager.combine: Combining images

Description

These functions take a list of images and combine them by adding, multiplying, taking the parallel min or max, etc.

Usage

add(x)

average(x)

mult(x)

parmax(x)

parmin(x)

enorm(x)

Arguments

x
a list of images

Functions

  • add: Add images
  • average: Average images
  • mult: Multiply images (pointwise)
  • parmax: Parallel max over images
  • parmin: Parallel min over images
  • enorm: Euclidean norm (i.e. sqrt(A^2 + B^2 + ...))

See Also

imsplit,Reduce

Examples

Run this code
im1 <- as.cimg(function(x,y) x,100,100)
im2 <- as.cimg(function(x,y) y,100,100)
im3 <- as.cimg(function(x,y) cos(x/10),100,100)
l <- list(im1,im2,im3)
add(l) %>% plot #Add the images
average(l) %>% plot #Average the images
mult(l) %>% plot #Multiply
parmax(l) %>% plot #Parallel max
parmin(l) %>% plot #Parallel min
#Edge detection
imgradient(boats,"xy") %>% enorm %>% plot
#Pseudo-artistic effects
llply(seq(1,35,5),function(v) boxblur(boats,v)) %>% parmin %>% plot
llply(seq(1,35,5),function(v) boxblur(boats,v)) %>% average %>% plot

Run the code above in your browser using DataLab