Explorar o código

adding zsize configuration for 2D scenarios in SemSegTools

Sven Sickert %!s(int64=8) %!d(string=hai) anos
pai
achega
f1bafd4965
Modificáronse 2 ficheiros con 9 adicións e 3 borrados
  1. 1 1
      progs/testSemSegObliqueTrees.cpp
  2. 8 2
      semseg/SemSegTools.cpp

+ 1 - 1
progs/testSemSegObliqueTrees.cpp

@@ -99,7 +99,7 @@ int main ( int argc, char **argv )
             segresult.addChannel(gtruth);
             gt.addChannel(gtruth);
 
-            int depthBoundary = 0;
+            int depthBoundary = 1;
             if ( run3Dseg )
                 depthBoundary = zsizeVec[idx];
 

+ 8 - 2
semseg/SemSegTools.cpp

@@ -117,7 +117,7 @@ void SemSegTools::computeClassificationStatistics(
     for ( int c = 0; c < classMappingInv.size(); c++ )
     {
         std::cout << "Class " << classNames.text( classMappingInv[c] ) << ":" << std::endl;
-        
+
         double precBase = 0.0, recBase = 0.0;
         // row-wise sum
         for ( int r = 0; r < classMappingInv.size(); r++ )
@@ -128,7 +128,7 @@ void SemSegTools::computeClassificationStatistics(
             recBase += confMat(c,cc);
 
         double precClass = 0, recClass = 0;
-        
+
         if (precBase > 0) precClass = confMat(c,c) / precBase;
 
         if (recBase > 0) recClass = confMat(c,c) / recBase;
@@ -327,6 +327,12 @@ void SemSegTools::collectTrainingExamples (
     int grid_border_y = conf->gI(section, "grid_border_y", 20 );
     int grid_border_z = conf->gI(section, "grid_border_z", 20 );
 
+    if (!run3Dseg)
+    {
+        grid_size_z = 1;
+        grid_border_z = 0;
+    }
+
     std::string selection = conf->gS(section, "train_selection" );
 
     set<int> classnoSelection;