Orfeo Toolbox  4.0
otbSinclairToReciprocalCircularCovarianceMatrixFunctor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbSinclairToReciprocalCircularCovarianceMatrixFunctor_h
19 #define __otbSinclairToReciprocalCircularCovarianceMatrixFunctor_h
20 
21 #include "vcl_complex.h"
23 
24 namespace otb
25 {
26 namespace Functor
27 {
57 template <class TInput1, class TInput2, class TInput3, class TOutput>
59 {
60 public:
62  typedef double RealType;
63  typedef std::complex <RealType> ComplexType;
64  typedef typename TOutput::ValueType OutputValueType;
66 
67  inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv, const TInput3& Svv)
68  {
69  TOutput result;
70 
71  result.SetSize(m_NumberOfComponentsPerPixel);
72 
73 
74  const ComplexType S_hh = static_cast<ComplexType>(Shh);
75  const ComplexType S_hv = static_cast<ComplexType>(Shv);
76  const ComplexType S_vv = static_cast<ComplexType>(Svv);
77 
78  const ComplexType coef(0.5);
79 
80  const ComplexType j2S_hv = S_hv * ComplexType(0.0, 2.0);
81 
82  const ComplexType Sll = coef * ( -S_hh-j2S_hv+S_vv );
83  const ComplexType Slr = coef * ( -S_hh+-S_vv );
84  const ComplexType Srr = coef * ( -S_hh+j2S_hv+S_vv );
85 
86  //const ComplexType conjSll = vcl_conj(Sll);
87  //const ComplexType conjSlr = vcl_conj(Slr);
88  //const ComplexType conjSrr = vcl_conj(Srr);
89 
91  return ( funct(Sll, Slr, Srr ) );
92  }
93 
95  {
97  }
98 
101 
104 
105 protected:
106 
107 
108 private:
110 };
111 
112 } // namespace Functor
113 } // namespace otb
114 
115 #endif

Generated at Sat Mar 8 2014 16:18:28 for Orfeo Toolbox with doxygen 1.8.3.1