OTB  6.7.0
Orfeo Toolbox
otbReciprocalPauliDecompImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 
22 #ifndef otbReciprocalPauliDecompImageFilter_h
23 #define otbReciprocalPauliDecompImageFilter_h
24 
25 #include "otbFunctorImageFilter.h"
26 
27 namespace otb
28  {
29 
30 namespace Functor {
31 
40 template< class TInput, class TOutput>
42 {
43 public:
44 
45  typedef typename TInput::ValueType InputValueType;
46  typedef typename TOutput::ValueType OutputValueType;
47 
48  inline void operator()(TOutput& result, const TInput& Sinclair) const
49  {
50  InputValueType sqrt2(std::sqrt(2.0),0.0);
51 
52  InputValueType Shh = static_cast<InputValueType>(Sinclair[0]);
53  InputValueType Shv = static_cast<InputValueType>(Sinclair[1]);
54  InputValueType Svv = static_cast<InputValueType>(Sinclair[2]);
55 
56  result[0] = (Shh+Svv)/sqrt2;
57  result[1] = (Shh-Svv)/sqrt2;
58  result[2] = sqrt2*Shv;
59  }
60 
61  constexpr size_t OutputSize(...) const
62  {
63  // Size of the result
64  return 3;
65  }
66 
67  private:
68  static constexpr double m_Epsilon = 1e-6;
69 };
70 } // namespace Functor
71 
84 template <typename TInputImage, typename TOutputImage>
87 
88 } // end namespace otb
89 
90 #endif
void operator()(TOutput &result, const TInput &Sinclair) const
Evaluate the Pauli decomposition from the reciprocal Sinclair matrix image.
A generic functor filter templated by its functor.