DeBayer Filter

The DeBayer filter is used to convert raw image data into an RGB image. In a raw color image, every pixel represents a value for one basic color, instead of three as is the case for an RGB image. In order to get a real color image, the two missing colors have to be interpolated. This is exactly what this filter does.

Using the DeBayer Filter

The DeBayer filter is loaded by an application using the following code:

[VB.NET]
Dim DeBayerFilter As FrameFilter DeBayerFilter = IcImagingControl1.FrameFilterCreate("DeBayer""stdfilters.ftf")
[C#]
FrameFilter DeBayerFilter; DeBayerFilter = ICImagingControl1.FrameFilterCreate("DeBayer""stdfilters.ftf");

Parameters

There are two parameters that control the de-bayering process:

Start Pattern
The parameter Start Pattern defines how the Bayer Mosaic pattern in the raw image data is to be interpreted.
Available start patterns are:
  • BG: The raw image data starts with a blue/green line. Set Start Pattern to 0.
  • GB: The raw image data starts with a green/blue line. Set Start Pattern to 1.
  • GR: The raw image data starts with a green/red line. Set Start Pattern to 2.
  • RG: The raw image data starts with a red/green line. Set Start Pattern to 3.
Mode
The Mode parameter selects the algorithm used to de-bayer the raw image data.
Available algorithms are:
  • Nearest Color: Simple and fast algorithm, but rather bad output image quality. Set Mode to 0.
  • Bilinear: Fast algorithm producing good output image quality. Set Mode to 1.
  • Edge Sensing: This algorithm has the best output image quality but is rather slow. Set Mode to 2.

If the algorithm should be set programmatically, then following code can be used:

[VB.NET]
' Retrieve the current mode. Dim mode As Integer mode = DeBayerFilter.GetIntParameter("Mode")   ' Set a new Mode. mode = 1 DeBayerFilter.SetIntParameter("Mode", mode)
[C#]
// Retrieve the current mode. int mode = DeBayerFilter.GetIntParameter("Mode");   // Set a new Mode. mode = 1; DeBayerFilter.SetIntParameter("Mode", mode);

Property Dialog

All parameters can be accessed using the built-in property dialog. The property dialog of the DeBayer filter is as follows:

image

<< IC Imaging Control Standard Filters

This site is part of The Imaging Source Network. Other sites include Company Portal, Image Processing, Astronomy Cameras, Astronomy Cameras Blog, Blog caméras d'astronomie, Astronomy Cameras Competition, TX Text Control, TX Text Control Blog and Forums.