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 
00028 #if defined _MSC_VER && _MSC_VER<1800
00029     #include <boost/cstdint.hpp>
00030     using namespace boost;
00031 #else
00032     #include <stdint.h>
00033 #endif
00034 
00035 #include "hugin_utils/shared_ptr.h"
00036 #include <vigra/stdimage.hxx>
00037 #include <vigra/imageinfo.hxx>
00038 
00039 #ifdef _MSC_VER
00040 #define THROWNOIMAGESBADDIMENSION
00041 #else
00042 #define THROWNOIMAGESBADDIMENSION throw(NoImages, BadDimensions)
00043 #endif
00044 
00045 namespace deghosting {
00046     
00049     class BadDimensions : public std::exception {
00050         public:
00051             BadDimensions() : std::exception() {};
00052             virtual const char * what() const throw() {
00053                 return "Input images must have the same dimensions";
00054             }
00055     };
00056     
00059     class NoImages : public std::exception {
00060         public:
00061             NoImages() : std::exception() {};
00062             virtual const char * what() const throw() {
00063                return "You must specify images";
00064             }
00065     };
00066     
00067     typedef sharedPtrNamespace::shared_ptr<vigra::BImage> BImagePtr;
00068     typedef sharedPtrNamespace::shared_ptr<vigra::FImage> FImagePtr;
00069     // type for camera response
00070     typedef std::vector<float> EMoR;
00071 
00072     // constants for advanced modes
00073     const uint16_t ADV_GAMMA         = 1;
00074     const uint16_t ADV_ONLYP         = 2;
00075     const uint16_t ADV_MULTIRES      = 4;
00076 
00077     // constants for debug modes
00078     const uint16_t SAVE_INITWEIGHTS   = 1;
00079 
00080     class Deghosting
00081     {
00082     public:
00083         Deghosting() : flags(0), debugFlags(0), iterations(0), verbosity(0) {}
00084         
00088         virtual std::vector<FImagePtr> createWeightMasks() = 0;
00089 
00093         virtual void loadImages(std::vector<std::string>& inputFiles) THROWNOIMAGESBADDIMENSION;
00094         virtual void loadImages(std::vector<vigra::ImageImportInfo>& inputFiles) THROWNOIMAGESBADDIMENSION;
00095 
00100         virtual void setFlags(const uint16_t flags);
00101         
00105         virtual void setDebugFlags(const uint16_t debugFlags);
00106         
00109         virtual void setIterationNum(const int iterations);
00110         
00115         virtual void setCameraResponse(EMoR response);
00116         
00120         virtual void setVerbosity(int verbosity);
00121         virtual ~Deghosting() {}
00122         
00123     protected:
00124         std::vector<vigra::ImageImportInfo> inputFiles;
00125         uint16_t flags;
00126         uint16_t debugFlags;
00127         int iterations;
00128         EMoR response;
00129         int verbosity;
00130     };
00131 
00132 }
00133 
00134 #endif /* DEGHOSTING_H_ */

Generated on 29 Aug 2015 for Hugintrunk by  doxygen 1.4.7