Skip to content
Snippets Groups Projects
Commit d019ce47 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: remove poupees image for example

parent 7e972750
Branches
Tags
No related merge requests found
......@@ -25,9 +25,7 @@
#include "itkImageRegionSplitter.h"
#include "otbStreamingTraits.h"
#include "itkImageRegionConstIterator.h"
// #include "itkListSample.h"
#include "itkImageRandomNonRepeatingConstIteratorWithIndex.h"
//#include "itkMersenneTwisterRandomVariateGenerator.h"
namespace otb
{
......@@ -167,13 +165,13 @@ private:
SetDefaultParameterFloat("iv", 0.0);
// Doc example parameter settings
SetDocExampleParameterValue("in", "poupees_sub.png");
SetDocExampleParameterValue("out","poupees_classif.tif");
SetDocExampleParameterValue("vm", "BASELINE/leSOMPoupeesClassified.hdr");
SetDocExampleParameterValue("in", "QB_6_extract.tif");
SetDocExampleParameterValue("out","SOMClassification.tif");
SetDocExampleParameterValue("vm", "QB_6_mask.tif");
SetDocExampleParameterValue("tp", "1.0");
SetDocExampleParameterValue("ts","16384");
SetDocExampleParameterValue("sl", "32");
SetDocExampleParameterValue("som", "poupees_map.hdr");
SetDocExampleParameterValue("som", "SOMClassification_Map.tif");
SetDocExampleParameterValue("sx", "32");
SetDocExampleParameterValue("sy", "32");
SetDocExampleParameterValue("nx", "10");
......@@ -350,34 +348,36 @@ private:
}
otbAppLogINFO("The final training set contains "<<totalSamples<<" samples.");
/*******************************************/
/* Learning */
/*******************************************/
otbAppLogINFO("-- LEARNING --");
EstimatorType::Pointer estimator = EstimatorType::New();
estimator->SetListSample(sampleList);
EstimatorType::SizeType size;
size[0]=GetParameterInt("sx");
size[1]=GetParameterInt("sy");
estimator->SetMapSize(size);
EstimatorType::SizeType radius;
radius[0] = GetParameterInt("nx");
radius[1] = GetParameterInt("ny");
estimator->SetNeighborhoodSizeInit(radius);
estimator->SetNumberOfIterations(GetParameterInt("ni"));
estimator->SetBetaInit(GetParameterFloat("bi"));
estimator->SetBetaEnd(GetParameterFloat("bf"));
estimator->SetMaxWeight(GetParameterFloat("iv"));
/*******************************************/
/* Learning */
/*******************************************/
otbAppLogINFO("-- LEARNING --");
EstimatorType::Pointer estimator = EstimatorType::New();
estimator->SetListSample(sampleList);
EstimatorType::SizeType size;
size[0]=GetParameterInt("sx");
size[1]=GetParameterInt("sy");
estimator->SetMapSize(size);
EstimatorType::SizeType radius;
radius[0] = GetParameterInt("nx");
radius[1] = GetParameterInt("ny");
estimator->SetNeighborhoodSizeInit(radius);
estimator->SetNumberOfIterations(GetParameterInt("ni"));
estimator->SetBetaInit(GetParameterFloat("bi"));
estimator->SetBetaEnd(GetParameterFloat("bf"));
estimator->SetMaxWeight(GetParameterFloat("iv"));
AddProcess(estimator,"Learning");
estimator->Update();
m_SOMMap = estimator->GetOutput();
if (HasValue("som"))
{
otbAppLogINFO("-- Using Leaning image --");
SetParameterOutputImage<DoubleVectorImageType>("som", m_SOMMap);
}
......
......@@ -72,7 +72,7 @@ private:
AddParameter(ParameterType_Float, "ty", "The Y translation (in physical units)");
// Doc example parameter settings
SetDocExampleParameterValue("in", "poupees.tif");
SetDocExampleParameterValue("in", "QB_MUL_ROI_1000_100.tif");
SetDocExampleParameterValue("out", "rigitTransformImage.tif");
SetDocExampleParameterValue("tx", "5");
SetDocExampleParameterValue("ty", "5");
......
......@@ -81,7 +81,7 @@ private:
"The mathematical expression to apply. \nUse im1b1 for the first band, im1b2 for the second one...");
// Doc example parameter settings
SetDocExampleParameterValue("il", "poupees_sub_c1.png poupees_sub_c2.png poupees_sub_png");
SetDocExampleParameterValue("il", "verySmallFSATSW_r.tif verySmallFSATSW_nir.tif verySmallFSATSW.tif");
SetDocExampleParameterValue("out", "apTvUtBandMathOutput.tif");
SetDocExampleParameterValue("exp", "\"cos(im1b1)+im2b1*im3b1-im3b2+ndvi(im3b3, im3b4)\"");
}
......
......@@ -91,8 +91,8 @@ private:
MandatoryOff("ram");
// Doc example parameter settings
SetDocExampleParameterValue("il", "poupees_sub_c1.png poupees_sub_c2.png poupees_sub_c3.png");
SetDocExampleParameterValue("out", "otbConcatenateImages.png uchar");
SetDocExampleParameterValue("il", "verySmallFSATSW_b.tif verySmallFSATSW_g.tif verySmallFSATSW_r.tif verySmallFSATSW_nir.tif");
SetDocExampleParameterValue("out", "otbConcatenateImages.tif");
}
void DoUpdateParameters()
......
......@@ -69,100 +69,127 @@ private:
MandatoryOff("keywordlist");
//Create output parameters to store image informations
AddParameter(ParameterType_Int,"sizex","Size X");
GetParameterByKey("sizex")->SetRole(Role_Output);
SetParameterRole("sizex", Role_Output);
MandatoryOff("sizex");
AddParameter(ParameterType_Int,"sizey","Size Y");
GetParameterByKey("sizey")->SetRole(Role_Output);
SetParameterRole("sizey", Role_Output);
MandatoryOff("sizey");
AddParameter(ParameterType_Int,"spacingx","Pixel Size X");
GetParameterByKey("spacingx")->SetRole(Role_Output);
SetParameterRole("spacingx", Role_Output);
MandatoryOff("spacingx");
AddParameter(ParameterType_Int,"spacingy","Pixel Size Y");
GetParameterByKey("spacingy")->SetRole(Role_Output);
SetParameterRole("spacingy", Role_Output);
MandatoryOff("spacingy");
AddParameter(ParameterType_Int,"numberbands","Number Of Bands");
GetParameterByKey("numberbands")->SetRole(Role_Output);
SetParameterRole("numberbands", Role_Output);
MandatoryOff("numberbands");
AddParameter(ParameterType_String,"sensor","Sensor id");
GetParameterByKey("sensor")->SetRole(Role_Output);
SetParameterRole("sensor", Role_Output);
MandatoryOff("sensor");
AddParameter(ParameterType_String,"id","Id of the image");
GetParameterByKey("id")->SetRole(Role_Output);
SetParameterRole("id", Role_Output);
MandatoryOff("id");
AddParameter(ParameterType_String,"time","Acquisition time");
GetParameterByKey("time")->SetRole(Role_Output);
SetParameterRole("time", Role_Output);
MandatoryOff("time");
AddParameter(ParameterType_Float,"ullat","Upper left lattitude");
GetParameterByKey("ullat")->SetRole(Role_Output);
SetParameterRole("ullat", Role_Output);
SetDefaultParameterFloat("ullat", 0);
MandatoryOff("ullat");
AddParameter(ParameterType_Float,"ullon","Upper left longitude");
GetParameterByKey("ullon")->SetRole(Role_Output);
SetParameterRole("ullon", Role_Output);
SetDefaultParameterFloat("ullon", 0);
MandatoryOff("ullon");
AddParameter(ParameterType_Float,"urlat","Upper right lattitude");
GetParameterByKey("urlat")->SetRole(Role_Output);
SetParameterRole("urlat", Role_Output);
SetDefaultParameterFloat("urlat", 0);
MandatoryOff("urlat");
AddParameter(ParameterType_Float,"urlon","Upper right longitude");
GetParameterByKey("urlon")->SetRole(Role_Output);
SetParameterRole("urlon", Role_Output);
SetDefaultParameterFloat("urlon", 0);
MandatoryOff("urlon");
AddParameter(ParameterType_Float,"lrlat","Lower right lattitude");
GetParameterByKey("lrlat")->SetRole(Role_Output);
SetParameterRole("lrlat", Role_Output);
SetDefaultParameterFloat("lrlat", 0);
MandatoryOff("lrlat");
AddParameter(ParameterType_Float,"lrlon","Lower right longitude");
GetParameterByKey("lrlon")->SetRole(Role_Output);
SetParameterRole("lrlon", Role_Output);
SetDefaultParameterFloat("lrlon", 0);
MandatoryOff("lrlon");
AddParameter(ParameterType_Float,"lllat","Lower left lattitude");
GetParameterByKey("lllat")->SetRole(Role_Output);
SetParameterRole("lllat", Role_Output);
SetDefaultParameterFloat("lllat", 0);
MandatoryOff("lllat");
AddParameter(ParameterType_Float,"lllon","Lower left longitude");
GetParameterByKey("lllon")->SetRole(Role_Output);
SetParameterRole("lllon", Role_Output);
SetDefaultParameterFloat("lllon", 0);
MandatoryOff("lllon");
AddParameter(ParameterType_String,"town","Main town near center of image");
GetParameterByKey("town")->SetRole(Role_Output);
SetParameterRole("town", Role_Output);
MandatoryOff("town");
AddParameter(ParameterType_String,"country","Country of the image");
GetParameterByKey("country")->SetRole(Role_Output);
SetParameterRole("country", Role_Output);
MandatoryOff("country");
AddParameter(ParameterType_Group, "rgb", "Default RGB Display");
SetParameterDescription("rgb","This group of parameters allows to access to the default rgb composition.");
GetParameterByKey("rgb")->SetRole(Role_Output);
SetParameterRole("rgb", Role_Output);
MandatoryOff("rgb");
AddParameter(ParameterType_Int, "rgb.r", "Red Band");
SetParameterDescription("rgb.r","Red band Number");
SetDefaultParameterInt("rgb.r", 1);
GetParameterByKey("rgb.r")->SetRole(Role_Output);
SetParameterRole("rgb.r", Role_Output);
MandatoryOff("rgb.r");
AddParameter(ParameterType_Int, "rgb.g", "Green Band");
SetParameterDescription("rgb.g","Green band Number");
SetDefaultParameterInt("rgb.g", 2);
GetParameterByKey("rgb.g")->SetRole(Role_Output);
SetParameterRole("rgb.g", Role_Output);
MandatoryOff("rgb.g");
AddParameter(ParameterType_Int, "rgb.b", "Blue Band");
SetParameterDescription("rgb.b","Blue band Number");
SetDefaultParameterInt("rgb.b", 3);
GetParameterByKey("rgb.b")->SetRole(Role_Output);
SetParameterRole("rgb.b", Role_Output);
MandatoryOff("rgb.b");
AddParameter(ParameterType_String,"projectionref","Projection Coordinate System");
GetParameterByKey("projectionref")->SetRole(Role_Output);
SetParameterRole("projectionref", Role_Output);
MandatoryOff("projectionref");
AddParameter(ParameterType_String,"keyword","Image Keywordlist");
GetParameterByKey("keyword")->SetRole(Role_Output);
SetParameterRole("keyword", Role_Output);
MandatoryOff("keyword");
AddParameter(ParameterType_Group, "gcp", "Ground Control Points informations");
SetParameterDescription("gcp","This group of parameters allows to access to the GCPs informations.");
GetParameterByKey("gcp")->SetRole(Role_Output);
SetParameterRole("gcp", Role_Output);
MandatoryOff("gcp");
AddParameter(ParameterType_Int, "gcp.count", "GCPs Number");
SetParameterDescription("gcp.count","Number of GCPs");
SetDefaultParameterInt("gcp.count", 0);
GetParameterByKey("gcp.count")->SetRole(Role_Output);
SetParameterRole("gcp.count", Role_Output);
MandatoryOff("gcp.count");
AddParameter(ParameterType_String,"gcp.proj","GCP Projection System");
GetParameterByKey("gcp.proj")->SetRole(Role_Output);
SetParameterRole("gcp.proj", Role_Output);
MandatoryOff("gcp.proj");
AddParameter(ParameterType_StringList,"gcp.ids","GCPs Id");
//GetParameterByKey("gcp.ids")->SetRole(Role_Output);
//SetParameterRole("gcp.ids", Role_Output);
MandatoryOff("gcp.ids");
AddParameter(ParameterType_StringList,"gcp.info","GCPs Info");
//GetParameterByKey("gcp.info")->SetRole(Role_Output);
//SetParameterRole("gcp.info", Role_Output)
MandatoryOff("gcp.info");
// Doc example parameter settings
SetDocExampleParameterValue("in", "QB_Toulouse_Ortho_XS.tif");
......
......@@ -86,10 +86,10 @@ private:
MandatoryOff("outmax");
// Doc example parameter settings
SetDocExampleParameterValue("in", "poupees.tif");
SetDocExampleParameterValue("in", "QB_MUL_ROI_1000_100.tif");
SetDocExampleParameterValue("out", "rescaledImage.tif");
SetDocExampleParameterValue("outmin", "20");
SetDocExampleParameterValue("outmax", "150");
SetDocExampleParameterValue("outmin", "0");
SetDocExampleParameterValue("outmax", "255");
}
void DoUpdateParameters()
......
......@@ -108,8 +108,8 @@ private:
SetDocExampleParameterValue("type", "mean");
unsigned int exId = AddExample( "Image smoothing using an anisotropic diffusion filter." );
SetDocExampleParameterValue("in", "poupees.tif", exId);
SetDocExampleParameterValue("out", "smoothedImage_ani.png uchar", exId);
SetDocExampleParameterValue("in", "qb_RoadExtract.img", exId);
SetDocExampleParameterValue("out", "smoothedImage_ani.png float", exId);
SetDocExampleParameterValue("type", "anidif", exId);
SetDocExampleParameterValue("type.anidif.timestep", "0.1", exId);
SetDocExampleParameterValue("type.anidif.nbiter", "5", exId);
......
......@@ -77,7 +77,7 @@ private:
MandatoryOff("ram");
// Doc example parameter settings
SetDocExampleParameterValue("in", "poupees_sub.png");
SetDocExampleParameterValue("in", "qb_coastal.tif");
SetDocExampleParameterValue("out", "splittedImage.tif");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment