Skip to topic
|
Skip to bottom
Jump:
TModeling
TModeling Web
TModeling Web Home
Changes
Notify
Index
Search
Webs
BioGeometry
Main
TModeling
TWiki
Edit
Attach
Printable
TModeling.GridFilter
r1.1 - 18 Dec 2008 - 07:45 - Main.guest
topic end
Start of topic |
Skip to actions
*Grid Filter Demo* --- _This demo shows how to use the Grid Filter on the "Ottawa" data set_ --- _Steps 1 & 2._ *Build Ottawa Point Cloud Data set* See the StartHere Demo. --- _Step 3._ *Apply Grid Filter* This step applys a grid based binning filter to the ottawa data set. Basically the point cloud is divided into a 3D grid of 1x1x1 meter^3 grid cells. then for each <x,y> column we pick the grid cell containing the most points and throw away all other points in all other grid cells in the column. Pros: 1. The filter has the effect of picking the most important features (roads, roof-tops). 2. Upside is that it tends to throw away many of the extraneous outlier points. 3. It makes the data easier to delaunay triangulate as there are fewer <x,y> locations with multiple z-values. Cons. 1. Has a strong aliasing effect on the grid cell boundaries. 2. Some important features get lost _Note:_ This step took about 1.5 minutes (89 seconds) on Shawn's Machine <verbatim> spfilter -i ottawa.spb -o ottawa_grid.spb -ottawa -orig 0 0 0 -cellsize 1 1 1 </verbatim> | _Input File:_ | ottawa.spb | 905 MB | 905,928,264 bytes | | _Output File:_ | ottawa_grid.spb | 611 MB | 611,823,464 bytes | _Note:_ To visualize the resulting point cloud, use this command <verbatim> sp_viewer -i ottawa_grid.spb </verbatim> <img src="%ATTACHURLPATH%/Ottawa_Grid.jpg" alt="Ottawa_Grid.jpg" width="1042" height="824" /> --- _Step 4._ *Spatially finalize raw point cloud data.* This virtually bin's points into geographic neighborhoods using a Quad Tree Data structure. _Note:_ This step took about 1 minutes (64 seconds) on Shawn's machine. Reading and writing to/from same disk. <verbatim> spfinalize -i ottawa_grid.spb -o o55_grid.spb </verbatim> | _Input File:_ | ottawa_grid.spb | 611 MB | 611,823,464 bytes | | _Output File:_ | o55_grid.spb | 905 MB | 612,022,120 bytes | _Note:_ To visualize the resulting point cloud, use this command <verbatim> sp_viewer -i ottawa55.spb </verbatim> _Note:_ The resulting image is basically the same as the previous step --- _Step 5._ *Triangulate Point Cloud* Uses delaunay triangulation on the point cloud to generate a triangulated mesh. _Note:_ Point cloud must be spatially finalized for this to work properly. _Note:_ This step took about 3+ minutes (184.5 seconds) on Shawn's machine, reading and writing to/from same disk. <verbatim> spdelaunay2d.exe -i o55_grid.spb -o o55_grid_mesh.smb </verbatim> | _Input File:_ | o55_grid.spb | 905 MB | 905,332,684 bytes | | _Output File:_ | o55_grid_mesh.smb | 2.36 GB | 1,755,657,073 bytes | _Note:_ To visualize the resulting mesh use the following command. *This could take a very long time... I gave up part way thru* <verbatim> sm_viewer -i o55_grid_mesh.smb </verbatim> _Note:_ The resulting image takes too long to render, which is why it is not included here. --- _Step 6._ *Compress Mesh* Compression is accomplished via the Quadric Error Metric (QEM), a priority heap, and edge contraction. A Quad Edge data structure is used for building the surface. _Note:_ This step took about 28+ minutes (1681 seconds) on Shawn's Machine, reading and writing to/from same disk. <verbatim> smsimpall.exe -i o55_grid_mesh.smb -o o55_grid_01.smb -buffsize 500000 -simprate 0.01 -mode 0 -retryrate 10 -zthres 135.0 </verbatim> | _Input File:_ | o55_grid_mesh.smb | 1.76 GB | 1,755,657,073 bytes | | _Output File:_ | o55_grid_01.smb | 18.6 MB | 18,655,325 bytes | | Original UPC file sizes 5x5 tiles | 2.77 GB | 2,773,581,424 bytes | | *Compression vs UPC* | 18.6/2773 | 0.6% | *148 to 1* | | *Relative vs input* | 18.6/1760 | 1.06% | *94 to 1* | _Note:_ To visualize the compressed mesh use the following command. <verbatim> sm_viewer -i o55_grid_01.smb </verbatim> <img src="%ATTACHURLPATH%/Ottawa_CompGrid.jpg" alt="Ottawa_CompGrid.jpg" width="1042" height="825" /> --- _Step 7._ *Compress Mesh Further* (Optional) Converts from .SMB format to .SMC format. Uses binary compression and the parrallelgram rule to achive an additional 2x to 10x greater compression with only a small loss in precision. _Note:_ This step took about 3 seconds on Shawn' Machine, reading and writing to/from same disk. <verbatim> sm2sm -i o55_grid_01.smb -o o55_grid_01.smc </verbatim> | _Input File:_ | o55_grid_01.smb | 18.6 MB | 18,655,325 bytes | | _Output File:_ | o55_grid_01.smc | 1.62 MB | 1,624,530 bytes | | Original UPC file sizes 5x5 tiles | 2.77 GB | 2,773,581,424 bytes | | *Compression vs UPC* | 1.62/2773 | 0.06% | *1707 to 1* | | *Relative vs input* | 1.62/18.6 | 8.7% | *11.5 to 1* | _Note:_ To visualize the compressed mesh use the following command. <verbatim> sm_viewer -i o55_grid_01.smc </verbatim> <img src="%ATTACHURLPATH%/Ottawa_Grid_SMC.jpg" alt="Ottawa_Grid_SMC.jpg" width="1042" height="824" /> --- _Alternate Step:_ *Remove Outliers Filter*, Optional Step Filter that removes outliers. Works by computing a 1-ring neighborhood around each vertex, computing a best fit plane using linear least squares and then computing the variance of each vertex in the 1-ring to that plane. If the variance of the center point is more than 3 sigma than that point and it's incident triangles are deleted from the mesh _Note:_ This application won't work on non-manifold mesh's. IE each vertex's 1-ring needs to have a homeomorphism to an open ball (interior vertices) or a half-ball (exterior vertices). _Note:_ This took 14.5 seconds on Shawn's machine <verbatim> ringfilt -ismb -i o55_grid_01.smb -osmb -o o55_r2_01.smb -sigmin 0.0 -sigmax 3.0 -fl1r </verbatim> In this example we suppressed... |Suppressed Vertices| 1,850 | |Suppressed Triangles| 9,536 | _Note:_ To visualize mesh with suppressed outlier vertices and incident triangles <verbatim> sm_viewer -i o55_r2_01.smb </verbatim> <img src="%ATTACHURLPATH%/Ottawa_R2_Hole.jpg" alt="Ottawa_R2_Hole.jpg" width="1043" height="825" /> Step by Step process to *regenerate mesh* with fewer outliers (and without holes caused by removing outliers) A. Apply ring filter to remove outliers (and output to a point cloud format) <verbatim> ringfilt -ismb -i o55_grid_01.smb -ospa -o o55_ring_01.spa -sigmin 0.0 -sigmax 3.0 -fl1r </verbatim> B. Spatially Finalize point cloud <verbatim> spfinalize -i o55_ring_01.spa -o o55_ring_f_01.spb </verbatim> C. Turn point cloud back into a mesh by delaunauy triangulation <verbatim> spdelanauy2d -i o55_ring_f_01.spb -o o55_ring_mesh_01.smb </verbatim> _Note:_ To visualize the regenerated mesh with fewer outliers (spikes, etc.) <verbatim> sm_viewer -i o55_ring_mesh_01.smb </verbatim> <img src="%ATTACHURLPATH%/Ottawa_R2.jpg" alt="Ottawa_R2.jpg" width="1045" height="826" /> --- _Alternate Step:_ *Smooth Mesh*, Optional Step Smooth mesh by Laplacian averaging _Note:_ This step took about 0.7 seconds on Shawn's machine <verbatim> smsmooth -i o55_grid_01.smb -o o55_smooth_01.smb </verbatim> _Note:_ To visualize the smoothed mesh use the following command. <verbatim> sm_viewer -i o55_smooth_01.smb </verbatim> <img src="%ATTACHURLPATH%/Ottawa_Smooth.jpg" alt="Ottawa_Smooth.jpg" width="1042" height="821" /> --- _Step 8._ *Reorder Mesh for path finding* Re-order the mesh to efficiently find a path from source to target using Dijkstra's algorithm. _Note:_ This step took about 1.6 seconds on Shawn' Machine, reading and writing to/from same disk. <verbatim> dijkstra_order.exe -i o55_grid_01.smb -o grid_reorder.smb -s 1 -t 114.465027 135.945602 59.601620 </verbatim> _Note:_ To visualize the re-ordered mesh use the following command. <verbatim> sm_viewer -i grid_reorder.smb </verbatim> <img src="%ATTACHURLPATH%/Ottawa_Grid_RO2.jpg" alt="Ottawa_Grid_RO2.jpg" width="1043" height="825" /> --- _Step 9._ *Find Shortest Path* Find shortest path using MMP algorithm. _Note:_ This step took about 8.1 seconds on Shawn' Machine, reading and writing to/from same disk. <verbatim> MMP.exe -i grid_reorder.smb -o grid_path.txt -s 1 -t 114.465027 135.945602 59.601620 </verbatim> _Note:_ To visualize the mesh and the shortest path use the following command. <verbatim> sm_pathviewer -i grid_reorder.smb -path grid_path.txt </verbatim> <img src="%ATTACHURLPATH%/Ottawa_Grid_Path.jpg" alt="Ottawa_Grid_Path.jpg" width="1042" height="825" /> --- _Alternate Step_ *Rasterize TIN to DEM* Converts TIN to DEM using variety of interpolation techniques (linear, matrix subdivision based on meshless wavelets, quintic, etc.) _Note:_ This step took about 5 seconds on Shawn's Machine, reading and writing to/from same disk. <verbatim> tin2dem.exe -lin -ncols 400 -nrows 400 -ulxmap 0 -ulymap 0 -xdim 1.0 -ydim 1.0 -i o55_ring_mesh_01.smb -oasc -o o55_ring_mesh_01.asc </verbatim> | _Input File:_ | o55_ring_mesh_01.smb | 18.5 MB | 18,541,265 bytes | | _Output File:_ | o55_ring_mesh_01.asc | 1.6 MB | 1,604,050 bytes | _Note:_ To visualize the DEM you will need to use a tool like !FreeView <img src="%ATTACHURLPATH%/Ottawa_ASC_2.jpg" alt="Ottawa_ASC_2.jpg" width="1059" height="999" /> --- -- Main.ShawnDB - 18 Dec 2008 * Ottawa_Grid.jpg: <br /> * Ottawa_CompGrid.jpg: <br /> * Ottawa_Grid_SMC.jpg: <br /> * Ottawa_Grid_RO2.jpg: <br /> * Ottawa_Grid_Path.jpg: <br /> * Ottawa_R2.jpg: <br /> * Ottawa_R2_Hole.jpg: <br /> * Ottawa_Smooth.jpg: <br /> * Ottawa_ASC_2.jpg: <br />
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
More topic actions
Revisions: | r1.1
|
Total page history
|
Backlinks
You are here:
TModeling
>
GridFilter
to top
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback