shrink.image {adimpro} | R Documentation |
Image Processing
Description
Shrink resolution of an image
Usage
shrink.image(img, method = "median",
xt = img$dim[1], yt = img$dim[2], ratio = TRUE,
compress=TRUE)
Arguments
img |
image data, an object of class "adimpro". |
method |
method to be used to shrink the image. "median" (default), "mean", or "nearest". "median" is supposed to give best results. For a considerably faster result use "nearest". |
xt |
target x-dimension |
yt |
target y-dimension |
ratio |
logical. preserve x-y ratio? default: |
compress |
logical, determines if image data are stored in raw-format. |
Details
This function shrinkes the resolution of the image such that the x-y
dimension of the resulting image is smaller than the original one.
xt
and yt
give the target dimension
of the image. If ratio == TRUE
(default) the ratio between x- and
y-dimension is preserved.
method
"nearest" selects a pixel nearest to the new coordinates.
method
"mean" defines the color of a pixel as the mean of
all pixel identified with the new coordinate.
method
"median" set the color of a pixel as color of an
L1-generalized median of all pixel identified with the new coordinate.
Value
shrinked image
Author(s)
Karsten Tabelow tabelow@wias-berlin.de and Joerg Polzehl polzehl@wias-berlin.de
Examples
## Not run: demo(manipulate)