Learn R Programming

adimpro (version 0.6.1)

develop.raw: Create a color image from RAW image data.

Description

The function generates a color image from RAW image data.

Usage

develop.raw(object, method = "BILINEAR", wb = c(1, 1, 1), compress = TRUE)

Arguments

object
An object of class "adimpro" containing RAW image data, e.g. created by function read.raw. Such an object is characterized by object$type=="RAW".
method
Method to fill missing color values. Currently implemented are method="HALF" (reduce image size by factor of 2), method="FULL" (use color from neighbor within (2x2) Bayer mask)) and method="BILINEAR" (bilinear in
wb
numerical vector of length 3 containing multiplicative factors for the three color channels.
compress
logical, determines if image data are stored as raw.

Value

  • object of class "adimpro" containing the image.

Details

RAW image data usually contain only one color value at each pixel, with colors arranged in a so called Bayer mask. Converting RAW images into color images requires to fill the missing entries in the color channels.

See Also

read.image

Examples

Run this code
img1 <- read.raw(system.file("img/rawimage.png",package="adimpro"),type="RAW")
img2 <- develop.raw(img1)
X11(width=5,height=3)
par(mfrow=c(1,2),mar=c(2,2,2,.5),mgp=c(2,1,0))
show.image(img1) 
title("RAW image")
show.image(img2) 
title("result of demosaicing")

Run the code above in your browser using DataLab