Commit c95ae417 authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: update classification appli to output confidence mask

parent 8c02fd8d
......@@ -59,6 +59,7 @@ public:
typedef ClassificationFilterType::ValueType ValueType;
typedef ClassificationFilterType::LabelType LabelType;
typedef otb::MachineLearningModelFactory<ValueType, LabelType> MachineLearningModelFactoryType;
typedef ClassificationFilterType::ConfidenceImageType ConfidenceImageType;
private:
void DoInit()
......@@ -94,6 +95,11 @@ private:
SetParameterDescription( "out", "Output image containing class labels");
SetParameterOutputImagePixelType( "out", ImagePixelType_uint8);
AddParameter(ParameterType_OutputImage, "confmap", "Confidence map");
SetParameterDescription( "confmap", "Confidence map of the produced classification. Meaning depends on the model.");
SetParameterOutputImagePixelType( "confmap", ImagePixelType_double);
MandatoryOff("confmap");
AddRAMParameter();
// Doc example parameter settings
......@@ -171,6 +177,15 @@ private:
}
SetParameterOutputImage<OutputImageType>("out", m_ClassificationFilter->GetOutput());
// output confidence map
if (IsParameterEnabled("confmap") && HasValue("confmap"))
{
if (m_Model->HasConfidenceIndex())
{
SetParameterOutputImage<ConfidenceImageType>("confmap",m_ClassificationFilter->GetOutputConfidence());
}
}
}
ClassificationFilterType::Pointer m_ClassificationFilter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment