adimpro {adimpro} | R Documentation |
Create image objects of class "adimpro" from arrays, RAW-format files and other image formats.
read.raw(filename, type="PPM", wb="NONE",cspace="sRGB",interp="Bilinear", rm.ppm=TRUE, compress=TRUE) read.image(filename, compress=TRUE, convert.path="convert") make.image(x,gamma=FALSE,compress=TRUE)
filename |
file name |
x |
Array or matrix containing RGB or greyscale values in the range (0,1) or (0,65535). |
type |
option settings for dcraw. default "PPM", alternatives are "RAW", "Halfsize" and "Info". |
wb |
white balance. default "CAMERA", alternatives are "AUTO" and "NONE". |
cspace |
defines the output color space, default "sRGB", alternatives are "RAW", "Adobe", "wGamut" and "XYZ", see manpages of dcraw. |
interp |
defines the interpolation method, default "Bilinear", Alternatives are "VNG", "" and "FourC" (Four color interpolation), see manpages of dcraw. "VNG" seems to provide the smallest spatial correlations. |
rm.ppm |
remove intermediate tmp file? default TRUE |
gamma |
logical, determines value$gamma |
compress |
logical, determines if image data are stored in raw-format. |
convert.path |
Windows system calls seem to change environment variable PATH, such that "convert" points to c:\windows\system32\convert.exe instead of ImageMagick-x.x.x\convert. Therefore here the full path must be provided. Backslash needs to be escaped: c:\\programs\\imagemagick-6.3.0\\convert |
If ImageMagick is available on the system, read.image
reads any of
the following image file formats: c("tif", "tiff", "pgm", "ppm",
"png", "pnm", "gif", "jpg", "jpeg") converts it into a temporary "pgm" or
"ppm" file. This file is removed after reading the image.
If ImageMagick is not available only "pgm", "ppm" and "pnm" formats
can be processed.
If dcraw is available on the system, read.raw
reads many RAW
formats. type
sets options to dcraw: "PPM" sets "-4", "RAW" sets "-4
-d", "HALFSIZE" sets "-h", "INFO" sets "-i -v". wb
indicates,
which white balance should be used: "NONE", "AUTO", "CAMERA".
make.image
converts an appropriate 2 or 3 dimensional array to
an image object of class "adimpro".
object of class "adimpro" containing the image. The object has the following components:
img |
array containing the color values in the color space specified by value$type . |
type |
the color space. |
depth |
color depth, here "16bit". |
dim |
vector of length 2 containing the number of pixel in horizontal and vertival direction. |
file |
the argument file identifying the image. |
cspace |
the type of rgb space used, as specified by cspace . |
interp |
interpolation applied by dcraw, as specified by interp . |
gamma |
has a gamma correction been applied, here FALSE. |
wb |
type of white balance, as specified by wb . |
compressed |
image data are stored as raw-vector (TRUE) or array of integers (FALSE). |
The function requires dcraw to be installed.
Karsten Tabelow tabelow@wias-berlin.de, Joerg Polzehl polzehl@wias-berlin.de
## Not run: read.raw("test.crw")