OTB  9.0.0
Orfeo Toolbox
otbEigenvalueLikelihoodMaximisation.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbEigenvalueLikelihoodMaximisation_h
23 #define otbEigenvalueLikelihoodMaximisation_h
24 
25 #include "itkObjectFactory.h"
26 #include "itkLightObject.h"
27 #include "vnl/vnl_vector.h"
28 #include "vnl/vnl_matrix.h"
29 #include "vnl/algo/vnl_symmetric_eigensystem.h"
30 
31 namespace otb
32 {
33 
56 template <class TPrecision>
57 class ITK_EXPORT EigenvalueLikelihoodMaximisation : public itk::LightObject
58 {
59 public:
62  typedef itk::LightObject Superclass;
63  typedef itk::SmartPointer<Self> Pointer;
64  typedef itk::SmartPointer<const Self> ConstPointer;
65 
67  itkNewMacro(Self);
68 
70  itkTypeMacro(EigenvalueLikelihoodMaximisation, itk::LightObject);
71 
73  typedef TPrecision PrecisionType;
74 
75  typedef vnl_vector<PrecisionType> VectorType;
76  typedef vnl_matrix<PrecisionType> MatrixType;
77 
78  void SetCovariance(const MatrixType& m)
79  {
80  m_Covariance = m;
81  }
82 
83  void SetCorrelation(const MatrixType& m)
84  {
85  m_Correlation = m;
86  }
87 
88  void SetNumberOfPixels(unsigned int n)
89  {
90  m_NumberOfPixels = n;
91  }
92 
93  void Compute();
94 
95  unsigned int GetNumberOfEndmembers()
96  {
97  return m_NumberOfEndmembers;
98  }
99 
101  {
102  return m_Likelihood;
103  }
104 
105 protected:
108  {
109  }
110  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
111 
112 private:
113  EigenvalueLikelihoodMaximisation(const Self&) = delete;
114  void operator=(const Self&) = delete;
115 
118 
119  unsigned int m_NumberOfPixels;
120  unsigned int m_NumberOfEndmembers;
122 };
123 }
124 
125 #ifndef OTB_MANUAL_INSTANTIATION
127 #endif
128 
129 #endif
otb::EigenvalueLikelihoodMaximisation::Self
EigenvalueLikelihoodMaximisation Self
Definition: otbEigenvalueLikelihoodMaximisation.h:61
otb::EigenvalueLikelihoodMaximisation::MatrixType
vnl_matrix< PrecisionType > MatrixType
Definition: otbEigenvalueLikelihoodMaximisation.h:76
otb::EigenvalueLikelihoodMaximisation::m_Likelihood
VectorType m_Likelihood
Definition: otbEigenvalueLikelihoodMaximisation.h:121
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::EigenvalueLikelihoodMaximisation::m_Covariance
MatrixType m_Covariance
Definition: otbEigenvalueLikelihoodMaximisation.h:116
otb::EigenvalueLikelihoodMaximisation::~EigenvalueLikelihoodMaximisation
~EigenvalueLikelihoodMaximisation() override
Definition: otbEigenvalueLikelihoodMaximisation.h:107
otb::EigenvalueLikelihoodMaximisation::m_NumberOfEndmembers
unsigned int m_NumberOfEndmembers
Definition: otbEigenvalueLikelihoodMaximisation.h:120
otb::EigenvalueLikelihoodMaximisation::SetCovariance
void SetCovariance(const MatrixType &m)
Definition: otbEigenvalueLikelihoodMaximisation.h:78
otb::EigenvalueLikelihoodMaximisation
Estimates the number of endmembers in a hyperspectral image.
Definition: otbEigenvalueLikelihoodMaximisation.h:57
otb::EigenvalueLikelihoodMaximisation::Superclass
itk::LightObject Superclass
Definition: otbEigenvalueLikelihoodMaximisation.h:62
otb::EigenvalueLikelihoodMaximisation::SetNumberOfPixels
void SetNumberOfPixels(unsigned int n)
Definition: otbEigenvalueLikelihoodMaximisation.h:88
otb::EigenvalueLikelihoodMaximisation::GetNumberOfEndmembers
unsigned int GetNumberOfEndmembers()
Definition: otbEigenvalueLikelihoodMaximisation.h:95
otb::EigenvalueLikelihoodMaximisation::GetLikelihood
const VectorType & GetLikelihood()
Definition: otbEigenvalueLikelihoodMaximisation.h:100
otb::EigenvalueLikelihoodMaximisation::m_NumberOfPixels
unsigned int m_NumberOfPixels
Definition: otbEigenvalueLikelihoodMaximisation.h:119
otbEigenvalueLikelihoodMaximisation.hxx
otb::EigenvalueLikelihoodMaximisation::PrecisionType
TPrecision PrecisionType
Definition: otbEigenvalueLikelihoodMaximisation.h:70
otb::EigenvalueLikelihoodMaximisation::VectorType
vnl_vector< PrecisionType > VectorType
Definition: otbEigenvalueLikelihoodMaximisation.h:75
otb::EigenvalueLikelihoodMaximisation::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbEigenvalueLikelihoodMaximisation.h:63
otb::EigenvalueLikelihoodMaximisation::m_Correlation
MatrixType m_Correlation
Definition: otbEigenvalueLikelihoodMaximisation.h:117
otb::EigenvalueLikelihoodMaximisation::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbEigenvalueLikelihoodMaximisation.h:64
otb::EigenvalueLikelihoodMaximisation::SetCorrelation
void SetCorrelation(const MatrixType &m)
Definition: otbEigenvalueLikelihoodMaximisation.h:83