Image Component Library (ICL)
|
Utiltity class for bayer pattern conversion. More...
#include <BayerConverter.h>
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< icl8u > | m_buffer |
internal buffer; | |
bayerConverterMethod | m_eConvMethod |
bayerPattern | m_eBayerPattern |
IppiBayerGrid | m_IppBayerPattern |
Utiltity class for bayer pattern conversion.
The internal implementation was basically taken from the libdc files
icl::core::BayerConverter::BayerConverter | ( | const std::string & | pattern = "RGGB" , |
const std::string & | method = "bilinear" |
||
) |
creates a bayer converter with given string-based parameters
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
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:
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::setConverterMethod | ( | bayerConverterMethod | eConvMethod | ) | [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::translateBayerConverterMethod | ( | bayerConverterMethod | ebcm | ) | [static] |
static bayerConverterMethod icl::core::BayerConverter::translateBayerConverterMethod | ( | std::string | sbcm | ) | [static] |
static std::string icl::core::BayerConverter::translateBayerPattern | ( | bayerPattern | ebp | ) | [static] |
static bayerPattern icl::core::BayerConverter::translateBayerPattern | ( | std::string | sbp | ) | [static] |
std::vector<icl8u> icl::core::BayerConverter::m_buffer [private] |
internal buffer;
IppiBayerGrid icl::core::BayerConverter::m_IppBayerPattern [private] |