diff --git a/Code/Common/otbVariableLengthVectorConverter.h b/Code/Common/otbVariableLengthVectorConverter.h index c4ecd3fa9bb5f30f7f0c3e2abd64b1a465380437..61dc8f8246311721829ab3dec9b828811937b0e8 100644 --- a/Code/Common/otbVariableLengthVectorConverter.h +++ b/Code/Common/otbVariableLengthVectorConverter.h @@ -204,10 +204,8 @@ private: }; //Histogram -template< class TMeasurement, unsigned int VMeasurementVectorSize, class TFrequencyContainer, class TPrecisionType > -class ITK_EXPORT VariableLengthVectorConverter<typename itk::SmartPointer< const itk::Statistics::Histogram<TMeasurement, - VMeasurementVectorSize, - TFrequencyContainer> >, +template< class TPixel, class TPrecisionType > +class ITK_EXPORT VariableLengthVectorConverter<typename itk::SmartPointer< itk::Statistics::Histogram<TPixel> >, TPrecisionType> : public itk::ProcessObject { @@ -226,9 +224,7 @@ public: typedef TPrecisionType OutputPrecisionType; typedef typename itk::VariableLengthVector<OutputPrecisionType> OutputType; - typedef typename itk::SmartPointer< const itk::Statistics::Histogram<TMeasurement, - VMeasurementVectorSize, - TFrequencyContainer> > InputType; + typedef typename itk::SmartPointer< itk::Statistics::Histogram<TPixel> > InputType; OutputType Convert(InputType input); diff --git a/Code/Common/otbVariableLengthVectorConverter.txx b/Code/Common/otbVariableLengthVectorConverter.txx index ec25d9722fac5d091eef63d3ff7276bb25adb244..213290f62a67ba39fb6c31ca5a65e85f73625e07 100644 --- a/Code/Common/otbVariableLengthVectorConverter.txx +++ b/Code/Common/otbVariableLengthVectorConverter.txx @@ -49,7 +49,6 @@ VariableLengthVectorConverter< std::vector<std::vector<TInternalInputType> >, TP rsltIdx ++; } } - return result; } @@ -80,7 +79,6 @@ VariableLengthVectorConverter< std::vector<std::vector<std::complex<TInternalInp rsltIdx ++; } } - return result; } @@ -101,20 +99,15 @@ VariableLengthVectorConverter< itk::FixedArray<TInternalInputType, VArrayDimensi result[rsltIdx] = static_cast<OutputPrecisionType>(input[i]); rsltIdx ++; } - return result; } // Histogram -template< class TMeasurement, unsigned int VMeasurementVectorSize, class TFrequencyContainer, class TPrecisionType > -typename VariableLengthVectorConverter< itk::SmartPointer< const itk::Statistics::Histogram<TMeasurement, - VMeasurementVectorSize, - TFrequencyContainer> >, +template< class TPixel, class TPrecisionType > +typename VariableLengthVectorConverter< itk::SmartPointer< itk::Statistics::Histogram<TPixel> >, TPrecisionType> ::OutputType -VariableLengthVectorConverter< itk::SmartPointer<const itk::Statistics::Histogram<TMeasurement, - VMeasurementVectorSize, - TFrequencyContainer> >, +VariableLengthVectorConverter< itk::SmartPointer< itk::Statistics::Histogram<TPixel> >, TPrecisionType> ::Convert(InputType input) { @@ -131,7 +124,7 @@ VariableLengthVectorConverter< itk::SmartPointer<const itk::Statistics::Histogra result[rsltIdx] = static_cast<OutputPrecisionType>(input->GetFrequency(i)); rsltIdx ++; } - + std::cout << "Histogram to VLV" << std::endl; return result; } diff --git a/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx b/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx index c55e6a1cabf49f894652419e50d32c5bb038c02b..9a0c0ddf9d1ad13b7b623e6bdf207b42a201d9c0 100644 --- a/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx +++ b/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx @@ -168,6 +168,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for FMDadaptedFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } @@ -202,6 +204,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for RMFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } try @@ -236,6 +240,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for CMadaptedFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } try @@ -261,6 +267,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for FMFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } try @@ -286,6 +294,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for HMFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } try @@ -312,6 +322,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for RaMFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } try @@ -344,6 +356,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for LHFunction() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } error = vcl_sqrt(error); @@ -386,6 +400,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) { std::cout << "ExceptionObject caught for FMDFunctionType() !" << std::endl; std::cout << err << std::endl; + + return EXIT_FAILURE; } diff --git a/Testing/Code/ObjectDetection/otbStandardMetaImageFunctionBuilder.cxx b/Testing/Code/ObjectDetection/otbStandardMetaImageFunctionBuilder.cxx index d93605f5dfd89d827617a441cc21236b189eed16..bff8e54f243b827128e856c9f1ced0d1746f6e83 100644 --- a/Testing/Code/ObjectDetection/otbStandardMetaImageFunctionBuilder.cxx +++ b/Testing/Code/ObjectDetection/otbStandardMetaImageFunctionBuilder.cxx @@ -81,6 +81,8 @@ int otbStandardMetaImageFunctionBuilder(int argc, char* argv[]) p1.push_back(7); p1.push_back(128); + p1.push_back(0); + p1.push_back(1500); p2.push_back(6);