|
OTB
9.0.0
Orfeo Toolbox
|
Go to the documentation of this file.
21 #ifndef otbMRFEnergyGaussianClassification_h
22 #define otbMRFEnergyGaussianClassification_h
48 template <
class TInput1,
class TInput2>
69 Superclass::SetNumberOfParameters(nParameters);
70 this->m_Parameters.SetSize(nParameters);
76 if ((
unsigned int)value2 >= this->GetNumberOfParameters() / 2)
78 itkExceptionMacro(<<
"Number of parameters does not correspond to number of classes");
80 double val1 =
static_cast<double>(value1);
83 vnl_math_sqr(val1 - this->m_Parameters[2 *
static_cast<int>(value2)]) / (2 * vnl_math_sqr(this->m_Parameters[2 *
static_cast<int>(value2) + 1])) +
84 std::log(std::sqrt(
CONST_2PI) * this->m_Parameters[2 *
static_cast<int>(value2) + 1]);
86 return static_cast<double>(result);
MRFEnergyGaussianClassification()
~MRFEnergyGaussianClassification() override
void SetNumberOfParameters(const unsigned int nParameters) override
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
MRFEnergyGaussianClassification Self
This is the implementation of the Gaussian model for Markov classification.
constexpr double CONST_2PI
MRFEnergy< TInput1, TInput2 > Superclass
InputImageType::PixelType InputImagePixelType
LabelledImageType::PixelType LabelledImagePixelType
itk::SmartPointer< const Self > ConstPointer
LabelledImageType::PixelType LabelledImagePixelType
double GetSingleValue(const InputImagePixelType &value1, const LabelledImagePixelType &value2) override
InputImageType::PixelType InputImagePixelType
TInput2 LabelledImageType
itk::SmartPointer< Self > Pointer
itk::Array< double > ParametersType
This is the base class for energy function used in the MRF framework.