Hugin trunk 0.1
Loading...
Searching...
No Matches
PTOptimizer.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
28#ifndef _PTOPTIMIZER_H
29#define _PTOPTIMIZER_H
30
32
33#include <hugin_shared.h>
34#include <set>
37
38namespace HuginBase {
39
40
43 {
44
45 public:
50
52 virtual ~PTOptimizer()
53 {}
54
55
56 public:
58 virtual bool modifiesPanoramaData() const
59 { return true; }
60
62 virtual bool runAlgorithm();
63 };
64
67 {
68 public:
69 enum Mode {AUTO, HOMOGRAPHY, RPY, RPYV, RPYVB};
70
72 RANSACOptimizer(PanoramaData& panorama, int i1, int i2, double maxError, Mode mode=RPY)
73 : PanoramaAlgorithm(panorama), o_i1(i1), o_i2(i2),
74 o_maxError(maxError), o_mode(mode)
75 {};
76
79 {}
80
81
82 public:
84 virtual bool modifiesPanoramaData() const
85 { return true; }
86
87 static std::vector<int> findInliers(PanoramaData & pano, int i1, int i2, double maxError,
88 Mode mode=RPY);
89
91 virtual bool runAlgorithm();
92
93 private:
94 int o_i1, o_i2;
95 double o_maxError;
96 std::vector<int> o_inliers;
98 };
99
100
103 {
104
105 public:
110
113 {}
114
115
116 public:
118 static void autoOptimise(PanoramaData& pano, bool optRoll=true);
119
120 public:
122 virtual bool runAlgorithm()
123 {
124 autoOptimise(o_panorama);
125 return true; // let's hope so.
126 }
127
128 };
129
132 {
133 public:
135 enum OptMode {
136 OPT_POS=1,
137 OPT_B=2,
138 OPT_AC=4,
139 OPT_DE=8,
140 OPT_HFOV=16,
141 OPT_GT=32,
142 OPT_VIG=64,
143 OPT_VIGCENTRE=128,
144 OPT_EXP=256,
145 OPT_WB=512,
146 OPT_RESP=1024
147 };
148
150 static OptimizeVector createOptVars(const PanoramaData& optPano, int mode, unsigned anchorImg=0);
151 };
152
154 {
155
156 public:
161
164 {}
165
166 public:
168 static void smartOptimize(PanoramaData& pano);
169
170
171 public:
173 virtual bool runAlgorithm()
174 {
175 smartOptimize(o_panorama);
176 return true; // let's hope so.
177 }
178
179 };
180
181}//namespace
182
183#endif //_h
wraps around PTOptimizer
virtual bool runAlgorithm()
calls PTools::optimize()
AutoOptimise(PanoramaData &panorama, bool optRoll=true)
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
Definition PTOptimizer.h:58
PTOptimizer(PanoramaData &panorama)
Definition PTOptimizer.h:47
Model for a panorama.
Pairwise ransac optimisation.
Definition PTOptimizer.h:67
RANSACOptimizer(PanoramaData &panorama, int i1, int i2, double maxError, Mode mode=RPY)
Definition PTOptimizer.h:72
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
Definition PTOptimizer.h:84
std::vector< int > o_inliers
Definition PTOptimizer.h:96
virtual bool runAlgorithm()
calls PTools::optimize()
SmartOptimise(PanoramaData &panorama)
#define IMPEX
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
Definition wxcms.cpp:39
std::vector< std::set< std::string > > OptimizeVector
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41