21 #ifndef otbMRFEnergyFisherClassification_h
22 #define otbMRFEnergyFisherClassification_h
44 template <
class TInput1,
class TInput2>
64 Superclass::SetNumberOfParameters(nParameters);
65 this->m_Parameters.SetSize(nParameters);
71 if ((
unsigned int)value2 >= this->GetNumberOfParameters() / 3)
73 itkExceptionMacro(<<
"Number of parameters does not correspond to number of classes");
75 double val1 =
static_cast<double>(value1);
76 double mu = this->m_Parameters[3 * value2];
77 double l = this->m_Parameters[3 * value2 + 1];
78 double m = this->m_Parameters[3 * value2 + 2];
80 double result = -std::log((boost::math::tgamma(l + m) / (boost::math::tgamma(l) * boost::math::tgamma(m))) * (2 / (mu)) * (std::sqrt(l / m)) *
81 ((std::pow((std::sqrt(l / m) * (val1 / mu)), ((2 * l) - 1))) /
82 (std::pow(1 + (std::sqrt(l / m) * (val1 / mu) * std::sqrt(l / m) * (val1 / mu)), (l + m)))));
Fisher model for Markov classification.
void SetNumberOfParameters(const unsigned int nParameters) override
TInput2 LabelledImageType
MRFEnergy< TInput1, TInput2 > Superclass
~MRFEnergyFisherClassification() override
itk::Array< double > ParametersType
InputImageType::PixelType InputImagePixelType
double GetSingleValue(const InputImagePixelType &value1, const LabelledImagePixelType &value2) override
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
MRFEnergyFisherClassification()
LabelledImageType::PixelType LabelledImagePixelType
MRFEnergyFisherClassification Self
This is the base class for energy function used in the MRF framework.
InputImageType::PixelType InputImagePixelType
LabelledImageType::PixelType LabelledImagePixelType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.