Changeset 2559 for GTP/trunk/Lib/Vis
- Timestamp:
- 11/02/07 09:00:20 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/mypreprocess_visibility.sh
r2544 r2559 1 1 #!/bin/sh 2 2 3 ./preprocess_visibility_internal.sh ../data/vienna/vienna_cropped.obj ../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz vienna-visibility 2.bn3 ./preprocess_visibility_internal.sh ../data/vienna/vienna_cropped.obj ../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz vienna-visibility3.bn -
GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility.env
r2211 r2559 63 63 RssPreprocessor { 64 64 65 distributions mutation+spatial+object_direction 66 # distributions rss+object_direction 65 # distributions mutation+spatial+object_direction 66 # distributions mutation+spatial+object_direction+difference 67 distributions difference+object_direction+spatial 67 68 # distributions object_direction 68 69 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocess_visibility_internal.sh
r2544 r2559 14 14 15 15 #NUM_SAMPLE_RAYS=200000000 16 NUM_SAMPLE_RAYS=3000000017 #NUM_SAMPLE_RAYS=1000016 #NUM_SAMPLE_RAYS=30000000 17 NUM_SAMPLE_RAYS=5000000 18 18 19 19 $PREPROCESSOR -total_samples=$NUM_SAMPLE_RAYS \ 20 20 -scene_filename=$1 -view_cells_filename=$2 -preprocessor_visibility_file=$3 \ 21 21 -preprocessor_ray_cast_method=1 \ 22 -samples_per_pass= 1000000 \22 -samples_per_pass=500000 \ 23 23 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \ 24 24 -mutation_silhouette_prob=0.5 \ -
GTP/trunk/Lib/Vis/Preprocessing/src/DifferenceSampling.cpp
r2548 r2559 5 5 #include "ViewCellsManager.h" 6 6 #include "Preprocessor.h" 7 #include "Timer/PerfTimer.h" 7 8 8 9 … … 10 11 #include "ArchModeler2MLRT.hxx" 11 12 #endif 13 14 PerfTimer sFilterTimer; 12 15 13 16 … … 60 63 ObjectPvs filteredPvs; 61 64 62 PvsFilterStatistics pvsStats = mPreprocessor. 65 sFilterTimer.Entry(); 66 67 PvsFilterStatistics pvsStats = mPreprocessor. 63 68 mViewCellsManager->ApplyFilter2(vc, 64 69 false, 65 70 filterSize, 66 71 filteredPvs); 72 73 sFilterTimer.Exit(); 67 74 68 75 //mDifferencePvs.Clear(false); … … 72 79 73 80 GetPvsDifference(filteredPvs, pvs, mPvsDifference); 81 82 cerr << "found " << mPvsDifference.size() << " different objects" << endl; 74 83 } 75 84 … … 77 86 bool DifferenceSampling::GenerateSample(SimpleRay &ray) 78 87 { 79 if (mNumSamples --<= 0)88 if (mNumSamples <= 0) 80 89 { 90 // choose random view cell 81 91 ViewCellContainer &viewCells = mPreprocessor.mViewCellsManager->GetViewCells(); 82 92 const int vcIdx = (int)RandomValue(0, (float)viewCells.size() - 0.5f); 83 93 84 94 mCurrentViewCell = viewCells[vcIdx]; 95 96 if (mCurrentViewCell->GetPvs().Empty()) 97 return false; 98 99 cout << "computing new difference set" << endl; 85 100 86 101 ComputeDifferenceSet(mCurrentViewCell, mPvsDifference); … … 91 106 } 92 107 108 if (mPvsDifference.empty()) 109 return false; 110 111 -- mNumSamples; 112 113 cout << "x"; 93 114 Vector3 origin, direction; 94 115 Vector3 point; -
GTP/trunk/Lib/Vis/Preprocessing/src/FlexibleHeap.h
r2542 r2559 61 61 T Erase(T); 62 62 63 void Reserve(const size_t n); 64 63 65 protected: 64 66 65 void Place(T x, const unsigned int i);66 void Swap(const unsigned int i, const unsigned int j);67 68 unsigned int Parent(const unsigned int i) const { return (i - 1) / 2; }69 unsigned int Left(const unsigned int i) const { return 2 * i + 1; }70 unsigned int Right(const unsigned int i) const { return 2 * i + 2; }67 inline void Place(T x, const unsigned int i); 68 inline void Swap(const unsigned int i, const unsigned int j); 69 70 inline unsigned int Parent(const unsigned int i) const { return (i - 1) / 2; } 71 inline unsigned int Left(const unsigned int i) const { return 2 * i + 1; } 72 inline unsigned int Right(const unsigned int i) const { return 2 * i + 2; } 71 73 72 74 void UpHeap(const unsigned int i); 73 75 void DownHeap(const unsigned int i); 74 76 77 78 /////// 79 75 80 std::vector<T> mBuffer; 76 81 }; … … 104 109 } 105 110 111 template <typename T> 112 void FlexibleHeap<T>::Reserve(const size_t n) 113 { 114 mBuffer.reserve(n); 115 } 106 116 107 117 template <typename T> … … 273 283 t->NotInHeap(); 274 284 285 if (i < (int)mBuffer.size()) 286 { 275 287 if (mBuffer[i]->GetPriority() < t->GetPriority()) 276 288 DownHeap(i); 277 289 else 278 290 UpHeap(i); 291 } 279 292 280 293 return t; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2544 r2559 1129 1129 } 1130 1130 1131 ///// 1131 ///////////////// 1132 1132 //-- reserve constant block of rays 1133 1133 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2543 r2559 78 78 79 79 // pool of vss rays to be used in one pass of the sampling 80 struct VssRayPool { 80 struct VssRayPool 81 { 81 82 VssRayPool(): mRays(NULL), mIndex(0), mNumber(0) 82 83 {} … … 87 88 } 88 89 89 void Reserve(const int number) { 90 void Reserve(const int number) 91 { 90 92 DEL_PTR(mRays); 91 93 mRays = new VssRay[number]; … … 93 95 } 94 96 95 void Clear() { 97 void Clear() 98 { 96 99 mIndex = 0; 97 100 } 98 VssRay *Alloc() { 101 102 VssRay *Alloc() 103 { 99 104 // reset pool 100 105 if (mIndex == mNumber) … … 110 115 VssRayPool mVssRayPool; 111 116 112 void ReserveVssRayPool(const int n) { 117 void ReserveVssRayPool(const int n) 118 { 113 119 mVssRayPool.Reserve(n); 114 120 } 115 121 116 void InitPass() { 122 void InitPass() 123 { 117 124 mVssRayPool.Clear(); 118 125 } -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2543 r2559 164 164 LinkIncremental="1" 165 165 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtInterface\Release;"$(CG_LIB_PATH)"" 166 GenerateDebugInformation=" TRUE"166 GenerateDebugInformation="FALSE" 167 167 SubSystem="1" 168 168 LargeAddressAware="2"
Note: See TracChangeset
for help on using the changeset viewer.