Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
SARPolarimetry
otbPolarimetricSynthesisFunctor.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 __otbPolarimetricSynthesisFunctor_h
19
#define __otbPolarimetricSynthesisFunctor_h
20
21
#include "
otbMath.h
"
22
#include "vcl_complex.h"
23
#include "
itkFixedArray.h
"
24
25
namespace
otb
26
{
27
namespace
Functor
28
{
39
template
<
class
TInput1,
class
TInput2,
class
TInput3,
class
TInput4,
class
TOutput>
40
class
PolarimetricSynthesisFunctor
41
{
42
public
:
44
typedef
typename
std::complex <double>
ComplexType
;
45
typedef
typename
itk::FixedArray<ComplexType, 2>
ComplexArrayType
;
46
48
void
SetEi
(
ComplexArrayType
ei)
49
{
50
m_Ei
= ei;
51
}
52
54
void
SetEr
(
ComplexArrayType
er)
55
{
56
m_Er
= er;
57
}
58
60
PolarimetricSynthesisFunctor
()
61
{
62
m_Ei
.
Fill
(1);
63
m_Er
.
Fill
(1);
64
}
66
virtual
~PolarimetricSynthesisFunctor
() {}
67
inline
TOutput
operator ()
(
const
TInput1& Shh,
const
TInput2& Shv,
const
TInput3& Svh,
const
TInput4& Svv)
68
{
69
ComplexType
tmp;
70
double
scalar;
71
72
tmp = vcl_conj(
m_Er
[0]) * (
m_Ei
[0] *
static_cast<
ComplexType
>
(Shh) +
m_Ei
[1] * static_cast<ComplexType>(Shv))
73
+ vcl_conj(
m_Er
[1]) * (
m_Ei
[0] *
static_cast<
ComplexType
>
(Svh) +
m_Ei
[1] * static_cast<ComplexType>(Svv));
74
75
scalar =
static_cast<
double
>
(vcl_abs(tmp)) * static_cast<double>(vcl_abs(tmp));
76
77
return
(static_cast<TOutput>(scalar));
78
}
79
80
private
:
82
ComplexArrayType
m_Ei
;
84
ComplexArrayType
m_Er
;
85
86
};
87
88
}
// namespace Functor
89
}
// namespace otb
90
91
#endif
Generated at Sun Feb 3 2013 00:42:21 for
Orfeo Toolbox
with
doxygen 1.8.1.1