OTB  10.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-2024 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:
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
Estimates the number of endmembers in a hyperspectral image.
EigenvalueLikelihoodMaximisation(const Self &)=delete
void operator=(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.