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)))));