From ef0ff2c7ebd5ba54fa84a7e54af5c1244dd19402 Mon Sep 17 00:00:00 2001 From: Julien Malik <julien.malik@c-s.fr> Date: Fri, 17 Sep 2010 13:51:26 +0200 Subject: [PATCH] DOC --- Code/OBIA/otbAttributesMapLabelObject.h | 2 +- ...tbAttributesMapLabelObjectWithClassLabel.h | 2 +- ...bBandsStatisticsAttributesLabelMapFilter.h | 7 +++-- .../otbImageToLabelMapWithAttributesFilter.h | 4 +-- ...otbImageToLabelMapWithAttributesFilter.txx | 31 ++++++------------- .../otbKMeansAttributesLabelMapFilter.txx | 2 +- .../otbLabelMapFeaturesFunctorImageFilter.h | 2 ++ Code/OBIA/otbLabelMapSVMClassifier.h | 4 +++ Code/OBIA/otbLabelMapSVMClassifier.txx | 2 ++ Code/OBIA/otbLabelMapSource.h | 3 +- Code/OBIA/otbLabelMapSource.txx | 13 +------- Code/OBIA/otbLabelMapToSampleListFilter.h | 5 +-- Code/OBIA/otbLabelMapToSampleListFilter.txx | 9 +++--- Code/OBIA/otbLabelMapToVectorDataFilter.h | 2 +- Code/OBIA/otbLabelMapWithAdjacency.h | 14 +++------ ...MapWithClassLabelToClassLabelImageFilter.h | 3 +- ...pWithClassLabelToLabeledSampleListFilter.h | 9 ++++-- ...ithClassLabelToLabeledSampleListFilter.txx | 8 ++--- Code/OBIA/otbMinMaxAttributesLabelMapFilter.h | 4 ++- .../otbNormalizeAttributesLabelMapFilter.h | 8 +++-- .../otbNormalizeAttributesLabelMapFilter.txx | 4 --- .../Code/OBIA/otbLabelMapSVMClassifier.cxx | 2 +- .../OBIA/otbLabelMapToSampleListFilter.cxx | 2 +- ...ithClassLabelToLabeledSampleListFilter.cxx | 2 +- 24 files changed, 64 insertions(+), 80 deletions(-) diff --git a/Code/OBIA/otbAttributesMapLabelObject.h b/Code/OBIA/otbAttributesMapLabelObject.h index c8292fab22..b85dd3713e 100644 --- a/Code/OBIA/otbAttributesMapLabelObject.h +++ b/Code/OBIA/otbAttributesMapLabelObject.h @@ -147,7 +147,7 @@ private: * * As such it allows to store any custom attributes as necessary. * - *\sa LabelObject, ShapeLabelObject, StatisticsLabelObject + * \sa LabelObject, ShapeLabelObject, StatisticsLabelObject * * \ingroup DataRepresentation */ diff --git a/Code/OBIA/otbAttributesMapLabelObjectWithClassLabel.h b/Code/OBIA/otbAttributesMapLabelObjectWithClassLabel.h index e6f91ddea4..4c60f3cc3d 100644 --- a/Code/OBIA/otbAttributesMapLabelObjectWithClassLabel.h +++ b/Code/OBIA/otbAttributesMapLabelObjectWithClassLabel.h @@ -24,7 +24,7 @@ namespace otb { /** \class AttributesMapLabelObjectWithClassLabel - * \brief An AttributesMapLabelObject with an optionnal class label. + * \brief An AttributesMapLabelObject with an optional class label. * * The label type is defined by the template parameter TClassLabel and * accessible using the ClassLabelType typedef. diff --git a/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.h b/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.h index b7564bd125..840709338c 100644 --- a/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.h +++ b/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.h @@ -26,10 +26,11 @@ namespace otb namespace Functor { /** \class BandStatsAttributesLabelObjectFunctor -* \brief Functor to compute multiple statistics attributes. +* \brief Functor to compute bands statistics attributes. * * For one label object, this functors applies the -* StatisticsAttributesLabelObjectFunctor for each feature +* StatisticsAttributesLabelObjectFunctor one each feature image +* provided through AddFeature() * * As such, it allows to compute in one pass statistics related to * multiple features. It is used in the @@ -115,7 +116,7 @@ private: * Images are supposed to be compatible with otb::VectorImage * * This filter internally applies the - * StatisticsAttributesLabelMapFilter each channel independently + * StatisticsAttributesLabelMapFilter on each channel independently * * The feature name is constructed as: * 'STATS' + '::' + 'Band' + #BandIndex + '::' + StatisticName diff --git a/Code/OBIA/otbImageToLabelMapWithAttributesFilter.h b/Code/OBIA/otbImageToLabelMapWithAttributesFilter.h index b6c5bd1f97..65e25d3f55 100644 --- a/Code/OBIA/otbImageToLabelMapWithAttributesFilter.h +++ b/Code/OBIA/otbImageToLabelMapWithAttributesFilter.h @@ -25,7 +25,7 @@ PURPOSE. See the above copyright notices for more information. #include "otbLabelImageToLabelMapWithAdjacencyFilter.h" #include "otbLabelMapWithAdjacency.h" #include "otbShapeAttributesLabelMapFilter.h" -#include "otbRadiometricAttributesLabelMapFilter.h" +#include "otbBandsStatisticsAttributesLabelMapFilter.h" #include "otbLabelMapWithClassLabelToClassLabelImageFilter.h" @@ -71,7 +71,7 @@ public: typedef LabelImageToLabelMapWithAdjacencyFilter<LabeledImageType,LabelMapType> LabelMapFilterType; typedef ShapeAttributesLabelMapFilter<LabelMapType> ShapeLabelMapFilterType; - typedef RadiometricAttributesLabelMapFilter<LabelMapType,InputImageType> RadiometricLabelMapFilterType; + typedef BandsStatisticsAttributesLabelMapFilter<LabelMapType,InputImageType> BandStatisticsLabelMapFilterType; virtual void SetInput( const InputImageType *image); virtual void SetLabeledImage( const LabeledImageType * image); diff --git a/Code/OBIA/otbImageToLabelMapWithAttributesFilter.txx b/Code/OBIA/otbImageToLabelMapWithAttributesFilter.txx index 8b18968e7d..6fb700933f 100644 --- a/Code/OBIA/otbImageToLabelMapWithAttributesFilter.txx +++ b/Code/OBIA/otbImageToLabelMapWithAttributesFilter.txx @@ -28,12 +28,9 @@ ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TO ::ImageToLabelMapWithAttributesFilter() { m_Output = LabelMapType::New(); - - this->itk::ProcessObject::SetNumberOfRequiredOutputs(2); - + this->itk::ProcessObject::SetNumberOfRequiredInputs(2); } - template <class TInputImage, class TLabeledImage, class TOutputLabel, class TObjectLabel> void ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TObjectLabel> @@ -42,7 +39,6 @@ ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TO // Process object is not const-correct so the const_cast is required here this->itk::ProcessObject::SetNthInput(0, const_cast< InputImageType * >( image ) ); - } template <class TInputImage, class TLabeledImage, class TOutputLabel, class TObjectLabel> @@ -102,7 +98,6 @@ void ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TObjectLabel> ::GenerateData() { - std::cout <<"############# ImageToLabelMapWithAttributesFilter::GenerateData #########" << std::endl; typename InputImageType::Pointer inputImage = const_cast<InputImageType *>(this->GetInput()); typename LabeledImageType::Pointer labeldImage = const_cast<LabeledImageType *>(this->GetLabeledImage()); @@ -116,27 +111,19 @@ ImageToLabelMapWithAttributesFilter<TInputImage, TLabeledImage, TOutputLabel, TO shapeLabelMapFilter->SetInput(lfilter->GetOutput()); // Compute radiometric attributes - typename RadiometricLabelMapFilterType::Pointer radiometricLabelMapFilter = RadiometricLabelMapFilterType::New(); - radiometricLabelMapFilter->SetInput1(shapeLabelMapFilter->GetOutput()); - radiometricLabelMapFilter->SetInput2(inputImage); - -// if(m_VectorImage->GetNumberOfComponentsPerPixel()==3) -// { -// // radiometricLabelMapFilter->SetRedChannelIndex(0); -// // radiometricLabelMapFilter->SetGreenChannelIndex(1); -// // radiometricLabelMapFilter->SetBlueChannelIndex(2); -// // radiometricLabelMapFilter->SetNIRChannelIndex(m_BandId[3]); -// } - + typename BandStatisticsLabelMapFilterType::Pointer bandStatsLabelMapFilter = BandStatisticsLabelMapFilterType::New(); + bandStatsLabelMapFilter->SetInput(shapeLabelMapFilter->GetOutput()); + bandStatsLabelMapFilter->SetFeatureImage(inputImage); + // Get the label map - radiometricLabelMapFilter->GetOutput()->SetAdjacencyMap(lfilter->GetOutput()->GetAdjacencyMap()); - radiometricLabelMapFilter->GraftOutput( this->GetOutput() ); + bandStatsLabelMapFilter->GetOutput()->SetAdjacencyMap(lfilter->GetOutput()->GetAdjacencyMap()); + bandStatsLabelMapFilter->GraftOutput( this->GetOutput() ); // execute the mini-pipeline - radiometricLabelMapFilter->Update(); + bandStatsLabelMapFilter->Update(); // graft the mini-pipeline output back onto this filter's output. - this->GraftOutput( radiometricLabelMapFilter->GetOutput() ); + this->GraftOutput( bandStatsLabelMapFilter->GetOutput() ); } diff --git a/Code/OBIA/otbKMeansAttributesLabelMapFilter.txx b/Code/OBIA/otbKMeansAttributesLabelMapFilter.txx index b94b82dc5c..eeab9acf7c 100644 --- a/Code/OBIA/otbKMeansAttributesLabelMapFilter.txx +++ b/Code/OBIA/otbKMeansAttributesLabelMapFilter.txx @@ -38,7 +38,7 @@ KMeansAttributesLabelMapFilter<TInputImage> ::Compute() { m_LabelMapToSampleListFilter->SetInputLabelMap(m_InputLabelMap); - m_LabelMapToSampleListFilter->Update(); + m_LabelMapToSampleListFilter->Compute(); typename ListSampleType::Pointer listSamples = m_LabelMapToSampleListFilter->GetOutputSampleList(); typename TrainingListSampleType::Pointer trainingSamples = m_LabelMapToSampleListFilter->GetOutputTrainingSampleList(); diff --git a/Code/OBIA/otbLabelMapFeaturesFunctorImageFilter.h b/Code/OBIA/otbLabelMapFeaturesFunctorImageFilter.h index 5d5bd375e0..182d87ec9f 100644 --- a/Code/OBIA/otbLabelMapFeaturesFunctorImageFilter.h +++ b/Code/OBIA/otbLabelMapFeaturesFunctorImageFilter.h @@ -24,6 +24,7 @@ #include "itkInPlaceLabelMapFilter.h" namespace otb { + /** \class LabelMapFeaturesFunctorImageFilter * \brief This class applies a functor to compute new features * @@ -39,6 +40,7 @@ namespace otb { * \sa otb::StatisticsAttributesLabelMapFilter * \sa otb::ShapeAttributesLabelMapFilter * \sa otb::RadiometricAttributesLabelMapFilter + * \sa otb::BandsStatisticsAttributesLabelMapFilter * \sa itk::InPlaceLabelMapFilter * * \ingroup ImageEnhancement MathematicalMorphologyImageFilters diff --git a/Code/OBIA/otbLabelMapSVMClassifier.h b/Code/OBIA/otbLabelMapSVMClassifier.h index dba609d66f..8f3506e9b6 100644 --- a/Code/OBIA/otbLabelMapSVMClassifier.h +++ b/Code/OBIA/otbLabelMapSVMClassifier.h @@ -27,6 +27,10 @@ namespace otb { /** \class LabelMapSVMClassifier * \brief Classify each LabelObject of the input LabelMap in place + * + * \sa otb::AttributesMapLabelObject + * \sa otb::SVMModel + * \sa itk::InPlaceLabelMapFilter */ template<class TInputLabelMap> class ITK_EXPORT LabelMapSVMClassifier : diff --git a/Code/OBIA/otbLabelMapSVMClassifier.txx b/Code/OBIA/otbLabelMapSVMClassifier.txx index eb507f4e3b..031c670b24 100644 --- a/Code/OBIA/otbLabelMapSVMClassifier.txx +++ b/Code/OBIA/otbLabelMapSVMClassifier.txx @@ -38,6 +38,8 @@ void LabelMapSVMClassifier<TInputImage> ::ReleaseInputs( ) { + // by pass itk::InPlaceLabelMapFilter::ReleaseInputs() implementation, + // which caused memory issue when ran inplace this->itk::LabelMapFilter<TInputImage, TInputImage>::ReleaseInputs(); } diff --git a/Code/OBIA/otbLabelMapSource.h b/Code/OBIA/otbLabelMapSource.h index 0946461aa7..c2e5832a57 100644 --- a/Code/OBIA/otbLabelMapSource.h +++ b/Code/OBIA/otbLabelMapSource.h @@ -30,8 +30,7 @@ namespace otb { /** \class LabelMapSource - * \brief Filter hierarchy for generating LabelMap - * + * \brief Base class for filter that output LabelMap * * \ingroup IO * diff --git a/Code/OBIA/otbLabelMapSource.txx b/Code/OBIA/otbLabelMapSource.txx index da4ce8ec0c..3093e6b620 100644 --- a/Code/OBIA/otbLabelMapSource.txx +++ b/Code/OBIA/otbLabelMapSource.txx @@ -23,14 +23,11 @@ namespace otb { -/** - * Constructor - */ + template <class TOutputLabelMap> LabelMapSource<TOutputLabelMap> ::LabelMapSource() { - //std::cout <<"labelsource constructor"<<std::endl; this->Superclass::SetNumberOfRequiredOutputs(1); this->Superclass::SetNthOutput(0, OutputLabelMapType::New().GetPointer()); } @@ -58,10 +55,6 @@ LabelMapSource<TOutputLabelMap> } } -/** - * Get the output LabelMap - * \return The LabelMap produced. - */ template <class TOutputLabelMap> typename LabelMapSource<TOutputLabelMap>::OutputLabelMapType * LabelMapSource<TOutputLabelMap> @@ -71,7 +64,6 @@ LabelMapSource<TOutputLabelMap> { return 0; } - //std::cout << "labelsource: get output..." <<std::endl; return static_cast<OutputLabelMapType *> (this->ProcessObject::GetOutput(0)); } @@ -84,9 +76,6 @@ LabelMapSource<TOutputLabelMap> (this->Superclass::GetOutput(idx)); } -/** - * PrintSelf Method - */ template<class TOutputLabelMap> void LabelMapSource<TOutputLabelMap> diff --git a/Code/OBIA/otbLabelMapToSampleListFilter.h b/Code/OBIA/otbLabelMapToSampleListFilter.h index 4d6e7abcdb..776cebe1d4 100644 --- a/Code/OBIA/otbLabelMapToSampleListFilter.h +++ b/Code/OBIA/otbLabelMapToSampleListFilter.h @@ -26,6 +26,7 @@ namespace otb { /** \class LabelMapToSampleListFilter + * * \brief This class converts a LabelObjectMap to a SampleList for * learning and classification. * @@ -81,8 +82,8 @@ public: return m_MeasurementFunctor; } - /** Update */ - virtual void Update(); + /** Launch computation (this filter is not a itk::ProcessObject) */ + virtual void Compute(); protected: LabelMapToSampleListFilter(); diff --git a/Code/OBIA/otbLabelMapToSampleListFilter.txx b/Code/OBIA/otbLabelMapToSampleListFilter.txx index 138a8777bb..1b23998f35 100644 --- a/Code/OBIA/otbLabelMapToSampleListFilter.txx +++ b/Code/OBIA/otbLabelMapToSampleListFilter.txx @@ -27,21 +27,20 @@ template <class TInputLabelMap, class TOutputListSample, class TMeasurementFunct LabelMapToSampleListFilter<TInputLabelMap,TOutputListSample,TMeasurementFunctor> ::LabelMapToSampleListFilter() { - m_OutputSampleList = OutputSampleListType::New(); } template <class TInputLabelMap, class TOutputListSample, class TMeasurementFunctor> LabelMapToSampleListFilter<TInputLabelMap,TOutputListSample,TMeasurementFunctor> ::~LabelMapToSampleListFilter() -{} +{ +} template <class TInputLabelMap, class TOutputListSample, class TMeasurementFunctor> void LabelMapToSampleListFilter<TInputLabelMap,TOutputListSample,TMeasurementFunctor> -::Update() +::Compute() { - // Clear output sample list - m_OutputSampleList->Clear(); + m_OutputSampleList = OutputSampleListType::New(); typename InputLabelMapType::LabelObjectContainerType::const_iterator it = m_InputLabelMap->GetLabelObjectContainer().begin(); diff --git a/Code/OBIA/otbLabelMapToVectorDataFilter.h b/Code/OBIA/otbLabelMapToVectorDataFilter.h index ffaea14dc2..b700c1e95f 100644 --- a/Code/OBIA/otbLabelMapToVectorDataFilter.h +++ b/Code/OBIA/otbLabelMapToVectorDataFilter.h @@ -36,7 +36,7 @@ namespace otb { * * LabelMapToVectorDataFilter converts a LabelMap to a * VectorData where all the pixels get the attribute value of the label object they belong. - * It uses the class otbLabelObjectToPolygonFunctor wich follows a finite states machine described in + * It uses the class otbLabelObjectToPolygonFunctor which follows a finite states machine described in * * "An algorithm for the rapid computation of boundaries of run-length * encoded regions", Francis K. H. Queck, in Pattern Recognition 33 diff --git a/Code/OBIA/otbLabelMapWithAdjacency.h b/Code/OBIA/otbLabelMapWithAdjacency.h index 5eb1b91c41..9eb2149279 100644 --- a/Code/OBIA/otbLabelMapWithAdjacency.h +++ b/Code/OBIA/otbLabelMapWithAdjacency.h @@ -167,14 +167,11 @@ public: { // Check if label2 is in the adjacent labels if(it->second.count(label2)) - { - //std::cout<<"label "<<label2<<" found in adjancecy table of label "<<it->first<<", replacing by label "<<label1<<std::endl; - it->second.erase(label2); - it->second.insert(label1); - m_AdjacencyMap[label1].insert(it->first); - //std::cout<<"Checking new occurences of label "<<label2<<": "<<it->second.count(label2)<<std::endl; - //std::cout<<"Checking new occurences of label "<<label1<<": "<<it->second.count(label1)<<std::endl; - } + { + it->second.erase(label2); + it->second.insert(label1); + m_AdjacencyMap[label1].insert(it->first); + } } // Remove label object corresponding to label2 @@ -195,7 +192,6 @@ public: for(lpit1 = internalLabelPairs.begin();lpit1 != internalLabelPairs.end();++lpit1) { -// std::cout<<"Processing merge "<<lpit1->first<<" <-> "<<lpit1->second<<std::endl; // Merge the current label pair this->MergeLabels(lpit1->first,lpit1->second); diff --git a/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.h b/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.h index 3863779201..4ff3f8d6d7 100644 --- a/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.h +++ b/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.h @@ -23,7 +23,8 @@ PURPOSE. See the above copyright notices for more information. namespace otb { /** \class LabelMapWithClassLabelToClassLabelImageFilter - * \brief + * \brief Converts a LabelMap<LabelObjectWithClassLabel> to an image + * of class labels */ template<class TInputImage, class TOutputImage> class ITK_EXPORT LabelMapWithClassLabelToClassLabelImageFilter : diff --git a/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.h b/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.h index a8f3c4303d..28a8e1a331 100644 --- a/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.h +++ b/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.h @@ -24,11 +24,14 @@ namespace otb { /** \class LabelMapWithClassLabelToLabeledSampleListFilter * \brief This class converts a LabelObjectMap with some class labeled - * objets to a SampleList and a TrainingSampleList suitable for supervised learning. + * objets to a SampleList and a TrainingSampleList suitable for supervised learning, + * and compatible with otb::SVMSampleListModelEstimator * * The conversion from label object to measurement vector is made * through a functor. This allows to support any kind of LabelObject * via proper redefinition of the functor. + * + * \sa otb::SVMSampleListModelEstimator */ template <class TInputLabelMap, class TOutputSampleList,class TOutputTrainingSampleList, @@ -86,8 +89,8 @@ public: return m_MeasurementFunctor; } - /** Update */ - virtual void Update(); + /** Update data (WRG: this filter is not pipeline-ready as it does not derive from itk::ProcessObject) */ + virtual void Compute(); protected: LabelMapWithClassLabelToLabeledSampleListFilter(); diff --git a/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.txx b/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.txx index e69fbc7beb..944c191fca 100644 --- a/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.txx +++ b/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.txx @@ -27,8 +27,6 @@ template <class TInputLabelMap, class TOutputListSample, class TOutputTrainingLi LabelMapWithClassLabelToLabeledSampleListFilter<TInputLabelMap,TOutputListSample,TOutputTrainingListSample,TMeasurementFunctor> ::LabelMapWithClassLabelToLabeledSampleListFilter() { - m_OutputSampleList = OutputSampleListType::New(); - m_OutputTrainingSampleList = OutputTrainingSampleListType::New(); } template <class TInputLabelMap, class TOutputListSample, class TOutputTrainingListSample, class TMeasurementFunctor> @@ -39,11 +37,11 @@ LabelMapWithClassLabelToLabeledSampleListFilter<TInputLabelMap,TOutputListSample template <class TInputLabelMap, class TOutputListSample, class TOutputTrainingListSample, class TMeasurementFunctor> void LabelMapWithClassLabelToLabeledSampleListFilter<TInputLabelMap,TOutputListSample,TOutputTrainingListSample,TMeasurementFunctor> -::Update() +::Compute() { // Clear output sample list - m_OutputSampleList->Clear(); - m_OutputTrainingSampleList->Clear(); + m_OutputSampleList = OutputSampleListType::New(); + m_OutputTrainingSampleList = OutputTrainingSampleListType::New(); typename InputLabelMapType::LabelObjectContainerType::const_iterator it = m_InputLabelMap->GetLabelObjectContainer().begin(); diff --git a/Code/OBIA/otbMinMaxAttributesLabelMapFilter.h b/Code/OBIA/otbMinMaxAttributesLabelMapFilter.h index 59cca650ae..f494993d62 100644 --- a/Code/OBIA/otbMinMaxAttributesLabelMapFilter.h +++ b/Code/OBIA/otbMinMaxAttributesLabelMapFilter.h @@ -24,7 +24,9 @@ PURPOSE. See the above copyright notices for more information. namespace otb { /** \class MinMaxAttributesLabelMapFilter - * \brief Computes the min/max of all attributes of a itk::LabelMap<otb::AttributesMapLabelObject> + * \brief Computes the min/max of all attributes of a LabelMap + * where LabelObject type is compatible with otb::AttributesMapLabelObject + * */ template<class TInputImage> class ITK_EXPORT MinMaxAttributesLabelMapFilter : diff --git a/Code/OBIA/otbNormalizeAttributesLabelMapFilter.h b/Code/OBIA/otbNormalizeAttributesLabelMapFilter.h index 9d709d2e22..8c9b2d40e3 100644 --- a/Code/OBIA/otbNormalizeAttributesLabelMapFilter.h +++ b/Code/OBIA/otbNormalizeAttributesLabelMapFilter.h @@ -32,6 +32,10 @@ namespace Functor /** \class NormalizeAttributesLabelObjectFunctor * \brief Functor to normalize all attributes of a LabelMap * +* Given the minimum and maximum of all attributes (which can be computed with +* MinMaxAttributesLabelMapFilter), this filter rescale the attributes such that +* all attributes are in [0,1] interval +* * \sa MinMaxAttributesLabelMapFilter */ template <class TLabelObject> @@ -80,8 +84,8 @@ private: /** \class NormalizeAttributesLabelMapFilter * \brief This class works with AttributesMapLabelObject, and normalizes all attributes - * wrt a vector of minimal and maximal attribute value, such that the resulting - * attributes are in [0,1] + * wrt a map of minimal and maximal attribute value, such that the resulting + * attributes are in the [0,1] interval * * \sa MinMaxAttributesLabelMapFilter */ diff --git a/Code/OBIA/otbNormalizeAttributesLabelMapFilter.txx b/Code/OBIA/otbNormalizeAttributesLabelMapFilter.txx index bbbe523971..4b3b86c264 100644 --- a/Code/OBIA/otbNormalizeAttributesLabelMapFilter.txx +++ b/Code/OBIA/otbNormalizeAttributesLabelMapFilter.txx @@ -48,13 +48,9 @@ bool NormalizeAttributesLabelObjectFunctor<TLabelObject> ::operator == (const Self &self) { - // Call the != implementation return !(this != self); } -/** This is the functor implementation - * Calling the functor on a label object - * will update its shape attributes */ template <class TLabelObject> void NormalizeAttributesLabelObjectFunctor<TLabelObject> diff --git a/Testing/Code/OBIA/otbLabelMapSVMClassifier.cxx b/Testing/Code/OBIA/otbLabelMapSVMClassifier.cxx index 66af9c2dc7..a08f8a79a9 100644 --- a/Testing/Code/OBIA/otbLabelMapSVMClassifier.cxx +++ b/Testing/Code/OBIA/otbLabelMapSVMClassifier.cxx @@ -148,7 +148,7 @@ int otbLabelMapSVMClassifier(int argc, char * argv[]) labelMap2SampleList->GetMeasurementFunctor().AddAttribute((*attrIt).c_str()); } - labelMap2SampleList->Update(); + labelMap2SampleList->Compute(); // Estimate SVM model svmEstim->SetInputSampleList(labelMap2SampleList->GetOutputSampleList()); diff --git a/Testing/Code/OBIA/otbLabelMapToSampleListFilter.cxx b/Testing/Code/OBIA/otbLabelMapToSampleListFilter.cxx index 38953885c5..9604c682fb 100644 --- a/Testing/Code/OBIA/otbLabelMapToSampleListFilter.cxx +++ b/Testing/Code/OBIA/otbLabelMapToSampleListFilter.cxx @@ -83,7 +83,7 @@ int otbLabelMapToSampleListFilter(int argc, char* argv[]) std::cout<<"Number of attributes: "<<filter->GetMeasurementFunctor().GetNumberOfAttributes()<<std::endl; - filter->Update(); + filter->Compute(); return EXIT_SUCCESS; } diff --git a/Testing/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.cxx b/Testing/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.cxx index 40e7900f90..5bb884b921 100644 --- a/Testing/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.cxx +++ b/Testing/Code/OBIA/otbLabelMapWithClassLabelToLabeledSampleListFilter.cxx @@ -87,7 +87,7 @@ int otbLabelMapWithClassLabelToLabeledSampleListFilter(int argc, char* argv[]) shapeLabelMapFilter->GetOutput()->GetLabelObject(1)->SetClassLabel(1); - filter->Update(); + filter->Compute(); return EXIT_SUCCESS; } -- GitLab