Demosaicing

Reconstructed image after demosaicing

As demosaicing (also: Demosaicking ) is called in digital photography, the reconstruction of a color raster image from the incomplete color values ​​of an overlaid with mosaic color filter image sensor.

Basics

The image sensors of most digital cameras are based on Bayer sensors. This is to CCD sensors, which are coated with a matrix of regularly spaced red, green, and blue filters. Since each pixel may take only the value of a color channel, the color information is incomplete. To generate a raster graphics, which stores full RGB values ​​for each pixel, neighboring primary color values ​​must be interpolated.

In addition to the Bayer sensors, there are image sensors with RGBE (red, green, blue, cyan ) - or CYGM ( cyan, yellow, green, magenta ) filters, which also require demosaicing. When Foveon X3 direct image sensors or three-shot sensors, the values ​​of all three primary colors are added for each pixel; It is therefore not necessary demosaicing.

The demosaicing can be carried out either by the firmware of the camera, a JPEG or TIFF image is generated than can be applied to an image in raw format.

Processes and artifacts

Demosaicing is a simple way of the interpolation by means of a reconstruction filter, for example by bilinear filtering (see scaling). This may lead to blurring and other image artifacts:

  • " Zipper -like " checkerboard pattern created on the edges which do not extend along the color filters of a primary color;
  • Color shifts occur as aliasing when the color filter array interferes with regularly arranged image details.

There are numerous other demosaicing methods have been developed with the aim to reduce or eliminate these artifacts. These include:

  • Color interpolation: instead of interpolating the RGB values ​​individually, only the color values ​​are defined as interpolated. This method is one of the first that came to be used in commercial digital camera systems.
  • Median filter: In the first step, an image is formed by bilinear filtering. Then, a median filter (e.g., R - G and B - G) to the difference of the color channels used in this image. The output image is then calculated from the two median-filtered color difference images and the original image sensor. The red value of a green sensor pixel is calculated, for example by the value of the median-filtered R- G- image is added to the green value.
  • Edge-based interpolation: In the first step, an interpolated luminance image is generated from the green values ​​of the sensor image. In the second step, an interpolated color-difference image is calculated from the red and blue values ​​is generated ( R - G and B - G). Here, there will be a simple edge detection so that interpolation is typically only between two horizontally or vertically adjacent values ​​. From these color difference images then the chrominance channels (R and B) are reconstructed.
  • Mustererabgleich and recognition: techniques such as pattern matching or pattern recognition is used to reconstruct the missing color values.
227283
de