瀏覽代碼

writeglobfeats

Bjoern Froehlich 13 年之前
父節點
當前提交
707b4a497f
共有 1 個文件被更改,包括 9 次插入6 次删除
  1. 9 6
      semseg/SemSegContextTree.cpp

+ 9 - 6
semseg/SemSegContextTree.cpp

@@ -1734,22 +1734,25 @@ void SemSegContextTree::train ( const MultiDataset *md )
   
   for(uint i = 0; i < textonMap.size(); i++)
   {
-    set<int> classes;
-    for ( int x = 0; x < labels[i].cols(); x++ )
+    set<int> usedclasses;
+    for ( int x = 0; x < labels[i].rows(); x++ )
     {
-      for ( int y = 0; y < labels[i].rows(); y++ )
+      for ( int y = 0; y < labels[i].cols(); y++ )
       {
         int classno = labels[i] ( x, y );
 
         if ( forbidden_classes.find ( classno ) != forbidden_classes.end() )
           continue;
 
-        classes.insert(classno);
+        usedclasses.insert(classno);
       }
     }
     
+    cout << "labels.cols: " << labels[i].cols() << " labels.rows " << labels[i].rows() << endl;
+    cout << "currentfeats : " << allfeats[i].width() << " allfeats[i].height(); " << allfeats[i].height() << endl;
+    
     set<int>::iterator it;
-    for ( it=classes.begin() ; it != classes.end(); it++ )
+    for ( it=usedclasses.begin() ; it != usedclasses.end(); it++ )
       outstream << *it << " ";
     outstream << endl;
     integralTexton[i](integralTexton[i].width()-1, integralTexton[i].height()-1).store(outstream);
@@ -1759,7 +1762,7 @@ void SemSegContextTree::train ( const MultiDataset *md )
   
 #endif
     cout << "uniquenumber " << uniquenumber << endl;
-    getchar();
+    //getchar();
 #ifdef DEBUG
   for ( int tree = 0; tree < nbTrees; tree++ )
   {