Commit 11fd397c authored by Julien Michel's avatar Julien Michel

BUG: Fixing 2 bugs (inxml parameters appears twice, and size of measurements vector is not set)

parent c57142a2
...@@ -57,8 +57,8 @@ private: ...@@ -57,8 +57,8 @@ private:
AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile"); AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile");
SetParameterDescription("inshp","Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile");
AddParameter(ParameterType_InputFilename, "outxml", "XML file containing mean and variance of each feature."); AddParameter(ParameterType_InputFilename, "outstats", "XML file containing mean and variance of each feature.");
SetParameterDescription("outxml", "XML file containing mean and variance of each feature."); SetParameterDescription("outstats", "XML file containing mean and variance of each feature.");
AddParameter(ParameterType_ListView, "feat", "List of features to consider for statistics."); AddParameter(ParameterType_ListView, "feat", "List of features to consider for statistics.");
SetParameterDescription("feat","List of features to consider for statistics."); SetParameterDescription("feat","List of features to consider for statistics.");
...@@ -100,7 +100,7 @@ private: ...@@ -100,7 +100,7 @@ private:
clock_t tic = clock(); clock_t tic = clock();
const char * shapefile = GetParameterString("inshp").c_str(); const char * shapefile = GetParameterString("inshp").c_str();
const char * XMLfile = GetParameterString("outxml").c_str(); const char * XMLfile = GetParameterString("outstats").c_str();
otb::ogr::DataSource::Pointer source = otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Read); otb::ogr::DataSource::Pointer source = otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Read);
......
...@@ -63,8 +63,8 @@ private: ...@@ -63,8 +63,8 @@ private:
AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile"); AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile");
SetParameterDescription("inshp","Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile");
AddParameter(ParameterType_InputFilename, "inxml", "XML file containing mean and variance of each feature."); AddParameter(ParameterType_InputFilename, "instats", "XML file containing mean and variance of each feature.");
SetParameterDescription("inxml", "XML file containing mean and variance of each feature."); SetParameterDescription("instats", "XML file containing mean and variance of each feature.");
AddParameter(ParameterType_OutputFilename, "insvm", "Input model filename."); AddParameter(ParameterType_OutputFilename, "insvm", "Input model filename.");
SetParameterDescription("insvm", "Input model filename."); SetParameterDescription("insvm", "Input model filename.");
...@@ -115,7 +115,7 @@ private: ...@@ -115,7 +115,7 @@ private:
clock_t tic = clock(); clock_t tic = clock();
const char * shapefile = GetParameterString("inshp").c_str(); const char * shapefile = GetParameterString("inshp").c_str();
const char * XMLfile = GetParameterString("xml").c_str(); const char * XMLfile = GetParameterString("instats").c_str();
const char * modelfile = GetParameterString("insvm").c_str(); const char * modelfile = GetParameterString("insvm").c_str();
typedef double ValueType; typedef double ValueType;
...@@ -143,6 +143,7 @@ private: ...@@ -143,6 +143,7 @@ private:
ListSampleType::Pointer input = ListSampleType::New(); ListSampleType::Pointer input = ListSampleType::New();
LabelListSampleType::Pointer target = LabelListSampleType::New(); LabelListSampleType::Pointer target = LabelListSampleType::New();
const int nbFeatures = GetSelectedItems("feat").size(); const int nbFeatures = GetSelectedItems("feat").size();
input->SetMeasurementVectorSize(nbFeatures);
if(feature.addr()) if(feature.addr())
while(goesOn) while(goesOn)
......
...@@ -63,8 +63,8 @@ private: ...@@ -63,8 +63,8 @@ private:
AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile"); AddParameter(ParameterType_InputFilename, "inshp", "Name of the input shapefile");
SetParameterDescription("inshp","Name of the input shapefile"); SetParameterDescription("inshp","Name of the input shapefile");
AddParameter(ParameterType_InputFilename, "inxml", "XML file containing mean and variance of each feature."); AddParameter(ParameterType_InputFilename, "instats", "XML file containing mean and variance of each feature.");
SetParameterDescription("inxml", "XML file containing mean and variance of each feature."); SetParameterDescription("instats", "XML file containing mean and variance of each feature.");
AddParameter(ParameterType_OutputFilename, "outsvm", "Output model filename."); AddParameter(ParameterType_OutputFilename, "outsvm", "Output model filename.");
SetParameterDescription("outsvm", "Output model filename."); SetParameterDescription("outsvm", "Output model filename.");
...@@ -114,7 +114,7 @@ private: ...@@ -114,7 +114,7 @@ private:
clock_t tic = clock(); clock_t tic = clock();
const char * shapefile = GetParameterString("inshp").c_str(); const char * shapefile = GetParameterString("inshp").c_str();
const char * XMLfile = GetParameterString("inxml").c_str(); const char * XMLfile = GetParameterString("instats").c_str();
const char * modelfile = GetParameterString("outsvm").c_str(); const char * modelfile = GetParameterString("outsvm").c_str();
typedef double ValueType; typedef double ValueType;
...@@ -133,7 +133,7 @@ private: ...@@ -133,7 +133,7 @@ private:
MeasurementType meanMeasurementVector = statisticsReader->GetStatisticVectorByName("mean"); MeasurementType meanMeasurementVector = statisticsReader->GetStatisticVectorByName("mean");
MeasurementType stddevMeasurementVector = statisticsReader->GetStatisticVectorByName("stddev"); MeasurementType stddevMeasurementVector = statisticsReader->GetStatisticVectorByName("stddev");
otb::ogr::DataSource::Pointer source = otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Read); otb::ogr::DataSource::Pointer source = otb::ogr::DataSource::New(shapefile, otb::ogr::DataSource::Modes::Read);
otb::ogr::Layer layer = source->GetLayer(0); otb::ogr::Layer layer = source->GetLayer(0);
bool goesOn = true; bool goesOn = true;
...@@ -142,7 +142,9 @@ private: ...@@ -142,7 +142,9 @@ private:
ListSampleType::Pointer input = ListSampleType::New(); ListSampleType::Pointer input = ListSampleType::New();
LabelListSampleType::Pointer target = LabelListSampleType::New(); LabelListSampleType::Pointer target = LabelListSampleType::New();
const int nbFeatures = GetSelectedItems("feat").size(); const int nbFeatures = GetSelectedItems("feat").size();
input->SetMeasurementVectorSize(nbFeatures);
if(feature.addr()) if(feature.addr())
while(goesOn) while(goesOn)
{ {
......
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