|
OverviewThe purpose of this lab was to compare a selection of the software produced by the Jyamiti group. We were given a selection of software that works on point cloud data to do a variety of tasks. In particular, we were to experiment with cocone for surface reconstruction, normfet for normal and feature estimation, and amls for smoothing (of noisy data).DatasetsI chose a variety of datasets with two purposes in mind. First, I wanted to see some sort of baseline, so for that I chose to use two datasets, the Stanford bunny and Stanford dragon, both available from the Stanford 3D Scanning Repository. There are a number of versions of the datasets available online at various resolutions; for the most part I've compared all sets of resolutions (except the highest version of the dragon which had a prohibitive number of points for me to experiment with). To construct these sets of points, what I chose to do was to use the reconstructed versions of the bunny and dragon, but then take the point set out of them. This could, in theory, produce artifacts of whatever reconstruction technique was used by Stanford, but it was necessary since the scans available are from multiple viewpoints and are not registered with each other in one master point sets.Here are some images of the point clouds for the Stanford bunny and dragon set that I used. Coloration is done by a scaling of the (x,y,z) coordinates into [0,1], and then turning that value into an RGB color (i.e. x->R, y->G, z->B). All images are clickable to a large version, and include a brief description below them: Stanford bunny:
Stanford dragon:
In addition, I wanted to try out some more complex topological datasets. In particular, I got the idea to try to make some torus knots, which are known to be not homotopic to an actual torus. The rationale here is that I was interested in seeing how well cocone produced a surface that was both homeomorphic and homotopic to the original point set. To generate the knots, I wrote some code which implemented a point set using equations found here for (p,q) torus knots. This creates a curve in R^3, which I then extended to create point sets in a circle in the plane normal to the curve to create a 2-manifold. It took me a while to get this equation correct, and as a result I have included a number of datasets with a skewed circle region around the curve which I will explain below when they come up in the results. Below I show 5 images of different tori knots that I used. Each knot is uniquely described by two relatively prime numbers, p & q, which represent the number of times the torus knots around itself. In addition, for the datasets I've taken a fixed radius out from the curve as well the number of "stacks" (number of steps taken around the curve) and slices (number of points in each circle around the surface the curve) and I've given the total number of points as well. The bottom row are two distorted tori, one where I've forgotten to normalize the vectors in the plane orthogonal to the curve, and the second where I've calculate the plane using a poor approximation (and not normalized as well) Finally, to generate noisy sets, I took the torus code from above and implemented a jitter. My jitter was done in a simple manner, basically for each (x,y,z) of the original pointset, I created a new (x', y', z') such that x' = x * (1 - %n), when %n is the percent amount of noise I wanted. For example, in the dataset with 5% noise, %n was a random value chosen from [-5% to 5%]. To keep a baseline, I generated a set of noisy point clouds from Torus #3 above at various levels of %n
Results for CoconeUsing Cocone I had a number of interesting results which are best viewed pictorially. First, let's take a look at the results of the Stanford bunny dataset:It's quite clear from the results that even the highest resolution of the bunny scan is lacking in the amount of sampling necessary to fully reconstruct. Cocone does a good job here though with what it's given. You can see at the max resolution there's only a few small holes in ridges, around the ear, and on the bottom where sampling missed a number of places:
As resolution decreases, the ears continue to be a problem. However, in some ways the model improves because the bottom gets filled nicely. Also, at the lowest resolution i encountered some non-manifold results, which I've highlighted by drawing the mesh on top of the bunny:
The explanation for this isn't really surprising though. As the sampling resolution decreases, features like the ears are of course not sampled enough. But around the bottom, as there are fewer points, the bottom becomes easier to approximate as just a flat surface. The Stanford dragon is an even more complicated dataset in terms of number of small sharp features like the ears, teeth, toes, and ridges. Considering I've taken only lower res versions, the results we get aren't bad at all: Some close up shots reveal a gaping hole where the dragon wasn't scanned well between the leg and the bottom. In fact, this would be a rather difficult area for current scanners of today to get well, so this isn't too surprising. In addition, at lower resolutions, the ridges totally deteriorate, in the extreme instance merging with the back of the neck of the dragon:
I was pleased to find that for the most part all of the tori knots were reconstructed well. In some cases, I did have a bit of a sampling issue, but I was also trying to generate pathological bad cases to 'break' Cocone as well. Again, let's first view the results of each tori's reconstruction: From the numbers above, I am happy to report than Torus #1 and #3 were reconstructed just fine as well as the Distorted Torus #2. However, that is the end of the good news, as the others had problems. In particular, Torus #2 for some reason had a hole form on its back side. I can't quite understand why this should happen as this torus I thought was sampled well. Plus, considering all loops in it are basically equal, why is there only a whole in that particular one on that particular side? In addition, the Distorted Torus #1 had a number of issues, some not surprising, but one which was. In the regions where the surface becomes very ridge like (right side of image), or narrows down to a very thin tube (center), I was not surprised to find issues with the sample. However, Cocone again made another hole in a supposedly well sampled area (lower left), which I've drawn below with a mesh to fully clarify its location. I'm not sure of a good explanation for this hole.
Finally, I did do some reconstruction on the noisy tori knots set, but these are somewhat less meaningful. They will mostly be best used as a comparison against the AMLS smoothed versions, but I've included them up here in their pre-smoothed versions for completion:
Results for NormFetFor NormFet I do not have too many results to report as I've considered NormFet to be part of the pipeline into AMLS to provide me with approximate normals and feature sizes. However, using NormFet for just and end result of estimating the Normals and Feature size can be useful in and of itself. For starters, below I show some of the point clouds with the point colored in various shades of red based on the feature size of the points. The brighter reds indicate a larger local feature size. I've shown below for the #1 and #3 bunnies as well as Noise for 2.5% and 5%. In the AMLS experiments below, I worked primarily with the noise datasets, but I also thought to try out the scanned datasets to smooth noise out of them.
Unfortunately though, I couldn't think of a better way to visualize the normals other than drawing unit length line segments in the directions of the normal. This gives a nice "fur" effect, but is not very conducive to viewing them in a 2d picture (rotating them interactively is just OK). The normals are drawn in green, with brighter greens indicating lower local feature size. Again, these visualizations aren't great, but you can notice in the Bunny #3 and the noise datasets that some of the normals don't match quite what they should:
Results for AMLSAfter passing point sets to NormFet to estimate the LFS and the normals, I then passed them into AMLS to smooth out the resultant point set. For the most part, the results I got out of AMLS were quite good in their ability to smooth out noise. It had some trouble with the higher levels of noise, but considering these were 10% and 20% noise, this is no surprise at all, as the knotted torus loose much of it's geometry at this level of noise.First though, I have some results for the two scanned datasets. Below I show the output of cocone when run on the AMLS output of the Stanford bunny at each of the resolutions: Cocone output of original bunny dataset:
Cocone output of AMLS bunny dataset:
One can see from above that AMLS did indeed smooth out some of the roughness from the dataset. Especially around the leg region a lot of the undulations are gone. Also, by rearranging the points, I observed that some of the holes shrunk in the reconstruction as well. When run through AMLS, the number of artifacts in the reconstruction of the dragon was greatly reduced. Below I show another comparison of before and after. Some important things to note are how the scales of the dragon basically disappear after AMLS is run. Also, a lot of the isolated points disappear, as they are merged into (sometimes awkwardly) features of the dragon. Cocone output of original dragon dataset:
Cocone output of AMLS dragon dataset:
In particular, I've some shots of the top of the Dragon #3 and the back of the head of Dragon #4 to show some of the limitations of AMLS. Here, undersampling really played a large role in the ability of AMLS to fix the datasets. Esp. with the shot of the back of head in Dragon #4, where those isolated points are merged together.
Finally, I show some results of AMLS on the noisy tori knots. I (of course) did not choose to run AMLS on the non-noisy versions of the tori, since they are generated by analytic functions so should already be smooth. Below I compared the results of cocone reconstructing the AMLS output at each level of noise: Cocone output of original noisy tori:
Cocone output of noisy tori after AMLS:
I was very pleased with these results. At the noise level of 2.5%, AMLS was able to project all points onto a smooth surface with no holes or anything. This result is quite an improvement from Cocone's original output. At the higher levels (10% and 20%), it did not do so well, but ever still far more of the points are projected onto some surface than the original version, which is good. In the 5% case, it did a relatively good job, but on the right side of the image there is still a gap which I've given a close up of below:
Conclusions and ObservationsFor the most part, the original Cocone software did a rather good job of producing surfaces, even under noise. I especially appreciated the fact that at least it could identify where it failed, and mark the output accordingly. It's obvious that there are some limitations in the original algorithm, but that's why other versions of cocone have been created which fix them. I was surprised though to find in a couple of cases holes appearing where I did not expect them. In particular, in the datasets above, Torus #2 and Distorted Torus #1 both had holes that I would consider to be unexpected.In my experiences with Cocone, I found that I would have liked a little more flexibility in what I could do with it. In particular, I wanted more verbose output, especially some timing information of how long the different parts of the algorithm took to execute. I thought this sort of information would be nice to have in a lab report. Experimentation with NormFet went well, although I didn't really have a good way to compare the results other than visualizing. I suppose one potential method would be to directly compute the normals at each point for the implicity knotted tori and then compare them, but this seemed a bit overboard for the application. Otherwise though, it's apparent NormFet has its only small niche of necessity, and it does a good job at filling it. With AMLS I was impressed with the results and its ability to tolerate noise and smooth it. I was a bit annoyed with the pipeline of what to do here; at least for my purposes it seemed more or less like AMLS could have just called NormFet first instead of me having to do it. I suppose the rationale is that you might have the exact normals from some other dataset, which is fine, but I could envision AMLS having a flag which indicates whether or not to calculate the normals and feature size using NormFet internally. Otherwise though, the results seemed visually good. I thought to write code here to calculate the Hausdorff distance between the output of AMLS and the original, noise-free version of the tori. However, I realized that this wouldn't give me a good result, since there's no guarantee that AMLS is projecting the point set back onto the original torus knot. Or even if the geometry output was exactly the same, there's no clear way to account for a uniform transformation (translation, rotation, etc.) of all the points when calculating the Hausdorff distance. Thus, even for the low noise datasets, which AMLS should output a surface nearly exact to the original, the Hausdorff distance could still be large relative to the noise. Thus, again other than visually, I didn't have a good way to compare the output. |