Demosaicing

Demosaicing

A demosaicing algorithm is a digital image process used to reconstruct a full color image from the incomplete color samples output from an image sensor overlaid with a color filter array (CFA). Also known as CFA interpolation or color reconstruction, another common spelling is demosaicking.

Most modern digital cameras acquire images using a single image sensor overlaid with a CFA, so demosaicing is part of the processing pipeline required to render these images into a viewable format.

Many modern digital cameras can save images in a raw format allowing the user to demosaic it using software, rather than using the camera's built-in firmware.

Contents

Goal

The aim of a demosaicing algorithm is to reconstruct a full color image (i.e. a full set of color triples) from the spatially undersampled color channels output from the CFA. The algorithm should have the following traits:

Color filter array

The Bayer arrangement of color filters on the pixel array of an image sensor. Each two-by-two cell contains two green, one blue, and one red filter.

A color filter array is a mosaic of color filters in front of the image sensor. Commercially, the most commonly used CFA configuration is the Bayer filter illustrated here. This has alternating red(R) and green (G) filters for odd rows and alternating green (G) and blue (B) filters for even rows. There are twice as many green filters as red or blue ones, exploiting the human eye's higher sensitivity to green light.

Since the color subsampling of a CFA by its nature results in aliasing, an optical anti-aliasing filter is typically placed in the optical path between the image sensor and the lens to reduce the false color artifacts (chromatic aliases) introduced by interpolation.[1]

Since each pixel of the sensor is behind a color filter, the output is an array of pixel values, each indicating a raw intensity of one of the three filter colors. Thus, an algorithm is needed to estimate for each pixel the color levels for all color components, rather than a single component.

Illustration

To reconstruct a full color image from the data collected by the color filtering array, a form of interpolation is needed to fill in the blanks. The mathematics here is subject to individual implementation, and is called demosaicing.

In this example, we use Adobe Photoshop's bicubic interpolation to simulate the circuitry of a Bayer filter device such as a digital camera.

The image below simulates the output from a Bayer filtered image sensor; each pixel has only a red, green or blue component. The corresponding original image is shown alongside the demosaiced reconstruction at the end of this section.

Shades framed bayer.png
Bayer filter samples
Shades bayer r.png Shades bayer g.png Shades bayer b.png
Red Green Blue

A digital camera typically has means to reconstruct a whole RGB image using the above information. The resulting image could be something like this:

Shades framed aa.jpg Shades framed dc.jpg
Original Reconstructed

The reconstructed image is typically accurate in uniform-colored areas, but has a loss of resolution (detail and sharpness) and has edge artifacts (for example, the edges of letters have visible color fringes and some roughness).

Algorithms

Simple interpolation

These algorithms are examples of multivariate interpolation on a uniform grid, using relatively straightforward mathematical operations on nearby instances of the same color component. The simplest method is nearest-neighbor interpolation which simply copies an adjacent pixel of the same color channel. It is unsuitable for any application where quality matters, but can be useful for generating previews given limited computational resources. Another simple method is bilinear interpolation, whereby the red value of a non-red pixel is computed as the average of the two or four adjacent red pixels, and similarly for blue and green. More complex methods that interpolate independently within each color plane include bicubic interpolation, spline interpolation, and Lanczos resampling.

Although these methods can obtain good results in homogenous image regions, they are prone to severe demosaicing artifacts in regions with edges and details when used with pure-color CFAs.[2] However, linear interpolation can obtain very good results when combined with a spatio-spectral (panchromatic) CFA.[3]

Pixel correlation within an image

More sophisticated demosaicing algorithms exploit the spatial and/or spectral correlation of pixels within a color image.[4] Spatial correlation is the tendency of pixels to assume similar color values within a small homogeneous region of an image. Spectral correlation is the dependency between the pixel values of different color planes in a small image region.

These algorithms include:

  • Variable Number of Gradients[5] interpolation computes gradients near the pixel of interest and uses the lower gradients (representing smoother and more similar parts of the image) to make an estimate. It is used in first versions of dcraw, and suffers from color artifacts.
  • Pixel Grouping[6] uses assumptions about natural scenery in making estimates. It has fewer color artifacts on natural images than the Variable Number of Gradients method; it was introduced in dcraw from rel. 8.71 as "Patterned Pixel Grouping".
  • Adaptive homogeneity-directed interpolation selects the direction of interpolation so as to maximize a homogeneity metric, thus typically minimizing color artifacts.[7] It has been implemented in recent versions of dcraw.[8]

Video super-resolution/demosaicing

It has recently been shown that super-resolution and demosaicing are two faces of the same problem and it is reasonable to address them in a unified context.[9] Note that both these problems address the aliasing issue. Therefore, especially in the case of video (multi-frame) reconstruction, a joint super-resolution and demosaicing approach provides the optimal solution.

Tradeoffs

Some methods may produce better results for natural scenes, and some for printed material, for instance. This reflects the inherent problem in estimating pixels that we do not really know for certain. Naturally, there is also the ubiquitous tradeoff of speed versus quality of estimation.

Use in computer image processing software

When one has access to the raw image data from a digital camera, one can use computer software with a variety of different demosaicing algorithms instead of being limited to the one built into the camera. A few raw development programs, such as Raw Therapee, give the user an option to choose which algorithm should be used. Most programs, however, are coded to use one particular method. The differences in rendering the finest detail (and grain texture) that come from the choice of demosaicing algorithm are among the main differences between various raw developers; often photographers will prefer a particular program for aesthetic reasons related to this effect.

The color artifacts due to demosaicing provide important clues for identifying photo forgeries.[10]

See also

References

  1. ^ Adrian Davies and Phil Fennessy (2001). Digital imaging for photographers (Fourth ed.). Focal Press. ISBN 0240515900. http://books.google.com/?id=wsxk03-gceUC&pg=PA30&lpg=PA30&dq=anti-aliasing+lithium-niobate. 
  2. ^ Lanlan Chang and Yap-Peng Tan. Hybrid color filter array demosaicking for effective artifact suppression. pp. 2. http://www3.ntu.edu.sg/home5/CHAN0069/JEI013003.pdf. 
  3. ^ Keigo Hirakawa and Patrick J. Wolfe. Spatio-Spectral Color Filter Array Design for Enhanced Image Fidelity. http://sisl.seas.harvard.edu/files/pub/HirakawaWolfe2007.pdf. 
  4. ^ Lanlan Chang and Yap-Peng Tan. Hybrid color filter array demosaicking for effective artifact suppression. http://www3.ntu.edu.sg/home5/CHAN0069/JEI013003.pdf. 
  5. ^ Ting Chen. "Interpolation using a Threshold-based variable number of gradients". http://scien.stanford.edu/class/psych221/projects/99/tingchen/algodep/vargra.html. 
  6. ^ Chuan-kai Lin, Portland State University (2004). "Pixel Grouping for Color Filter Array Demosaicing". http://www.cs.pdx.edu/~cklin/demosaic/. 
  7. ^ Kiego Hirakawa; Thomas W. Parks (PDF). Adaptive homogeneity-directed demosaicing algorithm. http://www.accidentalmark.com/research/papers/Hirakawa03MNdemosaic_ICIP.pdf. 
  8. ^ Decoding raw digital photos in Linux, Dave Coffin.
  9. ^ Sina Farsiu, Michael Elad, Peyman Milanfar (2006). "Multi-Frame Demosaicing and Super-Resolution of Color Images". IEEE Trans. on Image Processing 15 (1): 141–159. doi:10.1109/TIP.2005.860336. http://www.duke.edu/%7Esf59/TIP_Demos_Final_Color.pdf. 
  10. ^ YiZhen Huang and YangJing Long (2008). "Demosaicking recognition with applications in digital photo authentication based on a quadratic pixel correlation model". Proc. IEEE Conference on Computer Vision and Pattern Recognition: 1–8. http://pages.cs.wisc.edu/~huangyz/cvpr08_Huang.pdf. 

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Demosaicing — Sensorbild vor Demosaicing Rekonstruiertes Bild nach Demosaicing Als Demosaicing (auch …   Deutsch Wikipedia

  • Foveon X3 sensor — The Foveon X3 sensor is a CMOS [El Gamal, A., [http://isl.stanford.edu/ abbas/group/papers and pub/iedm02.pdf Trends in CMOS Image Sensor Technology and Design] , Stanford University (2002 or later). Retrieved March 3, 2007.] image sensor for… …   Wikipedia

  • Bayer filter — The Bayer arrangement of color filters on the pixel array of an image sensor …   Wikipedia

  • Color filter array — The Bayer color filter mosaic. Each two by two submosaic contains 2 green, 1 blue and 1 red filter, each covering one pixel sensor. In photography, a color filter array (CFA), or color filter mosaic (CFM), is a mosaic of tiny color filters placed …   Wikipedia

  • Depth of field — The area within the depth of field appears sharp, while the areas in front of and beyond the depth of field appear blurry …   Wikipedia

  • Digital camera — Digicam redirects here. For the military camouflauge method using micropatterns, see Military camouflage#Digital camouflauge. A digital camera (or digicam) is a camera that takes video or still photographs, or both, digitally by recording images… …   Wikipedia

  • Raw image format — Infobox file format name = RAW image file extension = .raf (Fuji) .crw .cr2 (Canon) .tif .k25 .kdc .dcs .dcr .drf (Kodak) .mrw (Minolta) .nef .nrw (Nikon) .orf (Olympus) .dng (Adobe) .ptx .pef (Pentax) .arw .srf .sr2 (Sony) .x3f (Sigma) .erf… …   Wikipedia

  • Image processing engine — The image processing engine, or image processor, is an important component of a digital camera and plays a vital role in creating the digital image.The image processing engine must perform a complex range of tasks.The photodiodes employed in an… …   Wikipedia

  • Mosaico filtro de color — Mosaico del filtro de color Bayer. Cada submosaico de dos por dos contiene 2 filtros verdes, 1 azul y 1 rojo, cada uno de ellos cubriendo un sensor de un pixel. En fotografía, un mosaico de filtros de color o matriz de filtros de color (CFA, por… …   Wikipedia Español

  • Digital cinematography — Arriflex D 21 Panavision Genesis …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”