adjust.image {adimpro}R Documentation

Image Processing

Description

Color space transformations, change of white balance and exposure, gamma correction and histogram equalization.

Usage

adjust.image(img, gammatype=NULL, cspace = NULL, whitep = NULL, 
                 temp = NULL, black=0, exposure = 1, kind = "Bradford", 
                 alg = 1, compress= TRUE)

Arguments

img

image object, class"adimpro".

gammatype

character, determines the type of gamma correction within the image. "ITU" stands for ITU-R BT.709-3 as e.g. used by dcraw. Alternatives recognized within the package are "None", "sRGB" and "CIE" (CIE L*). NULL keeps the actual setting. gammatype="histogram" forces histogram equalization based on the corresponding greyvalue image.

cspace

defines the output color space, default "sRGB" (sRGB D65), alternatives are "Adobe" (Adobe 1998 D65), "wGamut" (Wide Gamut D65), "kodak" (Kodak ProPhoto D65) "xyz", "yuv", "yiq" and "hsi". NULL keeps the actual setting.

whitep

White point in xyY space. Can be given as one of (character) c("A","B","C","E","D50","D55","D65","D75","F2","F7","F11") or as a two element numeric vector of chromatic xy coordinates. "D65" corresponds to the default white point of "sRGB" and "Adobe" RGB-spaces. NULL keeps the actual setting.

temp

Color temperature. Can be used to specify chromatic xy coordinates of the whitepoint. Only used if is.null(whitep).

black

Adjustment for black color. Color values with luminance <= black will be assigned to black in RGB. Adjustment ist done in xyY space.

exposure

Multiplicative factor for all color channels (in xyz or rgb spaces). Applied in linear color space, i.e. if the image is gamma corrected the gamma correction is reversed first.

kind

Algorithm for chromatic adaptation. Alternatives are "Bradford", "VonKries" and "XYZscaling"

alg

determines the approximation for the gamma correction. Select 1 for fastest computation and 3 for maximum accuracy, or 2 for a compromise.

compress

logical, determines if image data are stored in raw-format.

Details

This function adjusts color channels and applies gamma correction (if applicable).

If color.par$red or color.par$blue or color.par$brightness differ from 1.0 the corresponding channels are multiplied with the provided values. Saturated values are set to 1.

If img$gamma==FALSE, perform gamma correction with color.par$ga and color.par$bp. alg chooses between three different computing algorithms (approximations) with increasing computation time and precision (alg is 1,2, or 3).

Value

Adjusted image object of class "adimpro".

Author(s)

Karsten Tabelow tabelow@wias-berlin.de and Joerg Polzehl polzehl@wias-berlin.de

See Also

show.image, write.image

Examples

## Not run: demo(color)

[Package adimpro version 0.9.3 Index]