Orfeo Toolbox  4.0
otbSinclairToReciprocalCovarianceMatrixFunctor.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 __otbSinclairToReciprocalCovarianceMatrixFunctor_h
19 #define __otbSinclairToReciprocalCovarianceMatrixFunctor_h
20 
21 #include "vcl_complex.h"
22 
23 namespace otb
24 {
25 namespace Functor
26 {
56 template <class TInput1, class TInput2, class TInput3, class TOutput>
58 {
59 public:
61  typedef typename std::complex <double> ComplexType;
62  typedef typename TOutput::ValueType OutputValueType;
63  inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv, const TInput3& Svv)
64  {
65  TOutput result;
66 
67  result.SetSize(NumberOfComponentsPerPixel);
68 
69  const ComplexType S_hh = static_cast<ComplexType>(Shh);
70  const ComplexType S_hv = static_cast<ComplexType>(Shv);
71  const ComplexType S_vv = static_cast<ComplexType>(Svv);
72 
73  result[0] = static_cast<OutputValueType>( std::norm( S_hh ) );
74  result[1] = static_cast<OutputValueType>( S_hh*vcl_conj(S_hv) );
75  result[2] = static_cast<OutputValueType>( S_hh*vcl_conj(S_vv) );
76  result[3] = static_cast<OutputValueType>( std::norm( S_hv ) );
77  result[4] = static_cast<OutputValueType>( S_hv*vcl_conj(S_vv) );
78  result[5] = static_cast<OutputValueType>( std::norm( S_vv ) );
79 
80  return (result);
81  }
82 
84  {
86  }
87 
90 
93 
94 protected:
95 
96 
97 private:
98  //itkStaticConstMacro(NumberOfComponentsPerPixel, unsigned int, 6);
99  static const unsigned int NumberOfComponentsPerPixel = 6;
100 
101 };
102 
103 } // namespace Functor
104 } // namespace otb
105 
106 #endif

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