Image Component Library (ICL)
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
icl::core::BayerConverter Class Reference

Utiltity class for bayer pattern conversion. More...

#include <BayerConverter.h>

Inheritance diagram for icl::core::BayerConverter:
icl::utils::Uncopyable

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 More...
 
 BayerConverter (bayerPattern eBayerPattern, bayerConverterMethod eConvMethod=bilinear, const utils::Size &sizeHint=utils::Size::null)
 creates a new BayerConverter instances More...
 
 ~BayerConverter ()
 
void apply (const Img8u *src, ImgBase **dst)
 converts the source image with bayer pattern into the More...
 
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 More...
 

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; More...
 
bayerConverterMethod m_eConvMethod
 
bayerPattern m_eBayerPattern
 
IppiBayerGrid m_IppBayerPattern
 

Additional Inherited Members

- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 

Detailed Description

Utiltity class for bayer pattern conversion.

The internal implementation was basically taken from the libdc files

Member Enumeration Documentation

◆ bayerConverterMethod

Enumerator
nearestNeighbor 
simple 
bilinear 
hqLinear 
edgeSense 
vng 

◆ bayerPattern

Enumerator
bayerPattern_RGGB 
bayerPattern_GBRG 
bayerPattern_GRBG 
bayerPattern_BGGR 

Constructor & Destructor Documentation

◆ BayerConverter() [1/2]

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

creates a bayer converter with given string-based parameters

◆ BayerConverter() [2/2]

icl::core::BayerConverter::BayerConverter ( bayerPattern  eBayerPattern,
bayerConverterMethod  eConvMethod = bilinear,
const utils::Size sizeHint = utils::Size::null 
)

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

◆ ~BayerConverter()

icl::core::BayerConverter::~BayerConverter ( )

Member Function Documentation

◆ apply()

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

◆ bilinearInterpolation()

void icl::core::BayerConverter::bilinearInterpolation ( const Img8u poBayerImg)
private

◆ clearBorders()

void icl::core::BayerConverter::clearBorders ( icl8u rgb,
int  sx,
int  sy,
int  w 
)
private

◆ clip()

void icl::core::BayerConverter::clip ( int *  iIn,
icl8u iOut 
)
inlineprivate

◆ convert_bayer_to_gray()

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

◆ edgeSenseInterpolation()

void icl::core::BayerConverter::edgeSenseInterpolation ( const Img8u poBayerImg)
private

◆ hqLinearInterpolation()

void icl::core::BayerConverter::hqLinearInterpolation ( const Img8u poBayerImg)
private

◆ nnInterpolation()

void icl::core::BayerConverter::nnInterpolation ( const Img8u poBayerImg)
private

◆ nnInterpolationIpp()

void icl::core::BayerConverter::nnInterpolationIpp ( const Img8u poBayerImg)
private

◆ setBayerPattern() [1/2]

void icl::core::BayerConverter::setBayerPattern ( bayerPattern  eBayerPattern)
inline

◆ setBayerPattern() [2/2]

void icl::core::BayerConverter::setBayerPattern ( const std::string &  pattern)
inline

◆ setConverterMethod()

void icl::core::BayerConverter::setConverterMethod ( bayerConverterMethod  eConvMethod)
inline

◆ setMethod()

void icl::core::BayerConverter::setMethod ( const std::string &  method)
inline

◆ simpleInterpolation()

void icl::core::BayerConverter::simpleInterpolation ( const Img8u poBayerImg)
private

◆ translateBayerConverterMethod() [1/2]

static std::string icl::core::BayerConverter::translateBayerConverterMethod ( bayerConverterMethod  ebcm)
static

◆ translateBayerConverterMethod() [2/2]

static bayerConverterMethod icl::core::BayerConverter::translateBayerConverterMethod ( std::string  sbcm)
static

◆ translateBayerPattern() [1/2]

static std::string icl::core::BayerConverter::translateBayerPattern ( bayerPattern  ebp)
static

◆ translateBayerPattern() [2/2]

static bayerPattern icl::core::BayerConverter::translateBayerPattern ( std::string  sbp)
static

Member Data Documentation

◆ m_buffer

std::vector<icl8u> icl::core::BayerConverter::m_buffer
private

internal buffer;

◆ m_eBayerPattern

bayerPattern icl::core::BayerConverter::m_eBayerPattern
private

◆ m_eConvMethod

bayerConverterMethod icl::core::BayerConverter::m_eConvMethod
private

◆ m_IppBayerPattern

IppiBayerGrid icl::core::BayerConverter::m_IppBayerPattern
private

The documentation for this class was generated from the following file: