deghosting.h

Go to the documentation of this file.
00001 
00021 #ifndef DEGHOSTING_H_
00022 #define DEGHOSTING_H_
00023 
00024 #include <exception>
00025 #include <vector>
00026 #include <string>
00027 #include <stdint.h>
00028 
00029 #include <memory>
00030 #include <vigra/stdimage.hxx>
00031 #include <vigra/imageinfo.hxx>
00032 
00033 #ifdef _MSC_VER
00034 #define THROWNOIMAGESBADDIMENSION
00035 #else
00036 #define THROWNOIMAGESBADDIMENSION throw(NoImages, BadDimensions)
00037 #endif
00038 
00039 namespace deghosting {
00040     
00043     class BadDimensions : public std::exception {
00044         public:
00045             BadDimensions() : std::exception() {};
00046             virtual const char * what() const throw() {
00047                 return "Input images must have the same dimensions";
00048             }
00049     };
00050     
00053     class NoImages : public std::exception {
00054         public:
00055             NoImages() : std::exception() {};
00056             virtual const char * what() const throw() {
00057                return "You must specify images";
00058             }
00059     };
00060     
00061     typedef std::shared_ptr<vigra::BImage> BImagePtr;
00062     typedef std::shared_ptr<vigra::FImage> FImagePtr;
00063     // type for camera response
00064     typedef std::vector<float> EMoR;
00065 
00066     // constants for advanced modes
00067     const uint16_t ADV_GAMMA         = 1;
00068     const uint16_t ADV_ONLYP         = 2;
00069     const uint16_t ADV_MULTIRES      = 4;
00070 
00071     // constants for debug modes
00072     const uint16_t SAVE_INITWEIGHTS   = 1;
00073 
00074     class Deghosting
00075     {
00076     public:
00077         Deghosting() : flags(0), debugFlags(0), iterations(0), verbosity(0) {}
00078         
00082         virtual std::vector<FImagePtr> createWeightMasks() = 0;
00083 
00087         virtual void loadImages(std::vector<std::string>& inputFiles) THROWNOIMAGESBADDIMENSION;
00088         virtual void loadImages(std::vector<vigra::ImageImportInfo>& inputFiles) THROWNOIMAGESBADDIMENSION;
00089 
00094         virtual void setFlags(const uint16_t flags);
00095         
00099         virtual void setDebugFlags(const uint16_t debugFlags);
00100         
00103         virtual void setIterationNum(const int iterations);
00104         
00109         virtual void setCameraResponse(EMoR response);
00110         
00114         virtual void setVerbosity(int verbosity);
00115         virtual ~Deghosting() {}
00116         
00117     protected:
00118         std::vector<vigra::ImageImportInfo> inputFiles;
00119         uint16_t flags;
00120         uint16_t debugFlags;
00121         int iterations;
00122         EMoR response;
00123         int verbosity;
00124     };
00125 
00126 }
00127 
00128 #endif /* DEGHOSTING_H_ */

Generated on 7 Dec 2016 for Hugintrunk by  doxygen 1.4.7