Changeset 705


Ignore:
Timestamp:
03/16/06 15:31:20 (18 years ago)
Author:
mattausch
Message:

fixed bug in filtering

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r704 r705  
    146146                                                                           float &pvsEnlargement) 
    147147{ 
     148        pvsReduction = 0.0f; 
     149        pvsEnlargement = 0.0f; 
    148150  // Uses sum of log differences, which corresponds to entropy 
    149151  std::map<T, PvsData<T>, LtSample<T> >::iterator it; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r704 r705  
    553553int GetBestViewCellIdx(ViewCell *root, const ViewCellContainer &neighborhood) 
    554554{ 
    555         int bestViewCellIdx = -1;; 
     555        int bestViewCellIdx = 0; 
    556556 
    557557        float mergeCost = Limits::Infinity; 
     
    563563        { 
    564564                const float mc = EvalMergeCost(root, *it); 
    565  
    566                 if (mc > mergeCost) 
     565                 
     566                if (mc < mergeCost) 
    567567                { 
    568568                        mergeCost = mc; 
     
    586586        //-- use priority queue to merge leaf pairs 
    587587 
    588  
     588        //cout << "neighborhood: " << neighborhood.size() << endl; 
    589589        //const float maxAvgCost = 350; 
    590590        for (int nMergedViewCells = 0; nMergedViewCells < n; ++ nMergedViewCells) 
     
    593593                 
    594594                ViewCell *bestViewCell = neighborhood[bestViewCellIdx]; 
    595                  
     595                cout << "here2" << endl; 
    596596                // remove from vector 
    597597                swap(neighborhood[bestViewCellIdx], neighborhood.back()); 
    598598                neighborhood.pop_back(); 
    599                  
     599         
     600                cout << "vc idx: " << bestViewCellIdx << endl; 
    600601                if (!bestViewCell || !root) 
    601602                        cout << "warning!!" << endl; 
     603                 
     604                cout << "here4" << endl; 
     605 
    602606                // create new root of the hierarchy 
    603607                root = MergeViewCells(root, bestViewCell); 
     608                cout << "here5" << endl; 
    604609        } 
    605610 
     
    939944        // generate parent view cell 
    940945        ViewCellInterior *vc = new ViewCellInterior();//GenerateViewCell(); 
    941  
     946                cout << "here66" << endl; 
    942947        vc->GetPvs() = left->GetPvs(); 
     948                cout << "here44" << endl; 
    943949        // merge pvs 
    944950        vc->GetPvs().Merge(right->GetPvs()); 
     
    955961        } 
    956962 
    957  
     963        cout << "here77" << endl; 
    958964        vc->SetupChildLink(left); 
     965        cout << "here88" << endl; 
    959966        vc->SetupChildLink(right); 
    960  
     967        cout << "here99" << endl; 
    961968 
    962969        return vc; 
     
    40204027                 
    40214028                exporter->SetFilled(); 
    4022                 exporter->ResetForcedMaterial(); 
    4023  
     4029 
     4030                exporter->SetForcedMaterial(RgbColor(0,1,0)); 
     4031                ExportViewCellGeometry(exporter,  GetViewCell(viewPoint)); 
     4032 
     4033                //exporter->ResetForcedMaterial(); 
     4034                exporter->SetForcedMaterial(RgbColor(0,0,1)); 
    40244035                ExportViewCellGeometry(exporter, testPrVs.mViewCell); 
    40254036 
Note: See TracChangeset for help on using the changeset viewer.