21 #ifndef otbConfusionMatrixToMassOfBelief_hxx
22 #define otbConfusionMatrixToMassOfBelief_hxx
29 template <
class TConfusionMatrix,
class TLabel>
32 this->SetNumberOfRequiredInputs(2);
33 this->SetNumberOfRequiredOutputs(1);
34 this->m_ConfMatMeasurements = ConfusionMatrixMeasurementsType::New();
35 this->m_DefinitionMethod = this->PRECISION;
38 template <
class TConfusionMatrix,
class TLabel>
44 template <
class TConfusionMatrix,
class TLabel>
47 this->m_ConfMatMeasurements->SetConfusionMatrix(m_ConfusionMatrix);
48 this->m_ConfMatMeasurements->Compute();
50 typename MapOfIndicesType::iterator itMapOfIndices;
53 this->m_MapMassOfBelief.clear();
54 for (itMapOfIndices = m_MapOfIndices.begin(); itMapOfIndices != m_MapOfIndices.end(); ++itMapOfIndices)
56 switch (m_DefinitionMethod)
60 currentMass = m_ConfMatMeasurements->GetPrecisions()[itMapOfIndices->first];
64 currentMass = m_ConfMatMeasurements->GetRecalls()[itMapOfIndices->first];
68 currentMass = m_ConfMatMeasurements->GetOverallAccuracy();
72 currentMass = m_ConfMatMeasurements->GetKappaIndex();
77 currentMass = m_ConfMatMeasurements->GetPrecisions()[itMapOfIndices->first];
81 this->m_MapMassOfBelief[itMapOfIndices->second] = currentMass;