Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
SARPolarimetry
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
22
#include "
otbUnaryFunctorImageFilter.h
"
23
24
namespace
otb
25
{
26
27
namespace
Functor {
28
50
template
<
class
TInput,
class
TOutput>
51
class
ReciprocalCovarianceToReciprocalCoherencyFunctor
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
{
93
return
m_NumberOfComponentsPerPixel
;
94
}
95
97
ReciprocalCovarianceToReciprocalCoherencyFunctor
() :
m_NumberOfComponentsPerPixel
(6) {}
98
100
virtual
~ReciprocalCovarianceToReciprocalCoherencyFunctor
() {}
101
102
private
:
103
unsigned
int
m_NumberOfComponentsPerPixel
;
104
};
105
}
106
107
117
template
<
class
TInputImage,
class
TOutputImage>
118
class
ITK_EXPORT
ReciprocalCovarianceToReciprocalCoherencyImageFilter
:
119
public
UnaryFunctorImageFilter
<TInputImage, TOutputImage, Functor::ReciprocalCovarianceToReciprocalCoherencyFunctor<
120
typename TInputImage::PixelType, typename TOutputImage::PixelType> >
121
{
122
public
:
124
typedef
ReciprocalCovarianceToReciprocalCoherencyImageFilter
Self
;
125
typedef
Functor::ReciprocalCovarianceToReciprocalCoherencyFunctor
<
126
typename
TInputImage::PixelType,
typename
TOutputImage::PixelType>
FunctorType
;
127
typedef
UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctorType>
Superclass
;
128
typedef
itk::SmartPointer<Self>
Pointer
;
129
typedef
itk::SmartPointer<const Self>
ConstPointer
;
130
132
itkNewMacro(
Self
);
133
135
itkTypeMacro(
ReciprocalCovarianceToReciprocalCoherencyImageFilter
,
UnaryFunctorImageFilter
);
136
137
138
protected
:
139
ReciprocalCovarianceToReciprocalCoherencyImageFilter
() {}
140
virtual
~ReciprocalCovarianceToReciprocalCoherencyImageFilter
() {}
141
142
private
:
143
ReciprocalCovarianceToReciprocalCoherencyImageFilter
(
const
Self&);
//purposely not implemented
144
void
operator=(
const
Self&);
//purposely not implemented
145
146
147
148
149
};
150
151
}
// end namespace otb
152
153
#endif
Generated at Sun Jun 16 2013 00:46:50 for
Orfeo Toolbox
with
doxygen 1.8.3.1