1 #include "ConvertBayerPattern.hh"
2 #include <Filter/Convolution.hh>
3 #include <Base/Image/ImageConvert.hh>
4 #include <Base/Image/ImageBase.hh>
5 #include <Base/Image/ImageIO.hh>
12 template <
class StorageType>
16 template <
class StorageType>
21 template <
class StorageType>
33 for(
unsigned int y = 0; y < src.
GetHeight(); y++){
34 for(
unsigned int x = 0; x < src.
GetWidth() ;x++){
39 input.SetPixel (value,x,y);
43 pSrc = input.GetImageData();
46 dc1394bayer_method_t dcMethod = SelectMethod_(method);
52 dc1394color_filter_t coding = SelectFilter_(bayer_pattern);
77 template <
class StorageType>
81 return DC1394_BAYER_METHOD_AHD;
83 return DC1394_BAYER_METHOD_BILINEAR;
85 return DC1394_BAYER_METHOD_HQLINEAR;
87 return DC1394_BAYER_METHOD_NEAREST;
89 return DC1394_BAYER_METHOD_SIMPLE;
91 return DC1394_BAYER_METHOD_VNG;
93 return DC1394_BAYER_METHOD_AHD;
96 template <
class StorageType>
99 return DC1394_COLOR_FILTER_BGGR;
101 return DC1394_COLOR_FILTER_GBRG;
103 return DC1394_COLOR_FILTER_GRBG;
105 return DC1394_COLOR_FILTER_RGGB;
107 return DC1394_COLOR_FILTER_RGGB;
110 #define INST(type) template class ConvertBayerPattern<type>;
113 #ifdef BUILD_IMAGE_USHORT
EColorModel
These are the most often used color models.
Bayer_GRBG, 1 channel RGB image Bayer tile.
void SetBitDepth(unsigned bitdepth)
needed by ImageIO
(16bit) unsigned integer image storage type
void SetColorModel(EColorModel Model)
Bayer_RGGB, 1 channel RGB image Bayer tile.
unsigned int GetWidth() const
unsigned int GetBitDepth() const
returns the bits per channel Is not necessairily 8*sizeof(StorageType), could be fewer bits...
Wrapper class to dc1394 bayer conversion class.
StorageType PixelValue(const unsigned int x, const unsigned int y, const unsigned short int channel=0) const
Returns value of pixel at specific position, using specific channel as offset.
Bayer_BGGR, 1 channel RGB image Bayer tile.
Bayer_GBRG, 1 channel RGB image Bayer tile.
BayerDemosaicMethod
methods for conversion from bayer to rgb
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
color values, 3 channels, order: red,green,blue
unsigned int GetHeight() const
The image template class for specific storage types.
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
enum EColorModel GetColorModel() const
invalid (not set) image format
enum EStorageType GetStorageType() const
(8bit) unsigned char image storage type
int Convert(Image< StorageType > &src, Image< StorageType > &dst, BayerDemosaicMethod method=BAYER_DEMOSAIC_METHOD_AHD, ImageBase::EColorModel bayer_pattern=ImageBase::CM_invalid)
converts image with bayerpattern to rgb.