Browse Source

method name changed

Sven Sickert 10 years ago
parent
commit
08a0647570

+ 2 - 2
progs/testSemSegConvTrees.cpp → progs/testSemSegObliqueTrees.cpp

@@ -11,7 +11,7 @@
 #include "core/basics/Timer.h"
 #include "core/image/Morph.h"
 
-#include "semseg/semseg/SemSegConvolutionalTree.h"
+#include "semseg/semseg/SemSegObliqueTree.h"
 #include "semseg/semseg/SemSegTools.h"
 
 #include <fstream>
@@ -40,7 +40,7 @@ int main ( int argc, char **argv )
     SemanticSegmentation *semseg = NULL;
 
     // setup actual segmentation method
-    semseg = new SemSegConvolutionalTree ( &conf, &classNames );
+    semseg = new SemSegObliqueTree ( &conf, &classNames );
 
     // training
     std::cout << "\nTRAINING" << std::endl;

+ 13 - 13
semseg/SemSegConvolutionalTree.cpp → semseg/SemSegObliqueTree.cpp

@@ -1,6 +1,6 @@
 /**
- * @file SemSegConvolutionalTree.h
- * @brief Semantic Segmentation using Covolutional Trees
+ * @file SemSegObliqueTree.h
+ * @brief Semantic Segmentation using Oblique Trees
  * @author Sven Sickert
  * @date 10/17/2014
 
@@ -8,7 +8,7 @@
 
 #include <iostream>
 
-#include "SemSegConvolutionalTree.h"
+#include "SemSegObliqueTree.h"
 #include "SemSegTools.h"
 
 #include "vislearning/classifier/fpclassifier/randomforest/FPCRandomForests.h"
@@ -22,7 +22,7 @@ using namespace NICE;
 
 //###################### CONSTRUCTORS #########################//
 
-SemSegConvolutionalTree::SemSegConvolutionalTree () : SemanticSegmentation ()
+SemSegObliqueTree::SemSegObliqueTree () : SemanticSegmentation ()
 {
     conf = NULL;
 
@@ -33,7 +33,7 @@ SemSegConvolutionalTree::SemSegConvolutionalTree () : SemanticSegmentation ()
     fpc = new FPCRandomForests ();
 }
 
-SemSegConvolutionalTree::SemSegConvolutionalTree (
+SemSegObliqueTree::SemSegObliqueTree (
         const Config *conf,
         const ClassNames *classNames )
     : SemanticSegmentation( conf, classNames )
@@ -43,7 +43,7 @@ SemSegConvolutionalTree::SemSegConvolutionalTree (
 
 //###################### DESTRUCTORS ##########################//
 
-SemSegConvolutionalTree::~SemSegConvolutionalTree ()
+SemSegObliqueTree::~SemSegObliqueTree ()
 {
     if ( fpc != NULL )
         delete fpc;
@@ -51,7 +51,7 @@ SemSegConvolutionalTree::~SemSegConvolutionalTree ()
 
 //#################### MEMBER FUNCTIONS #######################//
 
-void SemSegConvolutionalTree::preprocessChannels (
+void SemSegObliqueTree::preprocessChannels (
         CachedExample *ce,
         bool isColor ) const
 {
@@ -129,7 +129,7 @@ void SemSegConvolutionalTree::preprocessChannels (
 }
 
 
-void SemSegConvolutionalTree::initFromConfig( const Config *_conf,
+void SemSegObliqueTree::initFromConfig( const Config *_conf,
                                          const string &s_confSection )
 {
     conf = _conf;
@@ -142,7 +142,7 @@ void SemSegConvolutionalTree::initFromConfig( const Config *_conf,
 }
 
 /** training function */
-void SemSegConvolutionalTree::train ( const MultiDataset *md )
+void SemSegObliqueTree::train ( const MultiDataset *md )
 {
     if ( saveLoadData && FileMgt::fileExists( fileLocation ) )
     {
@@ -191,7 +191,7 @@ void SemSegConvolutionalTree::train ( const MultiDataset *md )
 }
 
 /** classification function */
-void SemSegConvolutionalTree::semanticseg(
+void SemSegObliqueTree::semanticseg(
         CachedExample *ce,
         Image &segresult,
         NICE::MultiChannelImageT<double> &probabilities )
@@ -227,7 +227,7 @@ void SemSegConvolutionalTree::semanticseg(
 // interface specific methods for store and restore
 ///////////////////// INTERFACE PERSISTENT /////////////////////
 
-void SemSegConvolutionalTree::restore( istream &is, int format )
+void SemSegObliqueTree::restore( istream &is, int format )
 {
     //dirty solution to circumvent the const-flag
     const_cast<ClassNames*>(this->classNames)->restore ( is, format );
@@ -235,13 +235,13 @@ void SemSegConvolutionalTree::restore( istream &is, int format )
     fpc->restore( is, format );
 }
 
-void SemSegConvolutionalTree::store ( ostream &os, int format ) const
+void SemSegObliqueTree::store ( ostream &os, int format ) const
 {
     classNames->store( os, format );
     fpc->store( os, format );
 }
 
-void SemSegConvolutionalTree::clear ( )
+void SemSegObliqueTree::clear ( )
 {
     fpc->clear();
 }

+ 9 - 9
semseg/SemSegConvolutionalTree.h → semseg/SemSegObliqueTree.h

@@ -1,13 +1,13 @@
 /**
- * @file SemSegConvolutionalTree.h
- * @brief Semantic Segmentation using Covolutional Trees
+ * @file SemSegObliqueTree.h
+ * @brief Semantic Segmentation using Oblique Trees
  * @author Sven Sickert
  * @date 10/17/2014
 
 */
 
-#ifndef SEMSEGCONVOLUTIONALTREEINCLUDE
-#define SEMSEGCONVOLUTIONALTREEINCLUDE
+#ifndef SEMSEGOBLIQUETEEINCLUDE
+#define SEMSEGOBLIQUETEEINCLUDE
 
 // nice-core includes
 
@@ -20,7 +20,7 @@
 namespace OBJREC
 {
 
-class SemSegConvolutionalTree : public SemanticSegmentation
+class SemSegObliqueTree : public SemanticSegmentation
 {
     private:
 
@@ -49,14 +49,14 @@ class SemSegConvolutionalTree : public SemanticSegmentation
     public:
 
         /** simple constructor */
-        SemSegConvolutionalTree ();
+        SemSegObliqueTree ();
 
         /** config constructor */
-        SemSegConvolutionalTree ( const NICE::Config *conf,
+        SemSegObliqueTree ( const NICE::Config *conf,
                                   const ClassNames *classNames );
 
         /** simple destructor */
-        virtual ~SemSegConvolutionalTree();
+        virtual ~SemSegObliqueTree();
 
         /**
          * @brief Setup internal variables and objects used
@@ -65,7 +65,7 @@ class SemSegConvolutionalTree : public SemanticSegmentation
          */
         void initFromConfig (
                 const NICE::Config *_conf,
-                const std::string & s_confSection = "SemSegConvolutionalTree" );
+                const std::string & s_confSection = "SemSegObliqueTree" );
 
         /**
          * @brief training function / learn classifier

+ 3 - 2
semseg/SemSegTools.cpp

@@ -197,8 +197,9 @@ void SemSegTools::saveResultsToImageFile(
 
     NICE::ColorImage overlaySegment, overlayGTruth;
 
-    segmentToOverlay( orig.getChannel(1), segment, overlaySegment );
-    segmentToOverlay( orig.getChannel(1), gtruth, overlayGTruth );
+    NICE::Image* origGrey = orig.getChannel(1);
+    segmentToOverlay( origGrey, segment, overlaySegment );
+    segmentToOverlay( origGrey, gtruth, overlayGTruth );
 
     std::stringstream out;
     out << resultDir << "/" << file << outputPostfix;