Orfeo Toolbox  4.0
otbReciprocalCovarianceToReciprocalCoherencyImageFilter.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 
19 #ifndef __ReciprocalCovarianceToReciprocalCoherencyImageFilter_h
20 #define __ReciprocalCovarianceToReciprocalCoherencyImageFilter_h
21 
23 
24 namespace otb
25  {
26 
27 namespace Functor {
28 
50 template< class TInput, class TOutput>
52 {
53 public:
54  typedef typename std::complex <double> ComplexType;
55  typedef typename TOutput::ValueType OutputValueType;
56 
57  inline TOutput operator()( const TInput & Covariance ) const
58  {
59  TOutput result;
60  result.SetSize(m_NumberOfComponentsPerPixel);
61 
62  /* Using the convention
63  * \f$ C_{11} = S_{hh}*S_{hh}^* \f$
64  * \f$ C_{12} = S_{hh}*S_{hv}^* \f$
65  * \f$ C_{13} = S_{hh}*S_{vv}^* \f$
66  * \f$ C_{22} = S_{hv}*S_{hv}^* \f$
67  * \f$ C_{23} = S_{hv}*S_{vv}^* \f$
68  * \f$ C_{33} = S_{vv}*S_{vv}^* \f$
69  */
70  const ComplexType C11 = static_cast<ComplexType>(Covariance[0]);
71  const ComplexType C12 = static_cast<ComplexType>(Covariance[1]);
72  const ComplexType C13 = static_cast<ComplexType>(Covariance[2]);
73  const ComplexType C22 = static_cast<ComplexType>(Covariance[3]);
74  const ComplexType C23 = static_cast<ComplexType>(Covariance[4]);
75  const ComplexType C33 = static_cast<ComplexType>(Covariance[5]);
76 
77  //const ComplexType C21 = vcl_conj(C12);
78  const ComplexType C31 = vcl_conj(C13);
79  const ComplexType C32 = vcl_conj(C23);
80 
81  result[0] = static_cast<OutputValueType>( 0.5*(C11 + C13 + C31 + C33) );
82  result[1] = static_cast<OutputValueType>( 0.5*(C11 - C13 + C31 - C33) );
83  result[2] = static_cast<OutputValueType>( C12 + C32 );
84  result[3] = static_cast<OutputValueType>( 0.5*(C11 - C13 - C31 + C33) );
85  result[4] = static_cast<OutputValueType>( C12 - C32 );
86  result[5] = static_cast<OutputValueType>( 2.0 * C22 );
87 
88  return result;
89  }
90 
91  unsigned int GetOutputSize()
92  {
94  }
95 
98 
101 
102 private:
104 };
105 }
106 
107 
117 template <class TInputImage, class TOutputImage>
119  public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::ReciprocalCovarianceToReciprocalCoherencyFunctor<
120  typename TInputImage::PixelType, typename TOutputImage::PixelType> >
121 {
122 public:
126  typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctorType;
130 
132  itkNewMacro(Self);
133 
136 
137 
138 protected:
141 
142 private:
143  ReciprocalCovarianceToReciprocalCoherencyImageFilter(const Self&); //purposely not implemented
144  void operator=(const Self&); //purposely not implemented
145 
146 
147 };
148 
149 } // end namespace otb
150 
151 #endif

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