Bayer

From apertus wiki
Jump to: navigation, search

Debayering, or demosaicing is the process of converting a raw image (direct from the color sensor) into a viewable RGB image.

Several algorithms exist, some are fast and not very accurate, some are very accurate and very slow. Depending on the application (realtime monitoring vs high quality render for movie finishing), different approaches can be taken.

1 Downsampling 4k image to 2k

This approach will most likely be taken for the incamera monitoring. Taking a 2 by 2 pixel (1 blue, 1 red, and 2 greens) array, a single color can be determined. I fear there will be a lot of aliasing this way, but the image will be quickly rendered (quick enough for realtime monitoring). depending on this some alternative algorithm can be used. The best algorithm is VNG 4 colours (read the pdf below for explanation on how the algo works). It's also the slowest. It avoids the so called "maze" effect caused by different greens on the same pixel.


2 Various algorithms

Demosaicing is evolving. Better algorithms (quality and/or speed) might appear.

3 For now, just a list of links of interesting links

First read this, everything is well explained : http://www.stark-labs.com/craig/articles/assets/Debayering_API.pdf

An explanation of some algorithms : http://www.unc.edu/~rjean/demosaicing/demosaicing.pdf

A very accurate one : http://www.ipol.im/pub/art/2011/bcms-ssdd/

Try online : http://demo.ipol.im/demo/g_demosaicking_with_contour_stencils/

Comparison of demosaicing algorithms : http://www.pages.drexel.edu/~par24/rawhistogram/40D_Demosaicing/40D_DemosaicingArtifacts.html And it's interactive, so can quickly see what's going on here

Those guys claim to debayer 800 mbps images on gpu : http://www.fastcompression.com/solutions/demosaicing/demosaicing.htm