Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
icl::core::BayerConverter Class Reference

Utiltity class for bayer pattern conversion. More...

#include <BayerConverter.h>

Inheritance diagram for icl::core::BayerConverter:

List of all members.

Public Types

enum  bayerConverterMethod {
  nearestNeighbor = 0, simple, bilinear, hqLinear,
  edgeSense, vng
enum  bayerPattern { bayerPattern_RGGB = 512, bayerPattern_GBRG, bayerPattern_GRBG, bayerPattern_BGGR }

Public Member Functions

 BayerConverter (const std::string &pattern="RGGB", const std::string &method="bilinear")
 creates a bayer converter with given string-based parameters
 BayerConverter (bayerPattern eBayerPattern, bayerConverterMethod eConvMethod=bilinear, const utils::Size &sizeHint=utils::Size::null)
 creates a new BayerConverter instances
 ~BayerConverter ()
void apply (const Img8u *src, ImgBase **dst)
 converts the source image with bayer pattern into the
void setBayerPattern (bayerPattern eBayerPattern)
void setConverterMethod (bayerConverterMethod eConvMethod)
void setBayerPattern (const std::string &pattern)
void setMethod (const std::string &method)

Static Public Member Functions

static std::string translateBayerConverterMethod (bayerConverterMethod ebcm)
static bayerConverterMethod translateBayerConverterMethod (std::string sbcm)
static std::string translateBayerPattern (bayerPattern ebp)
static bayerPattern translateBayerPattern (std::string sbp)
static void convert_bayer_to_gray (const Img8u &src, Img8u &dst, const std::string &pattern)
 static utility method to convert a given bayer image to grayscale

Private Member Functions

void nnInterpolation (const Img8u *poBayerImg)
void bilinearInterpolation (const Img8u *poBayerImg)
void hqLinearInterpolation (const Img8u *poBayerImg)
void edgeSenseInterpolation (const Img8u *poBayerImg)
void simpleInterpolation (const Img8u *poBayerImg)
void nnInterpolationIpp (const Img8u *poBayerImg)
void clearBorders (icl8u *rgb, int sx, int sy, int w)
void clip (int *iIn, icl8u *iOut)

Private Attributes

std::vector< icl8um_buffer
 internal buffer;
bayerConverterMethod m_eConvMethod
bayerPattern m_eBayerPattern
IppiBayerGrid m_IppBayerPattern

Detailed Description

Utiltity class for bayer pattern conversion.

The internal implementation was basically taken from the libdc files

Member Enumeration Documentation


Constructor & Destructor Documentation

icl::core::BayerConverter::BayerConverter ( const std::string &  pattern = "RGGB",
const std::string &  method = "bilinear" 

creates a bayer converter with given string-based parameters

creates a new BayerConverter instances

The given size hint can be used to accellerate the first apply call, where the internal working buffer's size is adapted on demand

Member Function Documentation

void icl::core::BayerConverter::apply ( const Img8u src,
ImgBase **  dst 

converts the source image with bayer pattern into the

given destination image. Dst will become an Img8u

void icl::core::BayerConverter::bilinearInterpolation ( const Img8u poBayerImg) [private]
void icl::core::BayerConverter::clearBorders ( icl8u rgb,
int  sx,
int  sy,
int  w 
) [private]
void icl::core::BayerConverter::clip ( int *  iIn,
icl8u iOut 
) [inline, private]
static void icl::core::BayerConverter::convert_bayer_to_gray ( const Img8u src,
Img8u dst,
const std::string &  pattern 
) [static]

static utility method to convert a given bayer image to grayscale

This is much faster than applying the standard bayer method, which will run though the image several times:

  • creating the interlearved rgb-image
  • converting the interleaved rgb-image to a planar rgb image
  • converting the planar rgb image to a one channel gray scale image

The destination image is adapted in size and format

void icl::core::BayerConverter::edgeSenseInterpolation ( const Img8u poBayerImg) [private]
void icl::core::BayerConverter::hqLinearInterpolation ( const Img8u poBayerImg) [private]
void icl::core::BayerConverter::nnInterpolation ( const Img8u poBayerImg) [private]
void icl::core::BayerConverter::nnInterpolationIpp ( const Img8u poBayerImg) [private]
void icl::core::BayerConverter::setBayerPattern ( bayerPattern  eBayerPattern) [inline]
void icl::core::BayerConverter::setBayerPattern ( const std::string &  pattern) [inline]
void icl::core::BayerConverter::setMethod ( const std::string &  method) [inline]
void icl::core::BayerConverter::simpleInterpolation ( const Img8u poBayerImg) [private]
static std::string icl::core::BayerConverter::translateBayerPattern ( bayerPattern  ebp) [static]
static bayerPattern icl::core::BayerConverter::translateBayerPattern ( std::string  sbp) [static]

Member Data Documentation

internal buffer;

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines