Rescale Gray Levels.

DESCRIPTION:

Rescales the values of a matrix or an image.

This function is an S Version 3 generic (see Methods); method functions can be written to handle specific S Version 3 classes of data. Classes which already have methods for this function include:
crystal.matrix .

USAGE:

stretch(x, ...) 
stretch.default(x, power.stretch=0, stretch.fun=NULL) 
stretch.crystal.matrix(x, low.pass=T, power.stretch=0, stretch.fun=NULL) 

REQUIRED ARGUMENTS:

x
a numeric vector or matrix or an object inheriting from class crystal.matrix.

OPTIONAL ARGUMENTS:

power.stretch
a numeric value giving the power of the transform if stretch.image is TRUE. If power.stretch=0, then image is transformed with log(abs(x)+1). Otherwise, the image is transformed with (abs(x))^power.stretch.
stretch.fun
the image will be transformed using stretch.fun. If provided, then power.stretch will be ignored.
low.pass
logical flag, if TRUE the smooth/low-frequency coefficients are scaled to have the same dynamic range as the remaining coefficients. Only for objects which inherit from class wpt.2d (2-D DWT and 2-D wavelet packet transforms).

VALUE:

the transformed (stretched) vector or image with the same dimensions as x.

DETAILS:

Rescaling the gray levels is used to enhance the visual display of an image.

SEE ALSO:

, .