Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin_base/panodata/PanoImage.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00026 #ifndef _PANODATA_PANOIMAGE_H 00027 #define _PANODATA_PANOIMAGE_H 00028 00029 #include <hugin_config.h> 00030 00031 #include <iostream> 00032 #include <vector> 00033 #include <vigra/diff2d.hxx> 00034 #include <hugin_math/hugin_math.h> 00035 00036 00037 namespace HuginBase { 00038 00040 struct Keypoint 00041 { 00042 Keypoint() 00043 { scale=0; orientation=0; laplacianSign=0; }; 00044 00045 hugin_utils::FDiff2D pos; 00046 std::vector<float> descriptor; 00047 double scale; 00048 double orientation; 00049 int laplacianSign; 00050 }; 00051 00053 struct ImageOptions { 00054 00055 ImageOptions() 00056 : featherWidth(10), 00057 ignoreFrameWidth(0), 00058 morph(false), 00059 docrop(false), 00060 autoCenterCrop(true), 00061 m_vigCorrMode(VIGCORR_RADIAL|VIGCORR_DIV), 00062 responseType(0), 00063 active(true) 00064 { }; 00065 00066 00068 unsigned int featherWidth; 00069 00071 unsigned int ignoreFrameWidth; 00072 00074 bool morph; 00075 00076 // crop parameters 00077 bool docrop; 00078 bool autoCenterCrop; 00079 vigra::Rect2D cropRect; 00080 00081 00083 enum VignettingCorrMode { 00084 VIGCORR_NONE = 0, 00085 VIGCORR_RADIAL = 1, 00086 VIGCORR_FLATFIELD = 2, 00087 VIGCORR_DIV = 4 00088 }; 00089 00090 int m_vigCorrMode; 00091 00092 // coefficients for vignetting correction (even degrees: 0,2,4,6, ...) 00093 std::string m_flatfield; 00094 00095 // the response type (Rt) 00096 int responseType; 00097 00098 // is image active (displayed in preview and used for optimisation) 00099 bool active; 00100 }; 00101 00102 00103 00112 class PanoImage 00113 { 00114 00115 public: 00117 PanoImage(); 00118 00120 PanoImage(const std::string &filename, int width, int height, int lens); 00121 00123 // PanoImage(const std::string & filename); 00124 00126 // PanoImage(QDomNode & node); 00127 00129 virtual ~PanoImage(); 00130 00131 00132 public: 00134 virtual const char* isA() const 00135 { return "PanoImage"; }; 00136 00137 00138 public: 00140 std::string getFilename() const 00141 { return filename; } 00142 00143 void setFilename(const std::string& fn) 00144 { filename = fn; } 00145 00146 const ImageOptions& getOptions() const 00147 { return options; } 00148 00149 void setOptions(const ImageOptions & opt) 00150 { options = opt; } 00151 00152 unsigned int getHeight() const 00153 { return height; } 00154 00155 unsigned int getWidth() const 00156 { return width; } 00157 00158 void setLensNr(const unsigned int& l) 00159 { lensNr = l; } 00160 00161 unsigned int getLensNr() const 00162 { return lensNr; } 00163 00164 void setSize(const vigra::Size2D& sz) 00165 { width =sz.x; height = sz.y; } 00166 00167 void setFeatherWidth(const unsigned int& w) 00168 { options.featherWidth = w; } 00169 00170 const std::vector<Keypoint> & getKeypoints() const 00171 { return m_keypoints; }; 00172 00173 void setKeypoints(const std::vector<Keypoint> & keypoints) 00174 { m_keypoints = keypoints; }; 00175 00176 private: 00177 // read image info (size, exif header) 00178 // bool readImageInformation(); 00179 // bool imageRead; 00180 00181 // image properties needed by Panorama tools. 00182 std::string filename; 00183 int height; 00184 int width; 00185 unsigned int lensNr; // the lens of this image 00186 ImageOptions options; 00187 std::vector<Keypoint> m_keypoints; 00188 }; 00189 00190 00192 //typedef std::vector<PanoImage> ImageVector; 00193 00194 00195 } // namespace 00196 #endif // _H
1.3.9.1