Shrink resolution of an image
shrink.image(img, method = "median",
xt = img$dim[1], yt = img$dim[2], ratio = TRUE,
compress=TRUE)
image data, an object of class "adimpro".
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".
target x-dimension
target y-dimension
logical. preserve x-y ratio? default: TRUE
logical, determines if image data are stored in raw-format.
shrinked image
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.
# NOT RUN {
demo(manipulate)
# }
Run the code above in your browser using DataLab