Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
emor.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
24 #ifndef VIGRA_EXT_EMOR_H
25 #define VIGRA_EXT_EMOR_H
26 
27 #include <assert.h>
28 
29 #include <vector>
30 
31 #include <vigra/numerictraits.hxx>
32 #include <vigra_ext/utils.h>
33 
34 //#define DEBUG_WRITE_FILES
35 
36 namespace vigra_ext{
37 
38 namespace EMoR
39 {
40  extern IMPEX double f0[1024];
41  extern IMPEX double h[25][1024];
42 
43  template <class VECTOR>
44  inline void createEMoRLUT(const std::vector<float> & params, VECTOR & lut)
45  {
46  typedef typename VECTOR::value_type VT;
47 
48  VT s = (VT) vigra_ext::LUTTraits<VT>::max();
49 
50 // lookup tables
51  size_t nDim = params.size();
52  assert(nDim < 26);
53  lut.resize(1024);
54  for (int i=0; i<1024; ++i) {
55  double t = vigra_ext::EMoR::f0[i];
56  for (size_t j=0; j < nDim; j++) {
57  t += params[j] * vigra_ext::EMoR::h[j][i];
58  }
59  lut[i] = vigra::NumericTraits<VT>::fromRealPromote(t*s);
60  }
61  }
62 }
63 
64 } // namespace
65 
66 #endif // VIGRA_EXT_VIGNETTING_CORRECTION_H
functions to manage ROI&#39;s
IMPEX double f0[1024]
Definition: emor.cpp:37
IMPEX double h[25][1024]
Definition: emor.cpp:169
#define IMPEX
Definition: hugin_shared.h:39
void createEMoRLUT(const std::vector< float > &params, VECTOR &lut)
Definition: emor.h:44
std::vector< float > EMoR
Definition: deghosting.h:48