37 #include <Utils/Param.hh>
38 #include <Base/Image/ImageIO.hh>
39 #include <Image/CylinderMapping.hh>
40 #include <Base/Debug/TimeMeasure.hh>
45 int main(
int args,
char **arg)
53 param.
AddParamBool(
"help",
"prints info about all parameters",
false,
'h');
58 std::vector<int> vecMethodIDs;
59 std::vector<string> vecMethodNames;
61 vecMethodNames.push_back(
"bi");
63 vecMethodNames.push_back(
"tri");
64 param.
AddParamEnum(
"method",
"interpolation method (bi, tri)",
65 vecMethodNames, (
int)MapTrilinear, &vecMethodIDs,
'm');
79 cout <<
"no input image specified (try --help)" << endl;
87 BIASERR(
"error loading image: "<<(*param.
GetParamString(
"image")));
94 cout <<
"image width = " << image.
GetWidth() << endl;
95 cout <<
"image height = " << image.
GetHeight() << endl;
103 if (hx > 0) cout <<
"Setting hx to " << hx << endl;
105 if (hy > 0) cout <<
"Setting hy to " << hy << endl;
117 mapping.
Map(image, target, method);
119 cout<<
"Time consumed for mapping: "<<1e-3*timer.
GetRealTime()<<
" ms\n";
139 cout<<
"Mapped image written to ExampleCylinderMapping.mip"<<endl;
double * GetParamDouble(const std::string &name) const
InterpolationMethod
accuracy for resampling
void setFocalLength(const double fx, const double fy)
Set the focal length of the camera.
void DisableDestructorWarning()
Uses this just before end of your program to avoid error from destructor.
bool * AddParamBool(const std::string &name, const std::string &help, bool deflt=false, char cmdshort=0, int Group=GRP_NOSHOW)
double * AddParamDouble(const std::string &name, const std::string &help, double deflt=0.0, double min=-DBL_MAX, double max=DBL_MAX, char cmdshort=0, int Group=GRP_NOSHOW)
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)
int * GetParamEnum(const std::string &name) const
unsigned int GetWidth() const
int ParseCommandLine(int &argc, char *argv[])
scan command line arguments for valid parameters
bool * GetParamBool(const std::string &name) const
void Usage(std::ostream &os=std::cout)
print Help-Information to stdout
void Clear(const StorageType value=0)
sets all pixels to zero/value
std::string * GetParamString(const std::string &name) const
void setPrincipalPoint(const double px, const double py)
Set the principal point of the camera.
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
unsigned int GetHeight() const
int Map(const Image< InputStorageType > &src, Image< OutputStorageType > &sink, InterpolationMethod=MapTrilinear, bool newSink=false, double SuperSampling=1.0)
backward mapping with various interpolations
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.
double GetRealTime() const
return real time (=wall time clock) in usec JW For Win32: real-time is measured differently from user...
This class Param provides generic support for parameters.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
functions for spherical undistortion of given images, needs image dimensions, principal point and foc...
std::string * AddParamString(const std::string &name, const std::string &help, std::string deflt="", char cmdshort=0, int Group=GRP_NOSHOW)
class TimeMeasure contains functions for timing real time and cpu time.