Commit f1e1e361 authored by Charles Peyrega's avatar Charles Peyrega

ENH: Add a Dempster Shafer fusion mode to the otbFusionOfClassifications application

parent c3a99cb7
......@@ -187,6 +187,12 @@ InputFilenameListParameter::GetNthFileName( unsigned int i ) const
}
InputFilenameListParameter::StringParameterListPointerType
InputFilenameListParameter::GetFileList() const
{
return m_FilenameList;
}
bool
InputFilenameListParameter::HasValue() const
{
......
......@@ -42,6 +42,7 @@ public:
typedef itk::SmartPointer<const Self> ConstPointer;
typedef otb::ObjectList<StringParameter> StringParameterListType;
typedef StringParameterListType* StringParameterListPointerType;
/** Defining ::New() static method */
......@@ -68,6 +69,9 @@ public:
/** Get one specific stored filename. */
std::string GetNthFileName( unsigned int i ) const;
/** Get one list of the stored files. */
StringParameterListPointerType GetFileList() const;
bool HasValue() const;
......
......@@ -20,6 +20,7 @@
#include <QtGui>
#include "otbWrapperInputImageListParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperQtWidgetParameterBase.h"
......
......@@ -137,7 +137,7 @@ void QtWidgetInputFilenameListParameter::DoCreateWidget()
void
QtWidgetInputFilenameListParameter::UpdateFilenameList()
{
for(unsigned int j = 0; j < m_InputFilenameListParam->GetFileNameList().size(); j++)
for(unsigned int j = 0; j < m_InputFilenameListParam->GetFileList()->Size(); j++)
{
if(m_InputFilenameListParam->SetNthFileName(j, m_FileSelectionList[j]->GetFilename()) == false)
{
......
......@@ -356,27 +356,125 @@ OTB_TEST_APPLICATION(NAME apTvClSOMClassificationFull
${TEMP}/apTvClSOMClassificationMap.hdr)
# --- Fusion of classifications ---
OTB_TEST_APPLICATION(NAME apTvFusionOfClassifications2Inputs
OTB_TEST_APPLICATION(NAME apTvFusionOfClassificationsMV2Inputs
APP FusionOfClassifications
OPTIONS -il ${OTBAPP_BASELINE}/clLabeledImageQB123_1.tif
${OTBAPP_BASELINE}/clLabeledImageQB456_1.tif
-undecided 100
-out ${TEMP}/apTvFusionOfClassifications2InputsOutput.tif uint16
-method majorityvoting
-undecidedlabel 100
-out ${TEMP}/apTvFusionOfClassificationsMV2InputsOutput.tif uint16
VALID --compare-image ${NOTOL}
${OTBAPP_BASELINE}/apTvFusionOfClassifications2InputsOutput.tif
${TEMP}/apTvFusionOfClassifications2InputsOutput.tif
${TEMP}/apTvFusionOfClassificationsMV2InputsOutput.tif
)
OTB_TEST_APPLICATION(NAME apTvFusionOfClassifications3Inputs
OTB_TEST_APPLICATION(NAME apTvFusionOfClassificationsMV3Inputs
APP FusionOfClassifications
OPTIONS -il ${OTBAPP_BASELINE}/clLabeledImageQB123_1.tif
${OTBAPP_BASELINE}/clLabeledImageQB456_1.tif
${OTBAPP_BASELINE}/clLabeledImageQB1.tif
-undecided 100
-out ${TEMP}/apTvFusionOfClassifications3InputsOutput.tif uint16
-method majorityvoting
-undecidedlabel 100
-out ${TEMP}/apTvFusionOfClassificationsMV3InputsOutput.tif uint16
VALID --compare-image ${NOTOL}
${OTBAPP_BASELINE}/apTvFusionOfClassifications3InputsOutput.tif
${TEMP}/apTvFusionOfClassifications3InputsOutput.tif
${TEMP}/apTvFusionOfClassificationsMV3InputsOutput.tif
)
OTB_TEST_APPLICATION(NAME apTvFusionOfClassificationsDSPrecision6Inputs
APP FusionOfClassifications
OPTIONS -il ${INPUTDATA}/Classification/QB_1_ortho_C1.tif
${INPUTDATA}/Classification/QB_1_ortho_C2.tif
${INPUTDATA}/Classification/QB_1_ortho_C3.tif
${INPUTDATA}/Classification/QB_1_ortho_C4.tif
${INPUTDATA}/Classification/QB_1_ortho_C5.tif
${INPUTDATA}/Classification/QB_1_ortho_C6.tif
-method dempstershafer
-method.dempstershafer.cmfl ${INPUTDATA}/Classification/QB_1_ortho_C1.csv
${INPUTDATA}/Classification/QB_1_ortho_C2.csv
${INPUTDATA}/Classification/QB_1_ortho_C3.csv
${INPUTDATA}/Classification/QB_1_ortho_C4.csv
${INPUTDATA}/Classification/QB_1_ortho_C5.csv
${INPUTDATA}/Classification/QB_1_ortho_C6.csv
-method.dempstershafer.mob precision
-nodatalabel 10
-undecidedlabel 7
-out ${TEMP}/apTvFusionOfClassificationsDS6InputsPrecisionOutput.tif uint8
VALID --compare-image ${NOTOL}
${BASELINE}/QB_1_ortho_DS_FUSED_PRECISION.tif
${TEMP}/apTvFusionOfClassificationsDS6InputsPrecisionOutput.tif
)
OTB_TEST_APPLICATION(NAME apTvFusionOfClassificationsDSRecall6Inputs
APP FusionOfClassifications
OPTIONS -il ${INPUTDATA}/Classification/QB_1_ortho_C1.tif
${INPUTDATA}/Classification/QB_1_ortho_C2.tif
${INPUTDATA}/Classification/QB_1_ortho_C3.tif
${INPUTDATA}/Classification/QB_1_ortho_C4.tif
${INPUTDATA}/Classification/QB_1_ortho_C5.tif
${INPUTDATA}/Classification/QB_1_ortho_C6.tif
-method dempstershafer
-method.dempstershafer.cmfl ${INPUTDATA}/Classification/QB_1_ortho_C1.csv
${INPUTDATA}/Classification/QB_1_ortho_C2.csv
${INPUTDATA}/Classification/QB_1_ortho_C3.csv
${INPUTDATA}/Classification/QB_1_ortho_C4.csv
${INPUTDATA}/Classification/QB_1_ortho_C5.csv
${INPUTDATA}/Classification/QB_1_ortho_C6.csv
-method.dempstershafer.mob recall
-nodatalabel 10
-undecidedlabel 7
-out ${TEMP}/apTvFusionOfClassificationsDS6InputsRecallOutput.tif uint8
VALID --compare-image ${NOTOL}
${BASELINE}/QB_1_ortho_DS_FUSED_RECALL.tif
${TEMP}/apTvFusionOfClassificationsDS6InputsRecallOutput.tif
)
OTB_TEST_APPLICATION(NAME apTvFusionOfClassificationsDSAccuracy6Inputs
APP FusionOfClassifications
OPTIONS -il ${INPUTDATA}/Classification/QB_1_ortho_C1.tif
${INPUTDATA}/Classification/QB_1_ortho_C2.tif
${INPUTDATA}/Classification/QB_1_ortho_C3.tif
${INPUTDATA}/Classification/QB_1_ortho_C4.tif
${INPUTDATA}/Classification/QB_1_ortho_C5.tif
${INPUTDATA}/Classification/QB_1_ortho_C6.tif
-method dempstershafer
-method.dempstershafer.cmfl ${INPUTDATA}/Classification/QB_1_ortho_C1.csv
${INPUTDATA}/Classification/QB_1_ortho_C2.csv
${INPUTDATA}/Classification/QB_1_ortho_C3.csv
${INPUTDATA}/Classification/QB_1_ortho_C4.csv
${INPUTDATA}/Classification/QB_1_ortho_C5.csv
${INPUTDATA}/Classification/QB_1_ortho_C6.csv
-method.dempstershafer.mob accuracy
-nodatalabel 10
-undecidedlabel 7
-out ${TEMP}/apTvFusionOfClassificationsDS6InputsAccuracyOutput.tif uint8
VALID --compare-image ${NOTOL}
${BASELINE}/QB_1_ortho_DS_FUSED_ACCURACY.tif
${TEMP}/apTvFusionOfClassificationsDS6InputsAccuracyOutput.tif
)
OTB_TEST_APPLICATION(NAME apTvFusionOfClassificationsDSKappa6Inputs
APP FusionOfClassifications
OPTIONS -il ${INPUTDATA}/Classification/QB_1_ortho_C1.tif
${INPUTDATA}/Classification/QB_1_ortho_C2.tif
${INPUTDATA}/Classification/QB_1_ortho_C3.tif
${INPUTDATA}/Classification/QB_1_ortho_C4.tif
${INPUTDATA}/Classification/QB_1_ortho_C5.tif
${INPUTDATA}/Classification/QB_1_ortho_C6.tif
-method dempstershafer
-method.dempstershafer.cmfl ${INPUTDATA}/Classification/QB_1_ortho_C1.csv
${INPUTDATA}/Classification/QB_1_ortho_C2.csv
${INPUTDATA}/Classification/QB_1_ortho_C3.csv
${INPUTDATA}/Classification/QB_1_ortho_C4.csv
${INPUTDATA}/Classification/QB_1_ortho_C5.csv
${INPUTDATA}/Classification/QB_1_ortho_C6.csv
-method.dempstershafer.mob kappa
-nodatalabel 10
-undecidedlabel 7
-out ${TEMP}/apTvFusionOfClassificationsDS6InputsKappaOutput.tif uint8
VALID --compare-image ${NOTOL}
${BASELINE}/QB_1_ortho_DS_FUSED_KAPPA.tif
${TEMP}/apTvFusionOfClassificationsDS6InputsKappaOutput.tif
)
......
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