2 Commitit 447307e38d ... 9e03d98750

Tekijä SHA1 Viesti Päivämäärä
  Sven Sickert 9e03d98750 removed dependencies on deprecated Filter.h 8 vuotta sitten
  Sven Sickert 5d712edde4 minor name change 8 vuotta sitten

+ 1 - 1
semseg/SemSegContextTree3D.cpp

@@ -1597,7 +1597,7 @@ void SemSegContextTree3D::classify (
                 }
 
 #ifdef VISUALIZE
-        getProbabilityMap( probabilities );
+        saveProbabilityMapAsImage( probabilities );
 #endif
     }
     else

+ 1 - 1
semseg/SemanticSegmentation.cpp

@@ -274,7 +274,7 @@ void SemanticSegmentation::setClassNames ( const OBJREC::ClassNames * _className
     this->classNames = _classNames;
 }
 
-void SemanticSegmentation::getProbabilityMap ( const NICE::MultiChannelImage3DT<double> & prob )
+void SemanticSegmentation::saveProbabilityMapAsImage ( const NICE::MultiChannelImage3DT<double> & prob )
 {
     std::string s;
 

+ 4 - 4
semseg/SemanticSegmentation.h

@@ -236,20 +236,20 @@ class SemanticSegmentation : public NICE::Persistent
     }
 
     /**
-     * @brief Save probability maps of all classes to iamge files
+     * @brief Save probability maps of all classes to image files
      * @author Sven Sickert
      * @param prob class probability maps
      */
-    void getProbabilityMap( const NICE::MultiChannelImage3DT<double> & prob );
+    void saveProbabilityMapAsImage( const NICE::MultiChannelImage3DT<double> & prob );
 
     /**
      * @author Alexander Freytag
      * @date 06-02-2014 ( dd-mm-yyyy )
      */
     void setClassNames ( const OBJREC::ClassNames * _classNames  ) ;
-    
+
     void setIterationCountSuffix( const int & _iterationCountSuffix);
-    
+
     ///////////////////// INTERFACE PERSISTENT /////////////////////
     // interface specific methods for store and restore
     ///////////////////// INTERFACE PERSISTENT /////////////////////

+ 14 - 14
semseg/postsegmentation/RelativeLocationPrior.cpp

@@ -1,6 +1,6 @@
 #include "RelativeLocationPrior.h"
 
-#include "core/image/Filter.h"
+#include "core/image/FilterT.h"
 
 using namespace std;
 using namespace NICE;
@@ -104,9 +104,9 @@ void RelativeLocationPrior::finishPriorsMaps ( ClassNames &cn )
     }
   }
 
-  double sigma = 0.1 * ( double ) mapsize; // 10% der Breite/Höhe der Maps
+  double sigma = 0.1 * ( double ) mapsize; // 10 percent of the maps height/width
 
-  // alle Priormaps weichzeichnen
+  // Smoothing the maps
   for ( int j = 0; j < classno; j++ )
   {
     for ( int i = 0; i < classno; i++ )
@@ -122,8 +122,8 @@ void RelativeLocationPrior::finishPriorsMaps ( ClassNames &cn )
       }
 
       NICE::FloatImage out;
-      //FourierLibrary::gaussFilterD(tmp, out, sigma);
-      NICE::filterGaussSigmaApproximate<float, float, float> ( tmp, sigma, &out );
+      NICE::FilterT<float,float,float> filter;
+      filter.filterGaussSigmaApproximate( tmp, sigma, &out );
 
       for ( int x = 0; x < mapsize; x++ )
       {
@@ -135,7 +135,7 @@ void RelativeLocationPrior::finishPriorsMaps ( ClassNames &cn )
     }
   }
 
-  // Summe aller Pixel an einer Position über jede Klasse = 1
+  // Sum of all pixels over all classes at a certain position equals 1
   for ( int i = 0; i < classno; i++ )
   {
     for ( int x = 0; x < mapsize; x++ )
@@ -239,7 +239,7 @@ void RelativeLocationPrior::finishPriorsMaps ( ClassNames &cn )
 
 void RelativeLocationPrior::trainClassifier ( Examples &regions, NICE::MultiChannelImageT<double> & probabilities )
 {
-  // für alle Regionen einen Merkmalsvektor erzeugen und diesen der Trainingsmenge hinzufügen
+  // Creating a feature vector for all regions and adding it to the training set
   getFeature ( regions, probabilities );
 
   for ( int i = 0; i < ( int ) regions.size(); i++ )
@@ -251,9 +251,9 @@ void RelativeLocationPrior::trainClassifier ( Examples &regions, NICE::MultiChan
 
 void RelativeLocationPrior::finishClassifier()
 {
-  //////////////////////////////
-  // Klassifikatoren anlernen //
-  //////////////////////////////
+  //////////////////////
+  // Train Classifier //
+  //////////////////////
   FeaturePool fp;
   Feature *f = new SparseVectorFeature ( featdim );
   f->explode ( fp );
@@ -404,7 +404,7 @@ void RelativeLocationPrior::getFeature ( Examples &regions, NICE::MultiChannelIm
     alpha.push_back ( tmpalpha );
   }
 
-  //erzeuge f_relloc
+  // create f_relloc
   vector<vector<double> > vother;
   vector<vector<double> > vself;
   for ( int i = 0; i < ( int ) regions.size(); i++ )
@@ -430,7 +430,7 @@ void RelativeLocationPrior::getFeature ( Examples &regions, NICE::MultiChannelIm
 
         double val = priormaps[c]->get ( x, y, bestclasses[j] ) * alpha[j]; ;
 
-        if ( bestclasses[j] == bestclasses[i] ) //Objektbestandteile
+        if ( bestclasses[j] == bestclasses[i] ) //parts of the object
         {
           tmp_self += val;
         }
@@ -469,7 +469,7 @@ void RelativeLocationPrior::getFeature ( Examples &regions, NICE::MultiChannelIm
 
     for ( int i = 0; i < classno; i++ )
     {
-      //appearence feature (old probability for each class
+      //appearence feature (old probability for each class)
       double fapp = log ( probabilities.get ( regions[r].second.x, regions[r].second.y, i ) );
 
       if ( fabs ( fapp ) > 10e-7 )
@@ -497,7 +497,7 @@ void RelativeLocationPrior::restore ( istream & is, int format )
   is >> mapsize;
   is >> featdim;
 
-  //Priorsmaps erzeugen
+  // Create prior maps
   for ( int i = 0; i < classno; i++ )
   {
     NICE::MultiChannelImageT<double> *tmp  = new NICE::MultiChannelImageT<double> ( mapsize, mapsize, classno);