powered by
Zoom/rotate/translate an image relative to its center for images represented as simple arrays.
transzoom( img = NULL, zoom = 1, shift = c(0, 0), angle = 0, size = NULL, col = "black", filter = "bilinear", file.in = "", file.out = "", format = "png", show.image = TRUE )
n-by-m-by-3 array or n-by-m-by-4 array representing an rgb(+alpha) image.
zoom factor (>0).
2-vector specifying the vertical+horizontal translation in units of output pixels (i.e. after zooming).
rotation angle in degrees.
2-vector specifying the vertical+horizontal dimensions of the output image. If not given, this is taken to be identical to the input image.
background color
affine transformation filter; either 'none' or 'bilinear'
optional input filename, which can be used to load an image instead of providing it via img. This filename is ignored if img is specified.
img
optional output filename.
one of "png" or "jpg" specifying the file format of the input and output image.
logical flag specifying whether the image is displayed in the R console.
Returns an n-by-m-by-3 array or n-by-m-by-4 array of the processed image.
# NOT RUN { img = yinyangyong # this is an example image included in the package transzoom(img, zoom=2) # zoom by a factor 2 # }
Run the code above in your browser using DataLab