Răsfoiți Sursa

added simple constructor

Sven Sickert 11 ani în urmă
părinte
comite
6e13bfaf6f
2 a modificat fișierele cu 34 adăugiri și 24 ștergeri
  1. 30 23
      semseg/SemanticSegmentation.cpp
  2. 4 1
      semseg/SemanticSegmentation.h

+ 30 - 23
semseg/SemanticSegmentation.cpp

@@ -17,6 +17,36 @@ using namespace OBJREC;
 using namespace std;
 using namespace std;
 using namespace NICE;
 using namespace NICE;
 
 
+SemanticSegmentation::SemanticSegmentation ()
+{
+  this->classNames = NULL;
+  this->imagetype = IMAGETYPE_GRAY;
+}
+
+SemanticSegmentation::SemanticSegmentation ( const Config *conf,
+    const ClassNames *classNames )
+{
+  this->classNames = classNames;
+
+  Preprocess::Init ( conf );
+
+  std::string imagetype_s = conf->gS ( "main", "imagetype", "gray" );
+  if ( imagetype_s == "rgb" )
+    this->imagetype = IMAGETYPE_RGB;
+  else if ( imagetype_s == "gray" )
+    this->imagetype = IMAGETYPE_GRAY;
+  else
+  {
+    fprintf ( stderr, "SemanticSegmentation:: unknown image type option\n" );
+    exit ( -1 );
+  }
+}
+
+SemanticSegmentation::~SemanticSegmentation()
+{
+}
+
+
 void SemanticSegmentation::convertLSetToSparseExamples ( Examples &examples, LabeledSetVector &lvec )
 void SemanticSegmentation::convertLSetToSparseExamples ( Examples &examples, LabeledSetVector &lvec )
 {
 {
 #ifdef DEBUG_PRINTS
 #ifdef DEBUG_PRINTS
@@ -140,29 +170,6 @@ void SemanticSegmentation::convertVVectorToExamples ( VVector &feats, Examples &
 #endif
 #endif
 }
 }
 
 
-SemanticSegmentation::SemanticSegmentation ( const Config *conf,
-    const ClassNames *classNames )
-{
-  this->classNames = classNames;
-
-  Preprocess::Init ( conf );
-
-  std::string imagetype_s = conf->gS ( "main", "imagetype", "gray" );
-  if ( imagetype_s == "rgb" )
-    imagetype = IMAGETYPE_RGB;
-  else if ( imagetype_s == "gray" )
-    imagetype = IMAGETYPE_GRAY;
-  else
-  {
-    fprintf ( stderr, "SemanticSegmentation:: unknown image type option\n" );
-    exit ( -1 );
-  }
-}
-
-SemanticSegmentation::~SemanticSegmentation()
-{
-}
-
 void SemanticSegmentation::getDepthVector ( const LabeledSet *Files,
 void SemanticSegmentation::getDepthVector ( const LabeledSet *Files,
                                             vector<int> & depthVec,
                                             vector<int> & depthVec,
                                             const bool run3Dseg )
                                             const bool run3Dseg )

+ 4 - 1
semseg/SemanticSegmentation.h

@@ -40,7 +40,10 @@ protected:
 
 
 public:
 public:
 
 
-  /** simple constructor
+  /** simple constructor */
+  SemanticSegmentation ();
+
+  /** constructor
       @param conf global settings
       @param conf global settings
       @param classNames this ClassNames object while be stored as a attribute
       @param classNames this ClassNames object while be stored as a attribute
   */
   */