Hugin trunk 0.1
Loading...
Searching...
No Matches
PhotometricOptimizer.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
24#ifndef _PHOTOMETRIC_OPTIMIZER_H_
25#define _PHOTOMETRIC_OPTIMIZER_H_
26
27#include <hugin_shared.h>
30
31#include <vector>
35
36namespace HuginBase
37{
38
40 {
41
42 public:
44 typedef std::vector<vigra_ext::PointPairRGB> PointPairs;
45
48 const OptimizeVector& vars,
49 const PointPairs& correspondences, const float imageStepSize)
51 o_vars(vars), o_correspondences(correspondences), o_resultError(0.0), o_imageStepSize(imageStepSize)
52 {};
53
56
57
58 public:
60 static void optimizePhotometric(PanoramaData& pano, const OptimizeVector& vars,
61 const PointPairs& correspondences,
62 const float imageStepSize,
64 double& error);
65
66 protected:
69 {
70 std::string type;
71 std::set<unsigned> imgs;
72 };
73
75 struct OptimData
76 {
77
79 std::vector<SrcPanoImage> m_imgs;
80 std::vector<VarMapping> m_vars;
81 std::vector<vigra_ext::PointPairRGB> m_data;
82 double huberSigma;
84
87
88
90 OptimData(const PanoramaData& pano, const OptimizeVector& optvars,
91 const std::vector<vigra_ext::PointPairRGB>& data,
92 double mEstimatorSigma, bool symmetric,
94
96 void ToX(double * x);
97
99 void FromX(double * x);
100
101 };
102
103 static int photometricVis(double *p, double *x, int m, int n, int iter, double sqerror, void * data);
104
106 static void photometricError(double* p, double* x, int m, int n, void* data);
107
108
109 public:
111 virtual bool modifiesPanoramaData() const
112 { return true; }
113
115 virtual bool runAlgorithm();
116
117
118 public:
119 double getResultError() const
120 {
121 // [TODO] if(!hasRunSuccessfully()) DEBUG;
122 return o_resultError;
123 }
124
125
126 protected:
129 const float o_imageStepSize;
131 };
132
133
134
135
137 {
138 public:
141 OPT_PHOTOMETRIC_LDR=0,
144 OPT_PHOTOMETRIC_HDR_WB
145 };
146
155
158
159
160 public:
163 static void smartOptimizePhotometric(PanoramaData & pano, PhotometricOptimizeMode mode,
164 const std::vector<vigra_ext::PointPairRGB> & correspondences,
165 const float imageStepSize,
167 double & error);
168
170 virtual bool runAlgorithm();
171
172
173 protected:
175 };
176
177
178
179} // namespace
180
181
182#endif
!! from PTOptimise.h 1951
Model for a panorama.
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
std::vector< vigra_ext::PointPairRGB > PointPairs
PhotometricOptimizer(PanoramaData &panorama, AppBase::ProgressDisplay *progressDisplay, const OptimizeVector &vars, const PointPairs &correspondences, const float imageStepSize)
PhotometricOptimizeMode
local optimize definition.
SmartPhotometricOptimizer(PanoramaData &panorama, AppBase::ProgressDisplay *progressDisplay, const OptimizeVector &vars, const PointPairs &correspondences, const float imageStepSize, PhotometricOptimizeMode optMode)
#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< vigra_ext::PointPairRGB > m_data
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