35 #include <Image/ConvertBayerPattern.hh>
37 #error This tool requires LINUX
39 #include <Base/Image/ImageIO.hh>
40 #include <Base/Image/ImageBase.hh>
41 #include <Base/Image/ImageConvert.hh>
42 #include <dc1394/dc1394.h>
43 #include <dc1394/conversions.h>
46 #include <Utils/IOUtils.hh>
47 #include <Image/Camera.hh>
52 int main(
int argc,
char *argv[])
56 vector<string> conversionMethod;
57 conversionMethod.push_back(
"NEAREST");
58 conversionMethod.push_back(
"SIMPLE");
59 conversionMethod.push_back(
"BILINEAR");
60 conversionMethod.push_back(
"HQLINEAR");
61 conversionMethod.push_back(
"VNG");
62 conversionMethod.push_back(
"AHD");
63 int* convMethod = params.
AddParamEnum(
"conversionMethod",
64 "what method for conversion shall be used?"
66 conversionMethod, 5, NULL,
'M');
71 cout<<
"Usage:\n"<<argv[0]<<
" <srcImg> <targetImg> \n";
75 cout<<
"Usage:\n"<<argv[0]<<
" <srcImg> <targetImg> \n";
81 unsigned int width=0, height=0, channels=0;
87 cout<<
"error loading "<<argv[fup]<<endl;
100 out.
Init(width, height, 3);
106 converter.
Convert(source,out, method,
117 cout<<
"writing "<<argv[fup+1]<<endl;
119 cout<<
"Error writing result!\n";
static bool LoadCamera(std::string *fileName, BIAS::Camera< dataType > &cam)
int * AddParamEnum(const std::string &name, const std::string &help, const std::vector< std::string > &enums, const int deflt=0, const std::vector< int > *IDs=NULL, const char cmdshort=0, const int Group=GRP_NOSHOW)
Wrapper class to dc1394 bayer conversion class.
BayerDemosaicMethod
methods for conversion from bayer to rgb
This class hides the underlying projection model, like projection matrix, spherical camera...
int SetProj(const Projection &Proj)
static bool ParseCommandLineEvalHelp(Param ¶ms, int argc, char *argv[])
parses the command line, adds parameter "help"
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
int UpdateMetaData()
copy P_ and co.
This class Param provides generic support for parameters.
invalid (not set) image format
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.