Explorar el Código

writeregion for tree approach

Bjoern Froehlich hace 13 años
padre
commit
64d0e4c390
Se han modificado 1 ficheros con 19 adiciones y 0 borrados
  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 ) ] );
         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;
   cout << "segmentation finished" << endl;