Forráskód Böngészése

again small bugfix

Björn Fröhlich 13 éve
szülő
commit
f8c837db99
1 módosított fájl, 12 hozzáadás és 9 törlés
  1. 12 9
      semseg/SemSegCsurka.cpp

+ 12 - 9
semseg/SemSegCsurka.cpp

@@ -1485,7 +1485,13 @@ void SemSegCsurka::classifyregions ( CachedExample *ce, NICE::Image & segresult,
   
 #ifdef UNCERTAINTY
   FloatImage uncert(xsize, ysize);
+  ColorImage imgrgb(xsize,ysize);
   uncert.set(0.0);
+  std::string s;
+  std::stringstream out;
+  std::vector< std::string > list2;
+  StringTools::split ( Globals::getCurrentImgFN (), '/', list2 );
+  out << "uncertainty/" << list2.back();
 #endif
   
   if ( classifier != NULL )
@@ -1642,9 +1648,13 @@ void SemSegCsurka::classifyregions ( CachedExample *ce, NICE::Image & segresult,
   }
   
 #ifdef UNCERTAINTY
+  ICETools::convertToRGB ( uncert, imgrgb );
+  imgrgb.write(out.str()+"rough.png");
   double sigma = sigmaweight * 16.0 * 4.0;
   FloatImage gaussUncert(xsize,ysize);
   filterGaussSigmaApproximate<float, float, float> ( uncert, sigma, &gaussUncert );
+  ICETools::convertToRGB ( gaussUncert, imgrgb );
+  imgrgb.write(out.str()+"filtered.png");
 #endif
 
 
@@ -1827,18 +1837,11 @@ void SemSegCsurka::classifyregions ( CachedExample *ce, NICE::Image & segresult,
         int pos = mask ( x, y );
         segresult.setPixel ( x, y, Regionen[pos].first );
 #ifdef UNCERTAINTY
-        //uncert(x,y) = regionUncert[pos];
+        uncert(x,y) = regionUncert[pos];
 #endif
       }
     }
 #ifdef UNCERTAINTY
-    std::string s;
-    std::stringstream out;
-    std::vector< std::string > list;
-    StringTools::split ( Globals::getCurrentImgFN (), '/', list );
-    out << "uncertainty/" << list.back();
-    ColorImage imgrgb(xsize,ysize);
-    
     float maxu = -numeric_limits<double>::max();
     float minu = numeric_limits<double>::min();
     for ( int y = 0; y < ( int ) mask.cols(); y++ )
@@ -1853,7 +1856,7 @@ void SemSegCsurka::classifyregions ( CachedExample *ce, NICE::Image & segresult,
     uncert(0,0) = 1;
     uncert(0,1) = 0;
     ICETools::convertToRGB ( uncert, imgrgb );
-    imgrgb.write(out.str());
+    imgrgb.write(out.str()+"region.png");
 #endif
     
 #undef WRITEREGIONS