RNotes | EBImage


library(EBImage)

Spatial Linear Transformations

par(mfrow=c(1,4))
x <- readImage(system.file("images", "sample.png", package="EBImage"))
display(x)

display( flip(x) )
display( flop(x) ) 
display( resize(x, 128) )

display( rotate(x, 30) )
display( rotate(x,-60, bg="white") )
display( translate(x, c(120, -20)) )

m <- matrix(c(0.6, 0.2, 0, -0.2, 0.3, 300), nrow=3)
m
##      [,1]  [,2]
## [1,]  0.6  -0.2
## [2,]  0.2   0.3
## [3,]  0.0 300.0
display( affine(x, m, bg="white") )