Browse Source

problem with features workaround

Bjoern Froehlich 12 years ago
parent
commit
7ae5691ca9
1 changed files with 6 additions and 8 deletions
  1. 6 8
      semseg/SemSegContextTree.cpp

+ 6 - 8
semseg/SemSegContextTree.cpp

@@ -370,16 +370,14 @@ double SemSegContextTree::getBestSplit (std::vector<NICE::MultiChannelImageT<dou
       feat.rProbs = &regionProbs[(*it) [0]];
       
       double val = featsel[f]->getVal (feat, (*it) [1], (*it) [2]);
-      if(isfinite(val))
+      if(!isfinite(val))
       {
-        vals.push_back (val);
-        maxval = std::max (val, maxval);
-        minval = std::min (val, minval);
-      }
-      else
-      {
-        cerr << "non finite value for " << featsel[f]->writeInfos() <<  endl << (*it) [1] << " " <<  (*it) [2] << endl;
+        val = 0.0;
+        //cerr << "non finite value for " << featsel[f]->writeInfos() <<  endl << (*it) [1] << " " <<  (*it) [2] << endl;
       }
+      vals.push_back (val);
+      maxval = std::max (val, maxval);
+      minval = std::min (val, minval);
     }
 
     if (minval == maxval)