34 #include <Base/Debug/Debug.hh>
35 #include <Base/Image/ImageConvert.hh>
36 #include <Base/Image/ImageIO.hh>
37 #include <Base/Debug/TimeMeasure.hh>
38 #include <Image/PyramidImage.hh>
39 #include <Utils/Param.hh>
44 int main(
int argc,
char *argv[])
52 param.
AddParamBool(
"help",
"prints info about all parameters",
false,
'h');
55 param.
AddParamInt(
"size",
"pyramid size", 4, 1, 256,
's');
56 param.
AddParamDouble(
"factor",
"resampling factor per step", 2.0, 1.0, 1e6,
'f');
70 if (imageName.empty()) {
71 cout <<
"no input image specified (try --help)" << endl;
79 BIASERR(
"error loading image " << imageName);
82 cout <<
"loaded image " << imageName << endl;
93 double pyramidDownsamplingFactor = *param.
GetParamDouble(
"factor");
105 cout <<
"calculation of pyramid image with size " << pyramid.
size()
106 <<
" for image with size " << image.
GetWidth() <<
"x"
112 if (!outputPrefix.empty())
116 BIASERR(
"error writing pyramid image " << outputPrefix);
118 cout <<
"saved pyramid image to " << outputPrefix <<
"-pl*.mip" << endl;
121 cout <<
"use --output to save output images to disk" << endl;
void SetZero()
sets all pixels in all images to zero
double * GetParamDouble(const std::string &name) const
unsigned size() const
deprecated interface
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)
unsigned int GetWidth() const
int ParseCommandLine(int &argc, char *argv[])
scan command line arguments for valid parameters
int Downsample()
downsamples from (*this)[0] assumes that all pointers e.g.
bool * GetParamBool(const std::string &name) const
void Usage(std::ostream &os=std::cout)
print Help-Information to stdout
std::string * GetParamString(const std::string &name) const
void Init(const Image< StorageType > &image, const unsigned py_size=0)
copy image into level 0 and create other levels according to parameters set so far (pyramidsize...
int * GetParamInt(const std::string &name) const
unsigned int GetHeight() const
double GetRealTime() const
return real time (=wall time clock) in usec JW For Win32: real-time is measured differently from user...
enum EColorModel GetColorModel() const
int WriteImages(const std::string &prefix) const
writes a file in mip format per pyramid level using prefix
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...
int * AddParamInt(const std::string &name, const std::string &help, int deflt=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), char cmdshort=0, int Group=GRP_NOSHOW)
For all adding routines:
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.
void SetRescaleFactor(const double factor)
static int IP_ToGrey(Image< StorageType > &img)
In place conversion to gray image.