Преглед изворни кода

writeregion for tree approach

Bjoern Froehlich пре 13 година
родитељ
комит
64d0e4c390
1 измењених фајлова са 19 додато и 0 уклоњено
  1. 19 0
      semseg/SemSegContextTree.cpp

+ 19 - 0
semseg/SemSegContextTree.cpp

@@ -2209,6 +2209,25 @@ void SemSegContextTree::semanticseg ( CachedExample *ce, NICE::Image & segresult
         segresult.setPixel ( x, y, bestlabels[regions ( x,y ) ] );
       }
     }
+    
+#define WRITEREGIONS
+#ifdef WRITEREGIONS
+    RegionGraph rg;
+    segmentation->getGraphRepresentation ( img, regions,  rg);
+    for ( uint pos = 0; pos < regionProbs.size(); pos++ )
+    {
+      rg[pos]->setProbs ( regionProbs[pos] );
+    }
+
+    std::string s;
+    std::stringstream out;
+    std::vector< std::string > list;
+    StringTools::split ( Globals::getCurrentImgFN (), '/', list );
+
+    out << "rgout/" << list.back() << ".graph";
+    string writefile = out.str();
+    rg.write ( writefile );
+#endif
   }
 
   cout << "segmentation finished" << endl;