diff --git a/Code/OBIA/otbAttributesMapLabelObject.h b/Code/OBIA/otbAttributesMapLabelObject.h index c8292fab2285996189bdcad9392a3c30cf0021cd..b85dd3713eb3f7caa854556886a365a8cf9bfb55 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 e6f91ddea4949772fb5b2b13b6b3b66057fca43f..4c60f3cc3d6106c632b3bf275f661c4847cebe22 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 b7564bd125ef89148d7a2dc73f4b8dade17d9950..840709338c850c185c51d4e3f2c9137d6cf13158 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 b6c5bd1f97e5b440eae8af7dab28ead41eb01745..65e25d3f558928708f480f1dc613218619f31dc3 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 8b18968e7dce31f9fd0797c020369f96abbd6c91..6fb700933fbf12b0e5103c8025b44320b231b0e3 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 b94b82dc5c6a466da8a9144079bd0d401be5e60a..eeab9acf7cdf0f650d0e56ac3f7b8e27eecac0df 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 5d5bd375e07760bfc4dbd46feca1c0e32728e296..182d87ec9fc652fd3d775cdc71941e5294c15cd1 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 dba609d66febf7c542519fd1a50aec86aaa291b6..8f3506e9b600b829808ad3d5565079b49d021d0b 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 eb507f4e3bf85000035b0d57fcafe81fc448530e..031c670b24bde57690be451a847c07e98275c9bc 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 0946461aa73cf1fc32a1dff75f3be32ee4c703ba..c2e5832a573c53477ccf26e0693e2840b848de8b 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 da4ce8ec0c6d627fae9389ed4fa107df6da8f5f1..3093e6b620b99c85c2d3f0a8ac10ce032e295ecb 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 4d6e7abcdbdf3dc6c8c3c5ab8a765872817933e0..776cebe1d4fee0105c3abbb012f64f87d797e928 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 138a8777bb23e671187719f532d72448810a0ac0..1b23998f3527b4a97566f0af7a7793cbf165ccb5 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 ffaea14dc286ac6e0e69f5f2d0b97ef6ee48afdc..b700c1e95f14300a8069458e50055c9f106af28b 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 5eb1b91c41b78abc0324e08fb3fd78f82afdeb01..9eb2149279a319e4bad5cec1911e5b6a13710794 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 3863779201968212fcefac5a47620d6e8c4be903..4ff3f8d6d765e300b53765579457ea22d95639bd 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 a8f3c4303daa7116262f1e18eb9272bc8b574d7d..28a8e1a3314ddb6d320614ba8b86888b3ab28ef5 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 e69fbc7bebee6b0678a84cac74c888d0fb988ece..944c191fcaf62091d333d83595ca2c8d35bbb0b9 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 59cca650ae8822c74f9e1f139b682d2d763fc2df..f494993d62d37b40ec66ef3139df22879c9b8b9c 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 9d709d2e22510f5839013d609116787bfa9c4207..8c9b2d40e3e6f3ca915a7fbecd383f4b306f1d92 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 bbbe523971ad7ffaf7cf0b3b7a928e608d8e658d..4b3b86c2646419a867ceee05ee2143eb410e9730 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 66af9c2dc7022f008b9124f52427a8d21876ddc2..a08f8a79a91ba029562d1a31327ee0858081e4e7 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 38953885c59f956a6628c7a438253580d1eac263..9604c682fb87bfa97ac0a6f460de91c8bc436171 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 40e7900f905823798d5b05c2d00a4bbc723b69e2..5bb884b9217aa1d3940a6bbcd7af0084226dd481 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; }