22 #ifndef otbMuellerToPolarisationDegreeAndPowerImageFilter_h
23 #define otbMuellerToPolarisationDegreeAndPowerImageFilter_h
25 #include "itkNumericTraits.h"
26 #include "itkMatrix.h"
27 #include "itkVector.h"
83 template <
class TInput,
class TOutput>
91 inline void operator()(TOutput& result,
const TInput& Mueller)
const
100 double l_PowerMin(itk::NumericTraits<double>::max());
101 double l_PowerMax(itk::NumericTraits<double>::min());
102 double l_PolarisationDegreeMin(itk::NumericTraits<double>::max());
103 double l_PolarisationDegreeMax(itk::NumericTraits<double>::min());
106 muellerMatrix[0][0] = Mueller[0];
107 muellerMatrix[0][1] = Mueller[1];
108 muellerMatrix[0][2] = Mueller[2];
109 muellerMatrix[0][3] = Mueller[3];
110 muellerMatrix[1][0] = Mueller[4];
111 muellerMatrix[1][1] = Mueller[5];
112 muellerMatrix[1][2] = Mueller[6];
113 muellerMatrix[1][3] = Mueller[7];
114 muellerMatrix[2][0] = Mueller[8];
115 muellerMatrix[2][1] = Mueller[9];
116 muellerMatrix[2][2] = Mueller[10];
117 muellerMatrix[2][3] = Mueller[11];
118 muellerMatrix[3][0] = Mueller[12];
119 muellerMatrix[3][1] = Mueller[13];
120 muellerMatrix[3][2] = Mueller[14];
121 muellerMatrix[3][3] = Mueller[15];
136 Sr = muellerMatrix * Si;
147 deg_pol = std::sqrt(Sr[1] * Sr[1] + Sr[2] * Sr[2] + Sr[3] * Sr[3]) / Sr[0];
159 if (deg_pol > l_PolarisationDegreeMax)
161 l_PolarisationDegreeMax = deg_pol;
165 l_PolarisationDegreeMin = deg_pol;
172 result[0] = l_PowerMin;
173 result[1] = l_PowerMax;
174 result[2] = l_PolarisationDegreeMin;
175 result[3] = l_PolarisationDegreeMax;
202 template <
typename TInputImage,
typename TOutputImage>