diff --git a/Examples/Projections/test/CMakeLists.txt b/Examples/Projections/test/CMakeLists.txt index 768d49630df27a20cf546cbf0dc2e9422ec8640a..61c9985d0c46901bb172ebd19613d7871e78a3cd 100644 --- a/Examples/Projections/test/CMakeLists.txt +++ b/Examples/Projections/test/CMakeLists.txt @@ -48,7 +48,7 @@ otb_add_test(NAME prTeVectorDataProjectionExampleTest COMMAND ${OTB_TEST_DRIVER} ${BASELINE}/vectorDataProjectionExample.shp ${TEMP}/vectorDataProjectionExample.shp Execute $<TARGET_FILE:VectorDataProjectionExample> - ${OTB_DATA_ROOT}/Examples/Capitole-Shadows.kml + ${OTB_DATA_ROOT}/Input/Capitole-Shadows.kml LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF} ${TEMP}/vectorDataProjectionExample.shp ) @@ -58,7 +58,7 @@ otb_add_test(NAME prTeGeometriesProjectionTest COMMAND ${OTB_TEST_DRIVER} ${BASELINE}/geometriesProjectionExample.shp ${TEMP}/geometriesProjectionExample.shp Execute $<TARGET_FILE:GeometriesProjectionExample> - ${OTB_DATA_ROOT}/Examples/Capitole-Shadows.shp + ${OTB_DATA_ROOT}/Input/Capitole-Shadows.shp LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF} ${TEMP}/geometriesProjectionExample.shp ) diff --git a/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.h b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.h new file mode 100644 index 0000000000000000000000000000000000000000..18f1465b0941b453bd5c9330dda92e2873f69d4f --- /dev/null +++ b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.h @@ -0,0 +1,92 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbNRIBandImagesToOneNComplexBandsImage_h +#define __otbNRIBandImagesToOneNComplexBandsImage_h + +#include "itkImageToImageFilter.h" +#include "itkImage.h" +#include "itkNumericTraits.h" + +/* + * Inputs : N images made of two real bands + * Output : one single image made of N complex bands + * + * */ + + +namespace otb +{ + + +template <class TInputImage, class TOutputImage> +class ITK_EXPORT NRIBandImagesToOneNComplexBandsImage : public itk::ImageToImageFilter<TInputImage, TOutputImage> +{ +public: + /** Extract input and output image dimension */ + itkStaticConstMacro(InputImageDimension, + unsigned int, + TInputImage::ImageDimension); + itkStaticConstMacro(OutputImageDimension, + unsigned int, + TOutputImage::ImageDimension); + + typedef TInputImage InputImageType; + typedef TOutputImage OutputImageType; + + /** standard class typedefs */ + typedef NRIBandImagesToOneNComplexBandsImage Self; + typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Object factory management */ + itkNewMacro(Self); + + /** typemacro */ + itkTypeMacro(NRIBandImagesToOneNComplexBandsImage, ImageToImageFilter); + + typedef typename InputImageType::PixelType InputPixelType; + typedef typename OutputImageType::PixelType OutputPixelType; + typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType; + typedef typename InputImageType::RegionType InputImageRegionType; + typedef typename OutputImageType::RegionType OutputImageRegionType; + + +protected: + NRIBandImagesToOneNComplexBandsImage(); + virtual ~NRIBandImagesToOneNComplexBandsImage() {} + void PrintSelf(std::ostream& os, itk::Indent indent) const; + + void GenerateOutputInformation(void); + void BeforeThreadedGenerateData(void); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, + itk::ThreadIdType threadId); + +private: + NRIBandImagesToOneNComplexBandsImage(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + + +}; +} // end namespace otb + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbNRIBandImagesToOneNComplexBandsImage.txx" +#endif + +#endif diff --git a/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.txx b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.txx new file mode 100644 index 0000000000000000000000000000000000000000..46abbf79efee49136fe17fc0be5d36e9e6ae13cf --- /dev/null +++ b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.txx @@ -0,0 +1,139 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbNRIBandImagesToOneNComplexBandsImage_txx +#define __otbNRIBandImagesToOneNComplexBandsImage_txx + +#include "otbNRIBandImagesToOneNComplexBandsImage.h" + +#include "itkImageRegionIterator.h" +#include "itkImageRegionConstIterator.h" +#include "itkProgressReporter.h" +#include "itkVariableLengthVector.h" + + + + +namespace otb +{ + +/** + * + */ +template <class TInputImage, class TOutputImage> +NRIBandImagesToOneNComplexBandsImage<TInputImage, TOutputImage>::NRIBandImagesToOneNComplexBandsImage() +{ + //this->SetNumberOfThreads(1); +} + +/** + * GenerateOutputInformation + */ +template<class TInputImage, class TOutputImage> +void +NRIBandImagesToOneNComplexBandsImage<TInputImage, TOutputImage> +::GenerateOutputInformation(void) +{ + Superclass::GenerateOutputInformation(); + + unsigned int nbInputs = this->GetNumberOfInputs(); + this->GetOutput()->SetNumberOfComponentsPerPixel(nbInputs); + +} + +/** + * BeforeThreadedGenerateData + */ +template <class TInputImage, class TOutputImage> +void +NRIBandImagesToOneNComplexBandsImage<TInputImage, TOutputImage> +::BeforeThreadedGenerateData(void) +{ + unsigned int nbInputs = this->GetNumberOfInputs(); + + for (unsigned int i=0; i<nbInputs; i++) + if (this->GetInput(i)->GetNumberOfComponentsPerPixel() != 2 ) + itkExceptionMacro("Input images must be made of two bands and only two (see input #" << i << ")."); + +} + +/** + * ThreadedGenerateData + */ +template<class TInputImage, class TOutputImage> +void NRIBandImagesToOneNComplexBandsImage<TInputImage, TOutputImage>::ThreadedGenerateData( + const OutputImageRegionType& outputRegionForThread, + itk::ThreadIdType threadId + ) +{ + + // support progress methods/callbacks + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + unsigned int nbInputs = this->GetNumberOfInputs(); + + itk::VariableLengthVector< std::complex< typename InputPixelType::ValueType > > vlv(nbInputs); + + std::vector< typename itk::ImageRegionConstIterator<TInputImage> > vInIt; + for (unsigned int i=0; i<nbInputs; i++) + vInIt.push_back( itk::ImageRegionConstIterator<TInputImage>(this->GetInput(i), outputRegionForThread) ); + + + itk::ImageRegionIterator<OutputImageType> outIt; + outIt = itk::ImageRegionIterator<OutputImageType>(this->GetOutput(), outputRegionForThread); + + for (unsigned int i=0; i<nbInputs; i++) + vInIt[i].GoToBegin(); + outIt.GoToBegin(); + + while (!outIt.IsAtEnd()) + { + + + for (unsigned int i=0; i<nbInputs; i++) + { + vlv[i] = std::complex< typename InputPixelType::ValueType >(vInIt[i].Get()[0],vInIt[i].Get()[1]); + //std::cout << "i = " << i << " " << vInIt[i].Get()[0] << " " << vInIt[i].Get()[1] << std::endl; + } + + + outIt.Set(vlv); + + //std::cout << "outIt.Get() = " << outIt.Get() << std::endl; + + for (unsigned int i=0; i<nbInputs; i++) + ++vInIt[i]; + ++outIt; + + progress.CompletedPixel(); + } + +} + +/** + * Standard "PrintSelf" method + */ +template <class TInputImage, class TOutput> +void +NRIBandImagesToOneNComplexBandsImage<TInputImage, TOutput>::PrintSelf(std::ostream& os, itk::Indent indent) const +{ + Superclass::PrintSelf(os, indent); +} + +} // end namespace otb + +#endif diff --git a/Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.h b/Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.h new file mode 100644 index 0000000000000000000000000000000000000000..745199721496ff2f6b9797cfa5e031ab3ec4ebde --- /dev/null +++ b/Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.h @@ -0,0 +1,91 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbOneRIBandImageToOneComplexBandImage_h +#define __otbOneRIBandImageToOneComplexBandImage_h + +#include "itkImageToImageFilter.h" +#include "itkImage.h" +#include "itkNumericTraits.h" + + +/* + * Inputs : one image made of two real bands + * Output : one image made of one complex band + * + * */ + +namespace otb +{ + + +template <class TInputImage, class TOutputImage> +class ITK_EXPORT OneRIBandImageToOneComplexBandImage : public itk::ImageToImageFilter<TInputImage, TOutputImage> +{ +public: + /** Extract input and output image dimension */ + itkStaticConstMacro(InputImageDimension, + unsigned int, + TInputImage::ImageDimension); + itkStaticConstMacro(OutputImageDimension, + unsigned int, + TOutputImage::ImageDimension); + + typedef TInputImage InputImageType; + typedef TOutputImage OutputImageType; + + /** standard class typedefs */ + typedef OneRIBandImageToOneComplexBandImage Self; + typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Object factory management */ + itkNewMacro(Self); + + /** typemacro */ + itkTypeMacro(OneRIBandImageToOneComplexBandImage, ImageToImageFilter); + + typedef typename InputImageType::PixelType InputPixelType; + typedef typename OutputImageType::PixelType OutputPixelType; + typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType; + typedef typename InputImageType::RegionType InputImageRegionType; + typedef typename OutputImageType::RegionType OutputImageRegionType; + + +protected: + OneRIBandImageToOneComplexBandImage(); + virtual ~OneRIBandImageToOneComplexBandImage() {} + void PrintSelf(std::ostream& os, itk::Indent indent) const; + + void BeforeThreadedGenerateData(void); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, + itk::ThreadIdType threadId); + +private: + OneRIBandImageToOneComplexBandImage(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + + +}; +} // end namespace otb + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbOneRIBandImageToOneComplexBandImage.txx" +#endif + +#endif diff --git a/Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.txx b/Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.txx new file mode 100644 index 0000000000000000000000000000000000000000..8a7003a8eec8066ed212245a9ff0162310f38499 --- /dev/null +++ b/Modules/Filtering/ImageManipulation/include/otbOneRIBandImageToOneComplexBandImage.txx @@ -0,0 +1,100 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbOneRIBandImageToOneComplexBandImage_txx +#define __otbOneRIBandImageToOneComplexBandImage_txx + +#include "otbOneRIBandImageToOneComplexBandImage.h" + +#include "itkImageRegionIterator.h" +#include "itkImageRegionConstIterator.h" +#include "itkProgressReporter.h" + +namespace otb +{ + +/** + * + */ +template <class TInputImage, class TOutputImage> +OneRIBandImageToOneComplexBandImage<TInputImage, TOutputImage>::OneRIBandImageToOneComplexBandImage() +{ + //this->SetNumberOfThreads(1); +} + +/** + * BeforeThreadedGenerateData + */ +template <class TInputImage, class TOutputImage> +void +OneRIBandImageToOneComplexBandImage<TInputImage, TOutputImage> +::BeforeThreadedGenerateData(void) +{ + if (this->GetInput()->GetNumberOfComponentsPerPixel() != 2 ) + itkExceptionMacro("Input image must be made of two bands and only two."); + +} + +/** + * ThreadedGenerateData + */ +template<class TInputImage, class TOutputImage> +void OneRIBandImageToOneComplexBandImage<TInputImage, TOutputImage>::ThreadedGenerateData( + const OutputImageRegionType& outputRegionForThread, + itk::ThreadIdType threadId + ) +{ + + // support progress methods/callbacks + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + typename OutputImageType::Pointer output = this->GetOutput(); + typename InputImageType::ConstPointer input = this->GetInput(); + + itk::ImageRegionIterator<OutputImageType> it; + itk::ImageRegionConstIterator<TInputImage> itIn; + + itIn = itk::ImageRegionConstIterator<TInputImage>(input, outputRegionForThread); + it = itk::ImageRegionIterator<OutputImageType>(output, outputRegionForThread); + + it.GoToBegin(); + itIn.GoToBegin(); + while (!it.IsAtEnd()) + { + + it.Set(static_cast<OutputPixelType>( std::complex< typename InputPixelType::ValueType >(itIn.Get()[0],itIn.Get()[1]) )); + + ++it; + ++itIn; + progress.CompletedPixel(); + } + +} + +/** + * Standard "PrintSelf" method + */ +template <class TInputImage, class TOutput> +void +OneRIBandImageToOneComplexBandImage<TInputImage, TOutput>::PrintSelf(std::ostream& os, itk::Indent indent) const +{ + Superclass::PrintSelf(os, indent); +} + +} // end namespace otb + +#endif diff --git a/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.h b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.h new file mode 100644 index 0000000000000000000000000000000000000000..e60a091176e80ff21ba52c3156aa2ba0413b3a13 --- /dev/null +++ b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.h @@ -0,0 +1,92 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbTwoNRIBandsImageToNComplexBandsImage_h +#define __otbTwoNRIBandsImageToNComplexBandsImage_h + +#include "itkImageToImageFilter.h" +#include "itkImage.h" +#include "itkNumericTraits.h" + +/* + * Inputs : one single image made of 2N real bands + * Output : one single image made of N complex bands + * + * */ + + +namespace otb +{ + + +template <class TInputImage, class TOutputImage> +class ITK_EXPORT TwoNRIBandsImageToNComplexBandsImage : public itk::ImageToImageFilter<TInputImage, TOutputImage> +{ +public: + /** Extract input and output image dimension */ + itkStaticConstMacro(InputImageDimension, + unsigned int, + TInputImage::ImageDimension); + itkStaticConstMacro(OutputImageDimension, + unsigned int, + TOutputImage::ImageDimension); + + typedef TInputImage InputImageType; + typedef TOutputImage OutputImageType; + + /** standard class typedefs */ + typedef TwoNRIBandsImageToNComplexBandsImage Self; + typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Object factory management */ + itkNewMacro(Self); + + /** typemacro */ + itkTypeMacro(TwoNRIBandsImageToNComplexBandsImage, ImageToImageFilter); + + typedef typename InputImageType::PixelType InputPixelType; + typedef typename OutputImageType::PixelType OutputPixelType; + typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType; + typedef typename InputImageType::RegionType InputImageRegionType; + typedef typename OutputImageType::RegionType OutputImageRegionType; + + +protected: + TwoNRIBandsImageToNComplexBandsImage(); + virtual ~TwoNRIBandsImageToNComplexBandsImage() {} + void PrintSelf(std::ostream& os, itk::Indent indent) const; + + void GenerateOutputInformation(void); + void BeforeThreadedGenerateData(void); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, + itk::ThreadIdType threadId); + +private: + TwoNRIBandsImageToNComplexBandsImage(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + + +}; +} // end namespace otb + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbTwoNRIBandsImageToNComplexBandsImage.txx" +#endif + +#endif diff --git a/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.txx b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.txx new file mode 100644 index 0000000000000000000000000000000000000000..c61f07a9009b4fe2365f926e55c1a9c4111b27fa --- /dev/null +++ b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.txx @@ -0,0 +1,143 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbTwoNRIBandsImageToNComplexBandsImage_txx +#define __otbTwoNRIBandsImageToNComplexBandsImage_txx + +#include "otbTwoNRIBandsImageToNComplexBandsImage.h" + +#include "itkImageRegionIterator.h" +#include "itkImageRegionConstIterator.h" +#include "itkProgressReporter.h" +#include "itkVariableLengthVector.h" + + + + +namespace otb +{ + +/** + * + */ +template <class TInputImage, class TOutputImage> +TwoNRIBandsImageToNComplexBandsImage<TInputImage, TOutputImage>::TwoNRIBandsImageToNComplexBandsImage() +{ + //this->SetNumberOfThreads(1); +} + +/** + * GenerateOutputInformation + */ +template<class TInputImage, class TOutputImage> +void +TwoNRIBandsImageToNComplexBandsImage<TInputImage, TOutputImage> +::GenerateOutputInformation(void) +{ + Superclass::GenerateOutputInformation(); + + unsigned int nbCompo = this->GetInput()->GetNumberOfComponentsPerPixel(); + + if ( (nbCompo % 2) != 0 ) + { + itkExceptionMacro("Number of bands of the input images must be an even number"); + } + else + this->GetOutput()->SetNumberOfComponentsPerPixel(nbCompo/2); + + std::cout << "GenerateOutputInformation : " << this->GetOutput()->GetNumberOfComponentsPerPixel() << std::endl; + +} + +/** + * BeforeThreadedGenerateData + */ +template <class TInputImage, class TOutputImage> +void +TwoNRIBandsImageToNComplexBandsImage<TInputImage, TOutputImage> +::BeforeThreadedGenerateData(void) +{ + unsigned int nbCompo = this->GetInput()->GetNumberOfComponentsPerPixel(); + + if ( (nbCompo % 2) != 0 ) + itkExceptionMacro("Number of bands of the input images must be an even number"); + +} + +/** + * ThreadedGenerateData + */ +template<class TInputImage, class TOutputImage> +void TwoNRIBandsImageToNComplexBandsImage<TInputImage, TOutputImage>::ThreadedGenerateData( + const OutputImageRegionType& outputRegionForThread, + itk::ThreadIdType threadId + ) +{ + + unsigned int nbCompo = this->GetInput()->GetNumberOfComponentsPerPixel(); + + itk::VariableLengthVector< std::complex< typename InputPixelType::ValueType > > vlv(nbCompo/2); + + + // support progress methods/callbacks + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + itk::ImageRegionConstIterator<TInputImage> inIt; + inIt = itk::ImageRegionConstIterator<TInputImage>(this->GetInput(), outputRegionForThread); + + itk::ImageRegionIterator<OutputImageType> outIt; + outIt = itk::ImageRegionIterator<OutputImageType>(this->GetOutput(), outputRegionForThread); + + + inIt.GoToBegin(); + outIt.GoToBegin(); + + while (!outIt.IsAtEnd()) + { + + unsigned int k=0; + for (unsigned int i=0; i<nbCompo-1; i=i+2) + { + vlv[k] = std::complex< typename InputPixelType::ValueType >(inIt.Get()[i],inIt.Get()[i+1]); + k++; + } + + + outIt.Set(vlv); + + + ++inIt; + ++outIt; + + progress.CompletedPixel(); + } + +} + +/** + * Standard "PrintSelf" method + */ +template <class TInputImage, class TOutput> +void +TwoNRIBandsImageToNComplexBandsImage<TInputImage, TOutput>::PrintSelf(std::ostream& os, itk::Indent indent) const +{ + Superclass::PrintSelf(os, indent); +} + +} // end namespace otb + +#endif diff --git a/Modules/Filtering/ImageManipulation/test/CMakeLists.txt b/Modules/Filtering/ImageManipulation/test/CMakeLists.txt index 6b26881e637a74650b8cf1d74cf5c2779c7e9cf6..86e9cd72c67dca156fc4fd293c9b220ff186fc21 100644 --- a/Modules/Filtering/ImageManipulation/test/CMakeLists.txt +++ b/Modules/Filtering/ImageManipulation/test/CMakeLists.txt @@ -70,6 +70,9 @@ otbSpectralAngleDistanceImageFilter.cxx otbFunctionWithNeighborhoodToImageFilterNew.cxx otbEuclideanDistanceMetricWithMissingValue.cxx otbEuclideanDistanceMetricWithMissingValueNew.cxx +otbNRIBandImagesToOneNComplexBandsImage.cxx +otbOneRIBandImageToOneComplexBandImage.cxx +otbTwoNRIBandsImageToNComplexBandsImage.cxx otbChangeNoDataValueFilter.cxx otbImageToNoDataMaskFilter.cxx ) @@ -672,6 +675,36 @@ otb_add_test(NAME bfTvEuclideanDistanceMetricWithMissingValue COMMAND otbImageMa otb_add_test(NAME bfTuEuclideanDistanceMetricWithMissingValueNew COMMAND otbImageManipulationTestDriver otbEuclideanDistanceMetricWithMissingValueNew) +otb_add_test(NAME bfTvTwoNRIBandsImageToNComplexBandsImage COMMAND otbImageManipulationTestDriver + --compare-image ${EPSILON_7} + ${BASELINE}/bfTvNRIBandImagesToOneNComplexBandsImage.tif + ${TEMP}/bfTvTwoNRIBandsImageToNComplexBandsImage.tif + otbTwoNRIBandsImageToNComplexBandsImage + ${INPUTDATA}/RSAT_imagery_HH_HV_VV.tif + ${TEMP}/bfTvTwoNRIBandsImageToNComplexBandsImage.tif + ) + + +otb_add_test(NAME bfTvNRIBandImagesToOneNComplexBandsImage COMMAND otbImageManipulationTestDriver + --compare-image ${EPSILON_7} + ${BASELINE}/bfTvNRIBandImagesToOneNComplexBandsImage.tif + ${TEMP}/bfTvNRIBandImagesToOneNComplexBandsImage.tif + otbNRIBandImagesToOneNComplexBandsImage + ${INPUTDATA}/RSAT_imagery_HH.tif + ${INPUTDATA}/RSAT_imagery_HV.tif + ${INPUTDATA}/RSAT_imagery_VV.tif + ${TEMP}/bfTvNRIBandImagesToOneNComplexBandsImage.tif + ) + +otb_add_test(NAME bfTvOneRIBandImageToOneComplexBandImage COMMAND otbImageManipulationTestDriver + --compare-image ${EPSILON_3} + ${INPUTDATA}/RSAT_imageryC_HH.tif + ${TEMP}/bfTvOneRIBandImageToOneComplexBandImage.tif + otbOneRIBandImageToOneComplexBandImage + ${INPUTDATA}/RSAT_imagery_HH.tif + ${TEMP}/bfTvOneRIBandImageToOneComplexBandImage.tif + ) + otb_add_test(NAME filteringImageManipulationChangeNoDataValueFilter COMMAND otbImageManipulationTestDriver otbChangeNoDataValueFilter) diff --git a/Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx b/Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx index 5fd89db0d90a1a5f1ba324abde1dd9a236884324..f732d0d2a493a927ccfd34f1f5633d85b3508cf3 100644 --- a/Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx +++ b/Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx @@ -76,6 +76,9 @@ void RegisterTests() REGISTER_TEST(otbFunctionWithNeighborhoodToImageFilterNew); REGISTER_TEST(otbEuclideanDistanceMetricWithMissingValue); REGISTER_TEST(otbEuclideanDistanceMetricWithMissingValueNew); + REGISTER_TEST(otbNRIBandImagesToOneNComplexBandsImage); + REGISTER_TEST(otbOneRIBandImageToOneComplexBandImage); + REGISTER_TEST(otbTwoNRIBandsImageToNComplexBandsImage); REGISTER_TEST(otbChangeNoDataValueFilter); REGISTER_TEST(otbImageToNoDataMaskFilter); } diff --git a/Modules/Filtering/ImageManipulation/test/otbNRIBandImagesToOneNComplexBandsImage.cxx b/Modules/Filtering/ImageManipulation/test/otbNRIBandImagesToOneNComplexBandsImage.cxx new file mode 100644 index 0000000000000000000000000000000000000000..778f42146ea0b8ddd85ef72a63e121cf245d15c1 --- /dev/null +++ b/Modules/Filtering/ImageManipulation/test/otbNRIBandImagesToOneNComplexBandsImage.cxx @@ -0,0 +1,62 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "itkMacro.h" + +#include "otbNRIBandImagesToOneNComplexBandsImage.h" + +#include "otbImage.h" +#include "otbVectorImage.h" +#include "otbImageFileReader.h" +#include "otbImageFileWriter.h" + +int otbNRIBandImagesToOneNComplexBandsImage(int itkNotUsed(argc), char * argv[]) +{ + + typedef double PixelType; + typedef otb::VectorImage<PixelType, 2> InputImageType; + + typedef std::complex<double> OutputPixelType; + typedef otb::VectorImage<OutputPixelType, 2> OutputImageType; + + + typedef otb::NRIBandImagesToOneNComplexBandsImage<InputImageType, OutputImageType> FilterType; + typedef otb::ImageFileReader<InputImageType> ReaderType; + typedef otb::ImageFileWriter<OutputImageType> WriterType; + + ReaderType::Pointer readerA = ReaderType::New(); + ReaderType::Pointer readerB = ReaderType::New(); + ReaderType::Pointer readerC = ReaderType::New(); + FilterType::Pointer filter = FilterType::New(); + WriterType::Pointer writer = WriterType::New(); + + + readerA->SetFileName(argv[1]); + readerB->SetFileName(argv[2]); + readerC->SetFileName(argv[3]); + writer->SetFileName(argv[4]); + + filter->SetInput(0,readerA->GetOutput()); + filter->SetInput(1,readerB->GetOutput()); + filter->SetInput(2,readerC->GetOutput()); + writer->SetInput(filter->GetOutput()); + writer->Update(); + + + + return EXIT_SUCCESS; +} diff --git a/Modules/Filtering/ImageManipulation/test/otbOneRIBandImageToOneComplexBandImage.cxx b/Modules/Filtering/ImageManipulation/test/otbOneRIBandImageToOneComplexBandImage.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bbc4682269f0f3b7ea6f3bc3243810dd80d3099f --- /dev/null +++ b/Modules/Filtering/ImageManipulation/test/otbOneRIBandImageToOneComplexBandImage.cxx @@ -0,0 +1,56 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "itkMacro.h" + +#include "otbOneRIBandImageToOneComplexBandImage.h" + +#include "otbImage.h" +#include "otbVectorImage.h" +#include "otbImageFileReader.h" +#include "otbImageFileWriter.h" + +int otbOneRIBandImageToOneComplexBandImage(int itkNotUsed(argc), char * argv[]) +{ + + typedef double PixelType; + typedef otb::VectorImage<PixelType, 2> InputImageType; + + typedef std::complex<double> OutputPixelType; + typedef otb::Image<OutputPixelType, 2> OutputImageType; + + + typedef otb::OneRIBandImageToOneComplexBandImage<InputImageType, OutputImageType> FilterType; + typedef otb::ImageFileReader<InputImageType> ReaderType; + typedef otb::ImageFileWriter<OutputImageType> WriterType; + + ReaderType::Pointer reader = ReaderType::New(); + FilterType::Pointer filter = FilterType::New(); + WriterType::Pointer writer = WriterType::New(); + + + reader->SetFileName(argv[1]); + writer->SetFileName(argv[2]); + + filter->SetInput(reader->GetOutput()); + writer->SetInput(filter->GetOutput()); + writer->Update(); + + + + return EXIT_SUCCESS; +} diff --git a/Modules/Filtering/ImageManipulation/test/otbTwoNRIBandsImageToNComplexBandsImage.cxx b/Modules/Filtering/ImageManipulation/test/otbTwoNRIBandsImageToNComplexBandsImage.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b4fed1963178ae79497fcdc18161b99261205dbc --- /dev/null +++ b/Modules/Filtering/ImageManipulation/test/otbTwoNRIBandsImageToNComplexBandsImage.cxx @@ -0,0 +1,56 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "itkMacro.h" + +#include "otbTwoNRIBandsImageToNComplexBandsImage.h" + +#include "otbImage.h" +#include "otbVectorImage.h" +#include "otbImageFileReader.h" +#include "otbImageFileWriter.h" + +int otbTwoNRIBandsImageToNComplexBandsImage(int itkNotUsed(argc), char * argv[]) +{ + + typedef double PixelType; + typedef otb::VectorImage<PixelType, 2> InputImageType; + + typedef std::complex<double> OutputPixelType; + typedef otb::VectorImage<OutputPixelType, 2> OutputImageType; + + + typedef otb::TwoNRIBandsImageToNComplexBandsImage<InputImageType, OutputImageType> FilterType; + typedef otb::ImageFileReader<InputImageType> ReaderType; + typedef otb::ImageFileWriter<OutputImageType> WriterType; + + ReaderType::Pointer reader = ReaderType::New(); + FilterType::Pointer filter = FilterType::New(); + WriterType::Pointer writer = WriterType::New(); + + + reader->SetFileName(argv[1]); + writer->SetFileName(argv[2]); + + filter->SetInput(0,reader->GetOutput()); + writer->SetInput(filter->GetOutput()); + writer->Update(); + + + + return EXIT_SUCCESS; +} diff --git a/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h b/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h index 60ac764e19540673a78c634c2e0220a116b72b81..0aa2d8665815ca14c7005fd99fc32eb9f3532b64 100644 --- a/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbMuellerToReciprocalCovarianceImageFilter.h @@ -79,25 +79,13 @@ public: const double M12 = static_cast<double>(Mueller[1]); const double M13 = static_cast<double>(Mueller[2]); const double M14 = static_cast<double>(Mueller[3]); - //const double M21 = static_cast<double>(Mueller[4]); const double M22 = static_cast<double>(Mueller[5]); const double M23 = static_cast<double>(Mueller[6]); const double M24 = static_cast<double>(Mueller[7]); - //const double M31 = static_cast<double>(Mueller[8]); - //const double M32 = static_cast<double>(Mueller[9]); const double M33 = static_cast<double>(Mueller[10]); const double M34 = static_cast<double>(Mueller[11]); - //const double M41 = static_cast<double>(Mueller[12]); - //const double M42 = static_cast<double>(Mueller[13]); - //const double M43 = static_cast<double>(Mueller[14]); const double M44 = static_cast<double>(Mueller[15]); - /*const ComplexType hhhh(M11+M22+M12+M21, 0.0); - const ComplexType hvhv(M11+M12-M21-M22, 0.0); - const ComplexType vvvv(M11+M22-M12-M21, 0.0); - const ComplexType hhhv(M13+M23, M14+M24); - const ComplexType hhvv(-M33-M44, M43-M34); - const ComplexType hvvv(M32-M31, M41-M42);*/ const ComplexType A(0.5*(M11+M22+2*M12)); const ComplexType B(0.5*vcl_sqrt(2.0)*(M13+M23), 0.5*vcl_sqrt(2.0)*(M14+M24)); diff --git a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.txx b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.txx index d465a986214b438a1ad706d0ae208eaa9770d064..e5539846c767445733336cd7952e937a42f6e60f 100644 --- a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.txx +++ b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.txx @@ -40,6 +40,7 @@ MultiChannelsPolarimetricSynthesisFilter<TInputImage, TOutputImage, TFunction> SetEmissionH(false); SetEmissionV(false); SetGain(1); + SetMode(0); m_ArchitectureType = PolarimetricData::New(); } diff --git a/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h b/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h index 1081c263d908c91f7411bbadcc837b028aa0275d..a025d9c337a32c5865a964452bba75a247bb0373 100644 --- a/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h +++ b/Modules/Filtering/Polarimetry/include/otbReciprocalCoherencyToReciprocalMuellerImageFilter.h @@ -30,26 +30,36 @@ namespace Functor { * \brief Evaluate the reciprocal Mueller matrix from the reciprocal coherency matrix image * * Outpus are: - * - channel #0 : \f$ 0.5*\mathcal{Re}( Coherency[0]+Coherency[3]+Coherency[5]) \f$ - * - channel #1 : \f$ 0.5*\mathcal{Re}( Coherency[0]+Coherency[3]-Coherency[5]) \f$ - * - channel #2 : \f$ 0.5*\mathcal{Re}( Coherency[0]-Coherency[3]+Coherency[5]) \f$ - * - channel #3 : \f$ 0.5*\mathcal{Re}(-Coherency[0]+Coherency[3]+Coherency[5]) \f$ - * - channel #4 : \f$ \mathcal{Re}(Coherency[1]) \f$ - * - channel #5 : \f$ \mathcal{Re}(Coherency[2]) \f$ - * - channel #6 : \f$ \mathcal{Im}(Coherency[4]) \f$ - * - channel #7 : \f$ \mathcal{Re}(Coherency[4]) \f$ - * - channel #8 : \f$ \mathcal{Im}(Coherency[2]) \f$ - * - channel #9 : \f$ \mathcal{Im}(Coherency[1]) \f$ + * - channel #0 : \f$ 0.5*( C_{11}+C_{22}+C_{33} ) \f$ + * - channel #1 : \f$ Re(C_{12}) + Im(C_{22}) \f$ + * - channel #2 : \f$ Re(C_{13}) \f$ + * - channel #3 : \f$ Im(C_{23}) \f$ + * - channel #4 : \f$ Re(C_{12}) \f$ + * - channel #5 : \f$ 0.5*( C_{11}+C_{22}-C_{33} ) \f$ + * - channel #6 : \f$ Re(C_{23}) \f$ + * - channel #7 : \f$ Im(C_{13}) \f$ + * - channel #8 : \f$ -Re(C_{13}) \f$ + * - channel #9 : \f$ -Re(C_{23}) \f$ + * - channel #10 : \f$ 0.5.Re(VAL1) \f$ + * - channel #11 : \f$ 0.5.Im(VAL0) \f$ + * - channel #12 : \f$ Im(C_{23}) \f$ + * - channel #13 : \f$ Im(C_{13}) \f$ + * - channel #14 : \f$ 0.5.Im(VAL1^{*}) \f$ + * - channel #15 : \f$ 0.5.Re(VAL0) \f$ * + * With: + * VAL0 = C_{33}+C_{12}-C_{11}-(C_{12}-C_{22})^{*} + * VAL1 = -C_{33}+C_{12}-C_{11}-(C_{12}-C_{22})^{*} + * * Where Coherency is the input pixel and contains: - * - channel #0 : \f$ (S_{hh}+S_{vv}).(S_{hh}+S_{vv})^{*} \f$ - * - channel #1 : \f$ (S_{hh}+S_{vv}).(S_{hh}-S_{vv})^{*} \f$ - * - channel #2 : \f$ (S_{hh}+S_{vv}).(2*S_{hv})^{*} \f$ - * - channel #3 : \f$ (S_{hh}-S_{vv}).(S_{hh}-S_{vv})^{*} \f$ - * - channel #4 : \f$ (S_{hh}-S_{vv}).(2*S_{hv})^{*} \f$ - * - channel #5 : \f$ (2*S_{hv}).(2*S_{hv})^{*} \f$ + * - channel #0 : \f$ 0.5*(S_{hh}+S_{vv}).(S_{hh}+S_{vv})^{*} \f$ + * - channel #1 : \f$ 0.5*(S_{hh}+S_{vv}).(S_{hh}-S_{vv})^{*} \f$ + * - channel #2 : \f$ 0.5*(S_{hh}+S_{vv}).(2*S_{hv})^{*} \f$ + * - channel #3 : \f$ 0.5*(S_{hh}-S_{vv}).(S_{hh}-S_{vv})^{*} \f$ + * - channel #4 : \f$ 0.5*(S_{hh}-S_{vv}).(2*S_{hv})^{*} \f$ + * - channel #5 : \f$ 0.5*(2*S_{hv}).(2*S_{hv})^{*} \f$ * - * The output pixel has 10 channels : the diagonal and the upper element of the matrix. + * The output pixel has 16 channels * Element are stored from left to right, line by line. * * \ingroup SARPolarimetry @@ -72,17 +82,28 @@ public: const double T1 = static_cast<double>(Coherency[0].real()); const double T2 = static_cast<double>(Coherency[3].real()); const double T3 = static_cast<double>(Coherency[5].real()); - - result[0] = 0.5*(T1+T2+T3); // A0+B0 - result[1] = 0.5*(T1+T2-T3); // A0+B - result[2] = 0.5*(T1-T2+T3); // A0-B - result[3] = 0.5*(-T1+T2+T3); // -A0+B0 - result[4] = static_cast<double>( Coherency[1].real() ); // C - result[5] = static_cast<double>( Coherency[2].real() ); // H - result[6] = static_cast<double>( Coherency[4].imag() ); // F - result[7] = static_cast<double>( Coherency[4].real() ); // E - result[8] = static_cast<double>( Coherency[2].imag() ); // G - result[9] = -static_cast<double>( Coherency[1].imag() ); // D + + ComplexType VAL4 = static_cast<ComplexType>( (Coherency[1] - Coherency[3]) ); + ComplexType VAL5 = static_cast<ComplexType>( (Coherency[1] - Coherency[0]) ); + ComplexType VAL0 = static_cast<ComplexType>( Coherency[5] ) + VAL5 - vcl_conj(VAL4); + ComplexType VAL1 = static_cast<ComplexType>( -Coherency[5] ) + VAL5 - vcl_conj(VAL4); + + result[0] = 0.5*(T1+T2+T3); + result[1] = static_cast<double>( Coherency[1].real()+Coherency[3].imag() ); + result[2] = static_cast<double>( Coherency[2].real() ); + result[3] = static_cast<double>( Coherency[4].imag() ); + result[4] = static_cast<double>( Coherency[1].real() ); + result[5] = 0.5*(T1+T2-T3); + result[6] = static_cast<double>( Coherency[4].real() ); + result[7] = static_cast<double>( Coherency[2].imag() ); + result[8] = static_cast<double>( -Coherency[2].real() ); + result[9] = static_cast<double>( -Coherency[4].real() ); + result[10] = static_cast<double>( 0.5*VAL1.real() ); + result[11] = static_cast<double>( 0.5*VAL0.imag() ); + result[12] = static_cast<double>( Coherency[4].imag() ); + result[13] = static_cast<double>( Coherency[2].imag() ); + result[14] = static_cast<double>( 0.5*vcl_conj(VAL1).imag() ); + result[15] = static_cast<double>( 0.5*VAL0.real() ); return result; } @@ -99,7 +120,7 @@ public: virtual ~ReciprocalCoherencyToReciprocalMuellerFunctor() {} private: - itkStaticConstMacro(NumberOfComponentsPerPixel, unsigned int, 10); + itkStaticConstMacro(NumberOfComponentsPerPixel, unsigned int, 16); }; } diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h b/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h index c3d4f81404863d17f6b9bcd8ae54354d2b35d4eb..08e10da87a53b51cbd79ae565c598240911c4965 100644 --- a/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h +++ b/Modules/Filtering/Polarimetry/include/otbSinclairToCircularCovarianceMatrixFunctor.h @@ -42,9 +42,9 @@ namespace Functor * - channel #9 : \f$ S_{rr}.S_{rr}^{*} \f$ * * With: - * - \f$ S_{ll} = 0.5 * (-S_{hh}-i*S_{hv}-i*S_{vh}+S_{vv}) \f$ - * - \f$ S_{lr} = 0.5 * (-S_{hh}+i*S_{hv}-i*S_{vh}+S_{vv}) \f$ - * - \f$ S_{rl} = 0.5 * (-S_{hh}-i*S_{hv}+i*S_{vh}-S_{vv}) \f$ + * - \f$ S_{ll} = 0.5 * (S_{hh}+i*S_{hv}+i*S_{vh}-S_{vv}) \f$ + * - \f$ S_{lr} = 0.5 * (i*S_{hh}+S_{hv}-S_{vh}+i*S_{vv}) \f$ + * - \f$ S_{rl} = 0.5 * (i*S_{hh}-S_{hv}+S_{vh}+i*S_{vv}) \f$ * - \f$ S_{rr} = 0.5 * (-S_{hh}+i*S_{hv}+i*S_{vh}+S_{vv}) \f$ * * Extract from Antennas for radar and communications Harold Mott p 317. @@ -89,12 +89,14 @@ public: result.SetSize(m_NumberOfComponentsPerPixel); const ComplexType jS_hv = S_hv * ComplexType(0., 1.); 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 ); - const ComplexType Slr = coef*( -S_hh+jS_hv-jS_vh-S_vv ); - const ComplexType Srl = coef*( -S_hh-jS_hv+jS_vh-S_vv ); + const ComplexType Sll = coef*( S_hh+jS_hv+jS_vh-S_vv ); + const ComplexType Slr = coef*( jS_hh+S_hv-S_vh+jS_vv ); + const ComplexType Srl = coef*( jS_hh-S_hv+S_vh+jS_vv ); const ComplexType Srr = coef*( -S_hh+jS_hv+jS_vh+S_vv ); //const ComplexType conjSll = vcl_conj(Sll); diff --git a/Modules/Filtering/Polarimetry/test/CMakeLists.txt b/Modules/Filtering/Polarimetry/test/CMakeLists.txt index d363743204c2e04c92d2f4976e57d1549f128474..c3825403977252f806d4e27ec4fa085eefcdbb5e 100644 --- a/Modules/Filtering/Polarimetry/test/CMakeLists.txt +++ b/Modules/Filtering/Polarimetry/test/CMakeLists.txt @@ -299,7 +299,7 @@ otb_add_test(NAME saTvReciprocalLinearCovarianceToReciprocalCircularCovarianceIm ) otb_add_test(NAME saTvReciprocalCoherencyToReciprocalMuellerImageFilter COMMAND otbPolarimetryTestDriver - --compare-image ${EPSILON_12} ${BASELINE}/saTvReciprocalCoherencyToMuellerImageFilter.tif + --compare-image ${EPSILON_12} ${BASELINE}/saTvSinclairImageFilter_SinclairToMueller.tif ${TEMP}/saTvReciprocalCoherencyToMuellerImageFilter.tif otbReciprocalCoherencyToReciprocalMuellerImageFilter ${BASELINE}/saTvSinclairImageFilter_SinclairToReciprocalCoherency.tif diff --git a/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx index 925cfdb9dfc83ec55647c9037a11d7480bf84395..db596e64ebcca9b864e8e457e095775a9fd8fdde 100644 --- a/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbMuellerToReciprocalCovarianceFunctor.cxx @@ -68,7 +68,6 @@ int otbMuellerToReciprocalCovarianceFunctor(int itkNotUsed(argc), char * itkNotU vcl_abs(result[5].imag()-outputFunct[5].imag()) > 1e-10 ) { - std::cout.precision(15); std::cout<<"Test gives :"<<std::endl; std::cout<<outputFunct<<std::endl; std::cout<<"Wanted results are :"<<std::endl; diff --git a/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx b/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx index c883bdef933ac1ec90774d660e887c80d54bf66a..030cc9b5d4fdcecd6a6bacd7530423a2cde0baed 100644 --- a/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx +++ b/Modules/Filtering/Polarimetry/test/otbSinclairToCircularCovarianceMatrixFunctor.cxx @@ -31,14 +31,14 @@ int otbSinclairToCircularCovarianceMatrixFunctor(int itkNotUsed(argc), char * it OutputType outputFunct; result[0] = ComplexType( 32., 0. ); - result[1] = ComplexType( 0., 24. ); - result[2] = ComplexType( 0., 16.); - result[3] = ComplexType( -8., 0 ); + result[1] = ComplexType( 24., 0. ); + result[2] = ComplexType( 16., 0.); + result[3] = ComplexType( 8., 0 ); result[4] = ComplexType( 18., 0. ); result[5] = ComplexType( 12. , 0. ); - result[6] = ComplexType( 0. , 6. ); + result[6] = ComplexType( 6. , 0. ); result[7] = ComplexType( 8, 0. ); - result[8] = ComplexType( 0, 4. ); + 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.) );