COS702; Assignment 6 Point Cloud Data Surface Interpolation University of Southern Missisippi Tyler Reese December 3, 2012
The Problem COS 702, Assignment 6: Given appropriate sets of Point Cloud data, use Radial Basis Functions to recreate the surface through interpolation. The first set of data to be used includes coordinates of points on the original surface and the normal vector at each of those points for 453 points. Using Inverse MQ, adjust the shape parameter and resolution of the 3D mesh used to recreate the surface, and find a combination that yields optimal results. The second set of data is of the same format but includes 1889 points. The larger data set is expected to require the use of Compactly Supported Radial Basis Functions. Using a simple CS-RBF (φ = (1 r) 2 ), adjust the support parameter and resolution of the 3D mesh, and find a combination that yields optimal results for this data set as well. If this generates well behaved results, attempt to use Point Cloud data for 8171 points. Results are to be judged visually. Provided below in Figure 1 is the original object whose surface is to be recreated. Figure 1: Original bunny statue from which the Point Cloud data was generated. [1] 1
Methods Overview Surface Interpolation with Radial Basis Functions (RBFs) uses data points for which function values are known to construct an interpolation matrix based on the distance from each point to the other points. A more thorough discussion of this concept can be found in references [2] and [3]. Cases where a large number of data points are being used can result in a high density of data points and lead to ill-conditioned Distance Matrices. In these cases, Compactly Supported RBFs (CS-RBFs) can be utilized which are restricted to only being concerned with points that fall within a designated support radius. More information on this concept can be found in references [2] and [4]. CS-RBFs allow for the matrix calculations to be done with sparse matrices increasing computational efficiency and helping to reduce the time required. When given a Point Cloud data set with coordinates and normals, one can effectively use RBFs to reconstruct the original surface. One distinction between recreating the surface given by a function (i.e. f = f(x, y)) and recreating a surface given by Point Cloud data, is that for the Point Cloud data there is not a functional dependence of the z-coordinate on the x- and y-coordinates. There is no longer any required functional dependence among any of the coordinate components. This means, for example, that for a given x,y pair there could be more than one appropriate z-coordinate, and one can no longer reliably predict the what the z-coordinate should be. One method to resolve this issue is to create a functional dependence based on all three coordinate values, i.e. f = f(x, y, z). [5] To achieve this, one needs to generate two additional sets of point coordinates using the provided Point Cloud data points and the normal vectors associated with each point. The normal vectors provide a direction pointing out from the surface. Using this information, one can create one point inside the surface and another point outside the surface for every data point in the Point Cloud set. The distance from the surface, δ, needs to be specified such that a line connecting these three points only crosses the surface once at the original point and does not encounter any other portions of the surface. In this work δ was specified to be 1/100th the overall length scale, meaning the longest distance spanned along the x, y, or z direction in the original coordinate set divided by 100. Once the original N point data set is turned into a 3N point data set, the functional values are arbitrarily set equal to the following with x i representing the coordinate (x i, y i, z i ) and n i representing 2
the normal vector with i going from 1 to N: f(x i δn i ) = 1 f(x i ) = 0 f(x i + δn i ) = 1. (1) With this relationship, one can use RBFs to interpolate the values of f over a 3D mesh. Understanding that the original surface points coorresponded to f = 0, one can locate an approximation of the surface between the original point by identifying all the interpolated points that also result in a value of f = 0. Matlab has a built in functionality to accomplish this called isosurface. When provided with the x, y, and z grid spacing, the matrix containing the values of f at each grid point, and the value of f to locate the surface (in this case f = 0), the isosurface function plots a surface that intersects with all the (x, y, z) coordinates that result in f = 0. Unlike previous work, the quality of the results from this method can not be easily judged by numerical means such as RMSE or Max Error. Instead, a visual comparison to the original bunny statue pictured in Figure 1 will be the basis of the relative success of these methods. In the case of global RBFs, adjustment of the shape parameter affects the ability to recreate the original surface while adjusting the resolution of the 3D mesh, as expected, can affect the detail possible in the resulting surface. In the case of CS-RBFs, adjusting 1 the support parameter (i.e. ) has a similar affect to the shape support radius parameter affecting the ability to recreate the surface, and the affect of the resolution of the 3D mesh not only affects the level of detail possible directly but also as a consequence of the support parameter as will be demonstrated in the results section below. To accomplish these tasks, modifications were made to a functioning Matlab script that worked for 2D Point Cloud data that was provided. These modifications included adding a third dimension, inputting the Point Cloud data from files, removing data points associated with zero normals, and saving a *.jpg & *.fig file of the recreated surface with a filename that included the parameters used as well as the time required to run, e.g. ep150 neval25 time10p422.jpg. This coorrespondes to a shape parameter of 150, a 25x25x25 grid, and a run time of 10.422 seconds. This script is named PointCloud3D Bunny.m and has function calls to rbf.m and DistanceMatrix.m within the script. 3
An augmentation of this script was then saved under the name Point- Cloud3D BunnyCS.m that was used to handle the data set including 1889 points. Using that many original data points results in 3 1889 total points and requires the use of CS-RBFs. This Compact Support (CS) version of the script calls the function DistanceMatrixCSRBF.m which incorporates kdtree.dll and kdrangequeary.dll to allow for a more efficient implementation of the kd-tree algorithm to determine which points are within the support radius than is possible when executing the kd-tree methods using matlab scripts. Similar to the global case, *.jpg and *.fig files are saved with information about the run contained within the filename as is shown in this example: ep100 neval40 time15p406 shift0.jpg. This denotes a support parameter of 100, a 40x40x40 grid, a run time of 15.406 seconds, and a shift value of zero. The presence of the shift value in the file is a result of a brief investigation into any effects of shift the right hand side (f = 1, 0, 1) by some nonzero integer value (e.g. f = 1, 2, 3) and shifting the isosurface value by the same amount (in this example putting the surface at all values equal to 2). As expected, this generated the same surface and was deemed to be a relatively trivial exercise, and while the designation is still in the filename, it can be ignored. PointCloud3D BunnyCSLong.m is a duplicate copy of the first CS version except for the fact that it uses the largest data set of 8171 points. 4
Results As was previously discussed, the task of optimizing the shape parameter and reconstruction resolution for the globally supported RBF and optimizing the support parameter and reconstruction resolution for the CS-RBF was achieved by the relatively crude approach of running the scripts and comparing each surface generated, attempting to identify which most closely resembled the original bunny. Globally Supported IMQ: Finding the Shape Parameter Figure 2 shows the provided point cloud of 453 points to be interpolated into a surface. Figure 2: Point Cloud of 453 points on the surface of the bunny. 5
Figures 3 and 4 demonstrate the effect of changing the shape parameter. (a) IMQ Shape Parameter equal to 50. (b) IMQ Shape Parameter equal to 75. (c) IMQ Shape Parameter equal to 100. (d) IMQ Shape Parameter equal to 125. Figure 3: Adjusting the Shape Parameter with IMQ RBF (50, 75, 100, 125) interpolating of a 40x40x40 mesh. 6
(a) IMQ Shape Parameter equal to 150. (b) IMQ Shape Parameter equal to 175. (c) IMQ Shape Parameter equal to 200. (d) IMQ Shape Parameter equal to 225. Figure 4: Adjusting the Shape Parameter with IMQ RBF (150, 175, 200, 225) interpolating of a 40x40x40 mesh. Globally Supported IMQ: Finding an Appropriate Mesh Resolution Figures 5 and 6 demonstrate the effect of changing the resolution of the 3D mesh over which the surface is interpolated. 7
(a) IMQ interpolation over a 15x15x15 mesh. (b) IMQ interpolation over a 20x20x20 mesh. (c) IMQ interpolation over a 25x25x25 mesh. (d) IMQ interpolation over a 30x30x30 mesh. Figure 5: Adjusting the mesh resolution (15, 20, 25, 30) while interpolating with IMQ and a shape parameter value of 150. 8
(a) IMQ interpolation over a 35x35x35 mesh. (b) IMQ interpolation over a 40x40x40 mesh. (c) IMQ interpolation over a 45x45x45 mesh. (d) IMQ interpolation over a 50x50x50 mesh. Figure 6: Adjusting the mesh resolution (35, 40, 45, 50) while interpolating with IMQ and a shape parameter value of 150. 9
Figure 7: IMQ interpolation over a 40x40x40 mesh with a shape parameter of 150. Run time = 38.485 seconds. 10
Globally Supported IMQ: Runtimes for a variety of shape parameters and mesh resolutions Table 1: Shape parameter, Mesh Resolution, and Run time for the interpolations shown in Figures 3, 4, 5, and 6 Shape Parameter Mesh Resolution Runtime (seconds) 50 40 3 38.578 75 40 3 38.563 100 40 3 38.609 125 40 3 38.609 150 40 3 38.485 175 40 3 38.594 200 40 3 38.375 225 40 3 38.781 150 15 3 3.390 150 20 3 6.031 150 25 3 10.422 150 30 3 17.047 150 35 3 26.203 150 40 3 38.485 150 45 3 54.219 150 50 3 73.969 11
Compactly Supported RBF: Finding an Appropriate Mesh Resolution Figure 8 shows the provided point cloud of 1889 points to be interpolated into a surface using CS-RBF. Figure 8: Point Cloud of 1889 points on the surface of the bunny. Figures 9 and 10 demonstrate the effect of changing the resolution of the 3D mesh over which the surface is interpolated in the case of the 1889 point set using a simple CS-RBF (i.e. (1 r) 2 ). 12
(a) CS-RBF over a 20x20x20 mesh. (b) CS-RBF over a 25x25x25 mesh. (c) CS-RBF over a 30x30x30 mesh. (d) CS-RBF over a 35x35x35 mesh. Figure 9: Adjusting the mesh resolution (20, 25, 30, 35) while interpolating with CS-RBF and a support parameter value of 50. 13
(a) CS-RBF over a 40x40x40 mesh. (b) CS-RBF over a45x45x45 mesh. (c) CS-RBF over a 50x50x50 mesh. (d) CS-RBF over a 100x100x100 mesh. Figure 10: Adjusting the mesh resolution (40, 45, 50, 100) while interpolating withcs-rbf and a support parameter value of 50. Compactly Supported RBF: Finding an Appropriate Support Parameter Figures 11 and 12 demonstrate one effect of changing support parameter in the case of the 1889 point set using a simple CS-RBF (i.e. (1 r) 2 ). Increases in the support parameter result in decreases in the support radius, radius = 1 parameter. 14
(a) CS-RBF with support parameter 30. (b) CS-RBF with support parameter 40. (c) CS-RBF with support parameter 50. (d) CS-RBF with support parameter 60. (e) CS-RBF with support parameter 70. (f) CS-RBF with support parameter 80. Figure 11: Adjusting the support parameter for the CS-RBF (30, 40, 50, 60, 70, 80) while interpolating over a 40x40x40 3D mesh. 15
(a) CS-RBF with support parameter 100. (b) CS-RBF with support parameter 120. (c) CS-RBF with support parameter 140. (d) CS-RBF with support parameter 160. (e) CS-RBF with support parameter 180. (f) CS-RBF with support parameter 200. Figure 12: Adjusting the support parameter for the CS-RBF (100, 120, 140, 160, 180 200) while interpolating over a 40x40x40 3D mesh. 16
Figure 13: CSRBF Interpolation of Point Cloud of 1889 points with Support Parameter of 60 and a mesh resolution of 40 3. Run time = 144.234 seconds. 17
CS-RBF Run Times for various Support Parameters and 3D Mesh resolutions: Table 2: Support parameter, Mesh Resolution, and Run time for the interpolations shown in Figures 9, 10, 11, and 12 Support Parameter Mesh Resolution Runtime (seconds) 50 20 3 118.719 50 25 3 151.000 50 30 3 192.282 50 35 3 245.781 50 40 3 321.500 50 45 3 416.531 50 50 3 539.937 50 100 3 3673.328 30 40 3 1734.375 40 40 3 724.344 50 40 3 321.500 60 40 3 144.234 70 40 3 63.828 80 40 3 33.984 100 40 3 15.406 120 40 3 5.266 140 40 3 4.891 160 40 3 4.610 180 40 3 4.407 200 40 3 4.219 CS-RBF Continued manipulation of support parameter and 3D mesh resolution In the course of investigating which support parameter and mesh resolution yielded the optimal results, some potentially useful behaviors were observed. Shown below in Figures 14 and 15 are some examples of this information. 18
(a) CS-RBF param.=500, on 10 3 mesh. (b) CS-RBF param.=500, on 20 3 mesh. (c) CS-RBF param.=500, on 100 3 mesh. (d) CS-RBF param.=1000, on 100 3 mesh. Figure 14: The effects of having a very large support parameter resulting in a very small support radius on a variety of 3D mesh resolutions. Table 3: Support parameter, Mesh Resolutions, and Run time for the above interpolations in Figure 14 Support Parameter Mesh Resolution Runtime (seconds) 500 10 3 0.562 500 20 3 0.938 500 100 3 55.109 1000 100 3 54.609 19
(a) CS-RBF param.=500, on 100 3 mesh. (b) CS-RBF param.=250, on 100 3 mesh. (c) CS-RBF param.=200, on 100 3 mesh. (d) CS-RBF param.=100, on 100 3 mesh. Figure 15: The process of starting from a large support parameter on a fine 3D mesh and incrementally reducing the parameter. Table 4: Support parameter, Mesh Resolutions, and Run time for the above interpolations in Figure 15 Support Parameter Mesh Resolution Runtime (seconds) 500 100 3 55.109 250 100 3 57.156 200 100 3 59.156 100 100 3 84.250 20
Using a Compactly Supported RBF to interpolate the surface from a Point Cloud of 8171 points Figure 16 shows the provided point cloud of 8171 points to be interpolated into a surface using CS-RBF. Figure 16: Point Cloud of 8171 points on the surface of the bunny. Figures 17 and 18 demonstrate one effect of changing support parameter in the case of the 1889 point set using a simple CS-RBF (i.e. (1 r) 2 ). Increases in the support parameter result in decreases in the support radius, radius = 1 parameter. 21
(a) CS-RBF param.=500, on 50 3 mesh. (b) CS-RBF param.=500, on 75 3 mesh. (c) CS-RBF param.=500, on 100 3 mesh. (d) CS-RBF param.=500, on 125 3 mesh. (e) CS-RBF param.=500, on 150 3 mesh. (f) CS-RBF param.=500, on 175 3 mesh. Figure 17: Adjusting the mesh resolution for the CS-RBF (50 3, 75 3, 100 3, 125 3, 150 3, 175 3 ) while interpolating with a support parameter of 500. 22
(a) CS-RBF param.=500, on 150 3 mesh. (b) CS-RBF param.=400, on 150 3 mesh. (c) CS-RBF param.=300, on 150 3 mesh. (d) CS-RBF param.=200, on 150 3 mesh. (e) CS-RBF param.=175, on 150 3 mesh. (f) CS-RBF param.=150, on 150 3 mesh. Figure 18: Adjusting the support parameter for the CS-RBF (500, 400, 300, 200, 175, 150) while interpolating over a 150x150x150 3D mesh. 23
Table 5: Support parameter, Mesh Resolutions, and Run time for the above interpolations in Figures 17 and 18 Support Parameter Mesh Resolution Runtime (seconds) 500 50 3 11.296 500 75 3 32.875 500 100 3 76.328 500 125 3 148.391 500 150 3 260.953 500 175 3 416.906 500 150 3 260.953 400 150 3 262.094 300 150 3 267.578 200 150 3 1421.031 175 150 3 2381.234 150 150 3 3941.500 Figure 19: CSRBF Interpolation of Point Cloud of 8171 points with Support Parameter of 250 and a mesh resolution of 150 3. Run time = 595.078 seconds. 24
Conclusions It can be seen that from each Point Cloud data set one can recreate a surface that is readily recognizable as a bunny. As expected, when more points are provided, the reconstructed surface has more detail and more closely resembles the original bunny statue. While the 453 point data set does yield a bunny with some noticeable issues (i.e. the ears), this is also expected behavior because these issues occur in places where the surface changes abruptly and has sharper corners/edges and with fewer points comes less information to interpolate from. Other than these issues, adjusting to find suitable parametrization was relatively straight forward, and run time was not a significant issue. For the second Point Cloud data set with 1889 points, run time became a bigger concern. Though the process of investigating which combination of support parameter and mesh resolution generated a satisfactory reconstruction of the bunny, it was discovered that starting with an excessively large support parameter would drastically reduce the run time (as expected) and allow for a more systematic approach to a support parameter small enough to provide a smooth interpolation over a suitable mesh. This approach was used for the third data set of 8171 points. This allowed for an initial assessment of the feasibility of various mesh resolutions and led to a more efficient approach to reconstructing a high level of detail. As expected, even the process of using CS-RBFs to interpolate over this many points (3x8171=24513) over a fine enough mesh to reflect the detail of information provided can take a significant amount of time to run. The matlab script developed for this task used a for loop to iteratively change the grid resolution and save the *.jpg and *.fig files. While this did not reduce the run time for the individual runs, this did remove the need for the user to be monitoring progress the whole time. As was discussed, the evaluation of success was based solely on visual inspection. Several other figures were generated than the ones that were included in this report. Also tested for the largest data set was one of Wendland s shifted CS-RBFs (φ(r) = r+(56 6 88r + 35r 2 )). Submitted with this report separate from the folder containing the files for the Latex version of the report in a folder labeled figures is a complete collection of the figures generated. This may provided useful to allow one the opportunity to see which other combinations of parameters were tested and the results generated from these tests. The subdirectory IMQ contains results from the 25
453 point data set, CSRBF contains results from the 1889 point data set, and CSRBF2 contains results from the 8171 point data set. In this last set, the figure filenames starting with W coorresponde to those using the Wendland s CS-RBF. 26
References [1] http://graphics.stanford.edu/data/3dscanrep/, http://www.cc.gatech.edu/ turk/bunny/bunny.html, Greg Turk, Computer Graphics Group, Georgia Institute of Technology, USA. [2] C.S. Chen, Y.C.Hon, R.A. Schaback, Scientific Computing with Radial Basis Functions, Department of Mathematics, University of Southern Mississippi, USA.S [3] Tyler Reese, COS702 Assignment 1; Radial Basis Functions, University of Southern Mississippi, Septmeber 22nd, 2012. [4] Tyler Reese, COS702 Assignment 3; Compactly Supported Radial Basis Functions, University of Southern Mississippi, October 16th, 2012. [5] C.S. Chen, Lecture Notes (presentation slides); COS 702; Point Cloud Data, Department of Mathematics, University of Southern Mississippi, USA.S 27
28