From 0dc226a9e64821a4165cc5f35d0abe0e0b2d95e3 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Tue, 11 Oct 2011 11:44:00 +0200
Subject: [PATCH] DOC: improve doc and logs of classification chain

---
 .../otbEstimateImagesStatistics.cxx           |  6 +++---
 .../Classification/otbImageSVMClassifier.cxx  | 19 +++++++++----------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/Applications/Classification/otbEstimateImagesStatistics.cxx b/Applications/Classification/otbEstimateImagesStatistics.cxx
index c1d5348a9d..2ba7b25333 100644
--- a/Applications/Classification/otbEstimateImagesStatistics.cxx
+++ b/Applications/Classification/otbEstimateImagesStatistics.cxx
@@ -44,7 +44,7 @@ private:
   EstimateImagesStatistics()
   {
     SetName("EstimateImagesStatistics");
-    SetDescription("Estimate mean/standard deviation for all images in the input list. Possibility to write the output in an xml file or just display the result.");
+    SetDescription("Estimate mean/standard deviation for all images in the input list and optionally save the results in an XML file");
   }
 
   virtual ~EstimateImagesStatistics()
@@ -54,8 +54,8 @@ private:
   void DoCreateParameters()
   {
     AddParameter(ParameterType_InputImageList, "il", "Input Image List");
-    AddParameter(ParameterType_Filename, "out", "Output xml file");
-    SetParameterDescription( "out", "If set, will write the statistics into the given html file." );
+    AddParameter(ParameterType_Filename, "out", "Output XML file");
+    SetParameterDescription( "out", "Name of the XML file where the statistics are saved for future reuse" );
     MandatoryOff("out");
   }
 
diff --git a/Applications/Classification/otbImageSVMClassifier.cxx b/Applications/Classification/otbImageSVMClassifier.cxx
index 61ffdc9ca1..f28ecc476e 100644
--- a/Applications/Classification/otbImageSVMClassifier.cxx
+++ b/Applications/Classification/otbImageSVMClassifier.cxx
@@ -70,7 +70,7 @@ private:
   ImageSVMClassifier()
   {
     SetName("ImageSVMClassifier");
-    SetDescription("Perform SVM classification based a previous computed svm model to an new input image.");
+    SetDescription("Perform SVM classification based a previous computed SVM model");
   }
 
   virtual ~ImageSVMClassifier()
@@ -91,7 +91,7 @@ private:
     MandatoryOff("imstat");
 
     AddParameter(ParameterType_Filename, "svm", "SVM Model.");
-    SetParameterDescription("svm", "An estimated svm model previously computed");
+    SetParameterDescription("svm", "An estimated SVM model previously computed");
     
     AddParameter(ParameterType_OutputImage, "out",  "Output Image");
     SetParameterDescription( "out", "Output labeled image");
@@ -105,16 +105,15 @@ private:
 
   void DoExecute()
   {
-    otbAppLogDEBUG("Entering DoExecute");
-
     // Load input image
     FloatVectorImageType::Pointer inImage = GetParameterImage("in");
     inImage->UpdateOutputInformation();
 
     // Load svm model
+    otbAppLogINFO("Loading SVM model");
     m_ModelSVM = ModelType::New();
     m_ModelSVM->LoadModel(GetParameterString("svm").c_str());
-
+    otbAppLogINFO("SVM model loaded");
 
     // Normalize input image (optional)
     StatisticsReader::Pointer  statisticsReader = StatisticsReader::New();
@@ -129,13 +128,13 @@ private:
     // Normalize input image if asked
     if( HasValue("imstat")  )
       {
-      otbAppLogDEBUG("Input image normalization activated.");
+      otbAppLogINFO("Input image normalization activated.");
       // Load input image statistics
       statisticsReader->SetFileName(GetParameterString("imstat"));
       meanMeasurementVector   = statisticsReader->GetStatisticVectorByName("mean");
       stddevMeasurementVector = statisticsReader->GetStatisticVectorByName("stddev");
-      otbAppLogDEBUG( "mean used: " << meanMeasurementVector );
-      otbAppLogDEBUG( "standard deviation used: " << stddevMeasurementVector );
+      otbAppLogINFO( "mean used: " << meanMeasurementVector );
+      otbAppLogINFO( "standard deviation used: " << stddevMeasurementVector );
       // Rescale vector image
       m_Rescaler->SetScale(stddevMeasurementVector);
       m_Rescaler->SetShift(meanMeasurementVector);
@@ -145,14 +144,14 @@ private:
       }
     else
       {
-      otbAppLogDEBUG("Input image normalization deactivated.");
+      otbAppLogINFO("Input image normalization deactivated.");
       m_ClassificationFilter->SetInput(inImage);
       }
     
   
     if( HasValue("mask")  )
       {
-      otbAppLogDEBUG("Use input mask.");
+      otbAppLogINFO("Using input mask");
       // Load mask image and cast into LabeledImageType
       FloatVectorImageType::Pointer inMask = GetParameterImage("mask");
       ExtractImageFilterType::Pointer extract = ExtractImageFilterType::New();
-- 
GitLab