OTB  9.0.0
Orfeo Toolbox
otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbSinclairToReciprocalCircularCovarianceMatrixImageFilter_h
22 #define otbSinclairToReciprocalCircularCovarianceMatrixImageFilter_h
23 
24 #include <complex>
26 
27 #include "otbFunctorImageFilter.h"
28 #include "otbPolarimetryTags.h"
29 
30 namespace otb
31 {
32 namespace Functor
33 {
67 template <class TInput1, class TInput2, class TInput3, class TOutput>
69 {
70 public:
72  typedef double RealType;
73  typedef std::complex<RealType> ComplexType;
74  typedef typename TOutput::ValueType OutputValueType;
76 
77  inline void operator()(TOutput& result, const TInput1& Shh, const TInput2& Shv, const TInput3& Svv) const
78  {
79  const ComplexType S_hh = static_cast<ComplexType>(Shh);
80  const ComplexType S_hv = static_cast<ComplexType>(Shv);
81  const ComplexType S_vv = static_cast<ComplexType>(Svv);
82 
83  const ComplexType coef(0.5);
84 
85  const ComplexType j2S_hv = S_hv * ComplexType(0.0, 2.0);
86  const ComplexType jS_hh = S_hh * ComplexType(0.0, 1.0);
87  const ComplexType jS_vv = S_vv * ComplexType(0.0, 1.0);
88 
89 
90  const ComplexType Sll = coef * (S_hh + j2S_hv - S_vv);
91  const ComplexType Slr = coef * (jS_hh + jS_vv);
92  const ComplexType Srr = coef * (-S_hh + j2S_hv + S_vv);
93 
94 
96  funct(result, Sll, Slr, Srr);
97  }
98 
99  constexpr size_t OutputSize(...) const
100  {
101  // Size of the matrix
102  return 6;
103  }
104 };
105 
106 } // namespace Functor
123 template <typename TInputImage, typename TOutputImage>
125  FunctorImageFilter<Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor<typename TInputImage::PixelType, typename TInputImage::PixelType,
126  typename TInputImage::PixelType, typename TOutputImage::PixelType>,
127  std::tuple<polarimetry_tags::hh, polarimetry_tags::hv_or_vh, polarimetry_tags::vv>>;
128 } // namespace otb
130 
131 #endif
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor::ComplexType
std::complex< RealType > ComplexType
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:73
otbFunctorImageFilter.h
otbSinclairToReciprocalCovarianceMatrixImageFilter.h
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor
Construct the fully reciprocal polarimetric circular covariance matrix with Sinclair matrix informati...
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:68
otb::Functor::SinclairToReciprocalCovarianceMatrixFunctor
Construct the reciprocal fully polarimetric covariance matrix with Sinclair matrix information.
Definition: otbSinclairToReciprocalCovarianceMatrixImageFilter.h:69
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor::OutputValueType
TOutput::ValueType OutputValueType
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:74
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor::OutputSize
constexpr vcl_size_t OutputSize(...) const
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:99
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor::SinclairToReciprocalCovarianceFunctorType
SinclairToReciprocalCovarianceMatrixFunctor< ComplexType, ComplexType, ComplexType, TOutput > SinclairToReciprocalCovarianceFunctorType
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:75
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor::RealType
double RealType
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:72
otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor::operator()
void operator()(TOutput &result, const TInput1 &Shh, const TInput2 &Shv, const TInput3 &Svv) const
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:77
otbPolarimetryTags.h
otb::SinclairToReciprocalCircularCovarianceMatrixImageFilter
FunctorImageFilter< Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor< typename TInputImage::PixelType, typename TInputImage::PixelType, typename TInputImage::PixelType, typename TOutputImage::PixelType >, std::tuple< polarimetry_tags::hh, polarimetry_tags::hv_or_vh, polarimetry_tags::vv > > SinclairToReciprocalCircularCovarianceMatrixImageFilter
Applies otb::Functor::SinclairToReciprocalCircularCovarianceMatrixFunctor.
Definition: otbSinclairToReciprocalCircularCovarianceMatrixImageFilter.h:127