diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h index 54b09452370b7515fae6bd17076965ed62a61785..da67daeb39a877ee785ee7577d3e819f2baad6fc 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h @@ -91,7 +91,7 @@ public: const ComplexType jS_vh = S_vh * ComplexType(0., 1.); const ComplexType jS_hh = S_hh * ComplexType(0., 1.); const ComplexType jS_vv = S_vv * ComplexType(0., 1.); - + const ComplexType coef(0.5); const ComplexType Sll = coef*( S_hh+jS_hv+jS_vh-S_vv ); @@ -100,7 +100,7 @@ public: const ComplexType Srr = coef*( -S_hh+jS_hv+jS_vh+S_vv ); SinclairToCovarianceFunctorType funct; - return ( funct( Sll, Slr, Srl, Srr ) ); + funct( result, Sll, Slr, Srl, Srr ); } constexpr size_t OutputSize(...) const diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h index 6b6e75bb5307ff2cfbdfae8575e0170b27e1ff1f..6356266ab33091a04ecf637b3520df0555d3d67f 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCoherencyMatrixFunctor.h @@ -94,8 +94,6 @@ public: result[9] = static_cast<OutputValueType>( std::norm(jHVMinusVH) ); result /= 2.0; - - return (result); } constexpr size_t OutputSize(...) const diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h index 47f3ea3dfd5db4979480d05e751f5cd4da14531c..14ee5f74795509608d9e4385e174ff37d9da3de2 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCovarianceMatrixFunctor.h @@ -86,8 +86,6 @@ public: result[7] = static_cast<OutputValueType>( std::norm(S_vh) ); result[8] = static_cast<OutputValueType>( S_vh*std::conj(S_vv) ); result[9] = static_cast<OutputValueType>( std::norm(S_vv) ); - - return result; } constexpr size_t OutputSize(...) const diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h index fc21f3003206b02ac8d3bf36f459fe4b7c55c821..1744067128b761900641a938a6549672c7014a7b 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToMuellerMatrixFunctor.h @@ -118,8 +118,6 @@ public: result[13] = static_cast<OutputValueType>( (conjTxx*Tyx - conjTxy*Tyy).imag() ); result[14] = static_cast<OutputValueType>( (conjTxx*Tyy + conjTxy*Tyx).imag() ); result[15] = static_cast<OutputValueType>( (Txx*conjTyy - Txy*conjTyx).real() ); - - return (result); } constexpr size_t OutputSize(...) const diff --git a/Modules/Filtering/Polarimetry/test/otbMuellerToPolarisationDegreeAndPowerImageFilter.cxx b/Modules/Filtering/Polarimetry/test/otbMuellerToPolarisationDegreeAndPowerImageFilter.cxx index 694cb34e53d478cba5d600205bf1099ce94d8bf0..79d9276afc42ed5db1dc5387ba5a1b86a19e6d02 100644 --- a/Modules/Filtering/Polarimetry/test/otbMuellerToPolarisationDegreeAndPowerImageFilter.cxx +++ b/Modules/Filtering/Polarimetry/test/otbMuellerToPolarisationDegreeAndPowerImageFilter.cxx @@ -27,8 +27,6 @@ #include "otbImageFileReader.h" #include "otbImageFileWriter.h" #include "otbMuellerToPolarisationDegreeAndPowerImageFilter.h" -#include "otbSinclairImageFilter.h" -#include "otbSinclairToMuellerMatrixFunctor.h" int otbMuellerToPolarisationDegreeAndPowerImageFilter(int itkNotUsed(argc), char * argv[]) diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx index 115738e3b77335a47cd76939dff69484cab51a9a..097c6de39d4b8e6ed06831c2599349b0012f1316 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx @@ -31,7 +31,7 @@ int otbSinclairToCircularCovarianceMatrixFunctor(int itkNotUsed(argc), char * it OutputType result(10); FunctorType funct; - OutputType outputFunct; + OutputType outputFunct(10); result[0] = ComplexType( 32., 0. ); result[1] = ComplexType( 24., 0. ); @@ -44,7 +44,7 @@ int otbSinclairToCircularCovarianceMatrixFunctor(int itkNotUsed(argc), char * it result[8] = ComplexType( 4., 0. ); result[9] = ComplexType( 2, 0. ); - outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); + funct.operator ()( outputFunct, ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); if( std::abs(result[0]-outputFunct[0]) > 1e-10 || diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx index b4c0ac4f7e1aa0899e499f1cd4afc36ab7fb7063..a3f1b38fefc1a505543284d1905329cbe104704c 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCoherencyMatrixFunctor.cxx @@ -31,7 +31,7 @@ int otbSinclairToCoherencyMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed( OutputType result(10); FunctorType funct; - OutputType outputFunct; + OutputType outputFunct(10); result[0] = ComplexType(25., 0.); result[1] = ComplexType( 0., -15.); @@ -44,7 +44,7 @@ int otbSinclairToCoherencyMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed( result[8] = ComplexType(-5., 0.); result[9] = ComplexType( 1., 0.); - outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); + funct.operator ()( outputFunct, ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); if( std::abs(result[0]-outputFunct[0]) > 1e-10 || std::abs(result[1]-outputFunct[1]) > 1e-10 || diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx index 9de6d61a8ade01160c0dd66f2a846baf2a32b2c9..e83f250c1b2b8a915b1d21c736ea4ae00249ca4f 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCovarianceMatrixFunctor.cxx @@ -32,7 +32,7 @@ int otbSinclairToCovarianceMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed OutputType result(10); FunctorType funct; - OutputType outputFunct; + OutputType outputFunct(16); result[0] = ComplexType(17., 0. ); result[1] = ComplexType(14., 5.); @@ -45,8 +45,7 @@ int otbSinclairToCovarianceMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed result[8] = ComplexType(14., 5.); result[9] = ComplexType(17., 0.); - - outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); + funct.operator ()( outputFunct, ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); if( std::abs(result[0]-outputFunct[0]) > 1e-10 || std::abs(result[1]-outputFunct[1]) > 1e-10 || diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx index e70c4a416ef50acbfa9dd9cc3e25a7c182b9b7dc..6737094abde6ed4c9cdf56447be3661c3ce36733 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToMuellerMatrixFunctor.cxx @@ -32,7 +32,7 @@ int otbSinclairToMuellerMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed(ar OutputType result(16); FunctorType funct; - OutputType outputFunct; + OutputType outputFunct(16); result[0] = 30.; result[1] = 0.; @@ -51,7 +51,7 @@ int otbSinclairToMuellerMatrixFunctor(int itkNotUsed(argc), char * itkNotUsed(ar result[14] = 20.; result[15] = 4.; - outputFunct = funct.operator ()( ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); + funct.operator ()( outputFunct, ComplexType(1., 4.), ComplexType(2., 3.), ComplexType(3., 2.), ComplexType(4., 1.) ); if( std::abs(result[0]-outputFunct[0]) > 1e-10 || std::abs(result[1]-outputFunct[1]) > 1e-10 ||