Browse Source

minor changes

Sven Sickert 12 years ago
parent
commit
cf92a0f34f
3 changed files with 21 additions and 20 deletions
  1. 11 10
      progs/testSemanticSegmentation.cpp
  2. 8 8
      semseg/SemSegContextTree.cpp
  3. 2 2
      semseg/SemSegContextTree.h

+ 11 - 10
progs/testSemanticSegmentation.cpp

@@ -72,15 +72,15 @@ int main ( int argc, char **argv )
 
   ResourceStatistics rs;
 
+  /*-------------I/O CONFIGURATION-------------*/
   bool show_result = conf.gB ( "debug", "show_results", false );
-
   bool write_results = conf.gB ( "debug", "write_results", false );
-
   bool write_results_pascal = conf.gB ( "debug", "write_results_pascal", false );
-
   bool run_3dseg = conf.gB ( "debug", "run_3dseg", true );
-
-  std::string resultdir = conf.gS ( "debug", "resultdir", "." );
+  string output_type = conf.gS ( "debug", "output_type", "ppm" );
+  string output_postfix = conf.gS ( "debug", "output_postfix", "" );
+  string resultdir = conf.gS ( "debug", "resultdir", "." );
+  /*-------------------------------------------*/
 
   if ( write_results )
   {
@@ -182,9 +182,7 @@ int main ( int argc, char **argv )
         }
 
         char filename[1024];
-
-        char *format = ( char * ) "pgm";
-        sprintf ( filename, "%s/%s.%s", resultdir.c_str(), fname.c_str(), format );
+        sprintf ( filename, "%s/%s.%s.%s", resultdir.c_str(), fname.c_str(), output_postfix.c_str(), output_type.c_str() );
         pascal_lm.write ( filename );
       }
 
@@ -210,8 +208,11 @@ int main ( int argc, char **argv )
         if ( write_results )
         {
           char filename[1024];
-          char *format = ( char * ) "ppm";
-          sprintf ( filename, "%03d_%03d.%s", imageno, fileno, format );
+          if ( output_postfix.size() > 0 )
+            sprintf ( filename, "%s.%s.%s", fname.c_str(), output_postfix.c_str(), output_type.c_str() );
+          else
+            sprintf ( filename, "%s.%s", fname.c_str(), output_type.c_str() );
+          
           std::string origfilename = resultdir + "/orig_" + string ( filename );
           cerr << "Writing to file " << origfilename << endl;
           orig.write ( origfilename );

+ 8 - 8
semseg/SemSegContextTree.cpp

@@ -168,7 +168,7 @@ SemSegContextTree::SemSegContextTree ( const Config *conf, const MultiDataset *m
 
   useWeijer = conf->gB ( featsec, "use_weijer", true );
 
-  useGaussian = conf->gB ( featsec, "use_diff_gaussian", false );
+  useAdditionalLayer = conf->gB ( featsec, "use_additional_layer", false );
   
   useVariance = conf->gB ( featsec, "use_variance", false );
 
@@ -717,7 +717,7 @@ void SemSegContextTree::train ( const MultiDataset *md )
   if ( useHoiemFeatures )
     rawChannels += 8;
 
-  if ( useGaussian )
+  if ( useAdditionalLayer )
     rawChannels += 1;
   
   if ( useVariance )
@@ -1500,14 +1500,14 @@ void SemSegContextTree::extractBasicFeatures ( NICE::MultiChannelImage3DT<double
       }
     }
 
-    if ( useGaussian )
+    if ( useAdditionalLayer )
     {
       vector<string> list;
       StringTools::split ( filelist[z], '/', list );
-      string gaussPath = StringTools::trim ( filelist[z], list.back() ) + "gaussmap/" + list.back();
-      NICE::Image gauss ( gaussPath );
-      feats_tmp.addChannel ( gauss );
-      //cout << "Added file " << gaussPath << " to feature stack " << endl;
+      string layerPath = StringTools::trim ( filelist[z], list.back() ) + "addlayer/" + list.back();
+      NICE::Image layer ( layerPath );
+      feats_tmp.addChannel ( layer );
+      //cout << "Added file " << layerPath << " to feature stack " << endl;
     }
     
     // read the geometric cues produced by Hoiem et al.
@@ -1605,7 +1605,7 @@ void SemSegContextTree::extractBasicFeatures ( NICE::MultiChannelImage3DT<double
   if ( useVariance )
   {
     int cchannel = feats.channels();
-    if (imagetype = IMAGETYPE_RGB)
+    if (imagetype == IMAGETYPE_RGB)
     {
       feats.addChannel( 3 );
       for (int c = 0; c < 3; c++)

+ 2 - 2
semseg/SemSegContextTree.h

@@ -105,8 +105,8 @@ class SemSegContextTree : public SemanticSegmentation, public NICE::Persistent
   /** use Color features from van de Weijer or not */
   bool useWeijer;
 
-  /** use Edge features from Difference of Gaussian preprocessing or not */
-  bool useGaussian;
+  /** use additional input Layer or not */
+  bool useAdditionalLayer;
 
   /** use Variance map features or not */
   bool useVariance;