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.
The DeBayer filter is loaded by an application using the following code:
// Load the DeBayer filter from the stdfilters.ftf module. #ifdef _DEBUG smart_com<IFrameFilter> pFilter = FilterLoader::createFilter( "DeBayer", // Filter name. "stdfiltersd.ftf" ); // Module file. #else smart_com<IFrameFilter> pFilter = FilterLoader::createFilter( "DeBayer", // Filter name. "stdfilters.ftf" ); // Module file. #endif
There are two parameters that control the de-bayering process:
If the algorithm should be set programmatically, then following code can be used:
// Retrieve the current mode. long mode; pFilter->getParameter( "Mode", mode ); // Set a new mode. mode = 1; pFilter->setParameter( "Mode", mode );
All parameters can be accessed using the built-in property dialog. The property dialog of the DeBayer filter is as follows: