- Timestamp:
- 01/22/07 15:31:08 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r2010 r2011 1613 1613 "false"); 1614 1614 1615 1615 1616 RegisterOption("ViewCells.useKdPvsAfterFiltering", 1616 1617 optBool, -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r2008 r2011 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ne 21. I 22:47:4620073 # Generated by qmake (2.00a) (Qt 4.1.2) on: po 22. I 08:54:12 2007 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2006 r2011 26 26 27 27 #define Q_SEARCH_STEPS 3 28 29 #define SORT_RAY_ENTRIES 1 30 31 // use avg ray contribution as importance 32 // if 0 the importance is evaluated from the succ of mutations 33 #define USE_AVG_CONTRIBUTION 1 34 35 MutationBasedDistribution::RayEntry & 36 MutationBasedDistribution::GetEntry(const int index) 37 { 38 #if SORT_RAY_ENTRIES 39 return mRays[index]; 40 #else 41 return mRays[(mBufferStart+index)%mRays.size()]; 42 #endif 43 } 28 44 29 45 void … … 57 73 58 74 int reverseCandidates = 0; 59 75 76 #if 0 77 sort(mRays.begin(), mRays.end()); 78 // reset the start of the buffer 79 mBufferStart = 0; 80 #endif 81 60 82 for (int i=0; i < vssRays.size(); i++) { 61 83 if (vssRays[i]->mPvsContribution) { … … 92 114 *mRays[mBufferStart].mRay = *vssRays[i]; 93 115 mRays[mBufferStart].mMutations = 0; 116 mRays[mBufferStart].mUnsuccessfulMutations = 0; 94 117 mRays[mBufferStart].ResetReverseMutation(); 95 118 // mRays[mBufferStart] = RayEntry(newRay); … … 97 120 if (mBufferStart >= mMaxRays) 98 121 mBufferStart = 0; 99 100 101 122 } 102 123 } else { … … 156 177 cout<<"Reverse candidates:"<<reverseCandidates<<endl; 157 178 } 158 179 159 180 float pContributingRays = contributingRays/(float)vssRays.size(); 181 182 cout<<"Percentage of contributing rays:"<<pContributingRays<<endl; 183 184 #if USE_AVG_CONTRIBUTION 160 185 float importance = 1.0f/(pContributingRays + 1e-5); 161 186 // float importance = 1.0f; 162 187 // set this values for last contributingRays 163 188 int index = mBufferStart - 1; … … 168 193 mRays[index].mImportance = importance; 169 194 } 170 195 #else 196 // use unsucc mutation samples as feedback on importance 197 for (int i=0; i < mRays.size(); i++) { 198 const float minImportance = 0.1f; 199 const int minImportanceSamples = 20; 200 mRays[i].mImportance = minImportance + 201 (1-minImportance)*exp(-3.0f*mRays[i].mUnsuccessfulMutations/minImportanceSamples); 202 203 //mRays[i].mImportance = 1.0f/(mRays[i].mUnsuccessfulMutations+3); 204 // mRays[i].mImportance = 1.0f; 205 } 206 #endif 207 208 #if SORT_RAY_ENTRIES 209 long t1 = GetTime(); 210 sort(mRays.begin(), mRays.end()); 211 // reset the start of the buffer 212 mBufferStart = 0; 213 mLastIndex = mRays.size(); 214 cout<<"Mutation candidates sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 215 #endif 216 171 217 #if MUTATION_USE_CDF 172 218 // compute cdf … … 184 230 GetEntry(0).mImportance<<" "<< 185 231 GetEntry(mRays.size()-1).mImportance<<endl; 186 232 233 cout<<"Sampling factor = "<< 234 GetEntry(0).GetSamplingFactor()<<" "<< 235 GetEntry(mRays.size()-1).GetSamplingFactor()<<endl; 236 187 237 cerr<<"Mutation update done."<<endl; 188 238 } … … 516 566 517 567 #if !MUTATION_USE_CDF 568 #if SORT_RAY_ENTRIES 569 index = mLastIndex - 1; 570 if (index < 0 || index >= mRays.size()-1) { 571 index = mRays.size() - 1; 572 } else 573 if ( 574 mRays[index].GetSamplingFactor() >= mRays[mLastIndex].GetSamplingFactor()) { 575 // make another round 576 577 // cout<<"R2"<<endl; 578 // cout<<mLastIndex<<endl; 579 // cout<<index<<endl; 580 index = mRays.size() - 1; 581 } 582 #else 518 583 // get tail of the buffer 519 584 index = (mLastIndex+1)%mRays.size(); … … 534 599 index = (index+1)%mRays.size(); 535 600 } 601 #endif 536 602 #else 537 603 static HaltonSequence iHalton; … … 558 624 559 625 mLastIndex = index; 560 626 // Debug<<index<<" "<<mRays[index].GetSamplingFactor()<<endl; 627 561 628 if (mRays[index].HasReverseMutation()) { 562 629 //cout<<"R "<<mRays[index].mutatedOrigin<<" "<<mRays[index].mutatedTermination<<endl; … … 768 835 769 836 770 } 837 838 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.h
r2001 r2011 57 57 58 58 float GetSamplingFactor() const { return mMutations/mImportance; } 59 60 friend bool operator<(const RayEntry &a, const RayEntry &b) { 61 return a.GetSamplingFactor() > b.GetSamplingFactor(); 62 } 63 59 64 RayEntry() {} 60 65 RayEntry(VssRay *r):mRay(r), … … 118 123 ); 119 124 120 RayEntry &GetEntry(const int index) { 121 return mRays[(mBufferStart+index)%mRays.size()]; 122 } 125 RayEntry &GetEntry(const int index); 126 123 127 124 128 vector<RayEntry> mRays; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2008 r2011 1203 1203 #if 1 1204 1204 mRayCaster->SortRays(rays); 1205 cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" s."<<endl;1205 cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" ms."<<endl; 1206 1206 1207 1207 if (0) { -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r2008 r2011 61 61 # type render 62 62 detectEmptyViewSpace true 63 #pvsRenderErrorSamples 064 pvsRenderErrorSamples 1000063 pvsRenderErrorSamples 0 64 # pvsRenderErrorSamples 10000 65 65 quitOnFinish false 66 66 computeVisibility true … … 111 111 112 112 useImportanceSampling true 113 114 113 115 114 Export { -
GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
r2008 r2011 7 7 #VIEWCELLS=../data/vienna/vienna-viewcells-5000.xml 8 8 9 #SCENE=../data/soda/soda5.dat 9 10 #SCENE=../data/soda/soda.obj 10 11 #VIEWCELLS=../data/soda/soda5-viewcells-1000.xml 11 12 #VIEWCELLS=../data/soda/soda5-viewcells-single.xml … … 49 50 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 50 51 -rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \ 51 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4h.xml \ 52 -preprocessor_stats=$PREFIX-i-mixed-b1-n4h.log \ 53 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4h.hlog 52 -view_cells_use_kd_pvs- -af_use_kd_pvs- \ 53 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4i.xml \ 54 -preprocessor_stats=$PREFIX-i-mixed-b1-n4i.log \ 55 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4i.hlog 54 56 55 57 … … 58 60 # g - gaussian origin, q=2, reverse samples 59 61 62 # g, h contain pvs error estimations... 60 63 61 64 # $COMMAND -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
Note: See TracChangeset
for help on using the changeset viewer.