






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Input: a triangular mesh and a positive integer K
Output: the same mesh with each face assigned a patch id from 0 to K-
You can either use the already compiled fcc.exe file under the “fcc” folder, or build the fcc.sln and run it from VS2005 IDE. Files under “Opengl” and “plys” folders are needed at compile time and run time. You have to keep the folder structure.
After starting fcc.exe, everything is easy. You just have to start it once and access all different models from the GLUI window. When you select a model, it could take a while (usually less than 30 seconds) before the final segmentation is available.
There is a spinner control to let you change the value for K. After K is set, click the “Run” button to re-compute the segmentation with the new K value.
You can click the “Save” button to save the segmented model to a file under the “OutputModels” folder. The file name indicate the model and K. For example, “my_bunny_40.ply” is the bunny model segmented into 40 pieces. One thing to notice is that the texture coordinates written in these files are fake (all 0.0). You can run the programs I submitted for project 3 to generate parameterizations for them.
K-Means algorithm is a classic and possibly the most widely used data mining algorithm for clustering purposes. It’s an EM-like method. First, it classifies each data point to its closest center based on some distance metrics. Then, it computes the new center for each cluster to minimize the average distance to the data points of this cluster. And it iterates until the centers do not move.
In [Katz & Tal 2003], they applied this algorithm to surface segmentation on the triangle meshes. Their method is as following:
I have implemented this method but find the following problems:
A common solution for segmenting large meshes is to simplify the mesh first, segment the simplified model, and then map the segmentation back to the full model. This is used in the two segmentation papers ([Katz & Tal 2003] and [Zhou et al. 2004]) I have read. Although it might be a good solution, mesh simplification is not the focus of this project.
¾ Compute the face distance matrix D[N][N], N is the number of faces, by: o Calculating distances between the centers of the neighboring triangles. Here, a combination of the geodesic distance and angular distance is used. o Running Floyd algorithm to populate the whole distance matrix. ¾ Run 2-Means algorithm to segment the mesh into two patches: o Find two faces that are the most far away, as initial centers of two patches. o Classify each face to the closer patch. o For each patch, find the face that has the minimum average distance to all the faces within the patch, as the new center of this patch. o Goto step 2 and loop until the centers stop moving ¾ Keep segmenting patches until some stopping conditions are satisfied
During the iterations of the K-Means algorithm, centers of the patches are kept being pushed around by each other. If two centers are too close to each other, they will be pushed away during the next iteration. After K-Means converges, the centers are usually distributed more evenly. Below is the screenshots of the bunny model that is segmented into 10 patches. The one on the left is the initial segmentation with random centers. The one on the right is the final segmentation when K-Means converges.
The visible points on the model are the centers. We can see that after K-Means converges, the centers are more evenly distributed.
Another observation is that, in the surface segmentation applications, the final positions of the centers are usually at the “peaks” of the body parts like ears, feet, tail, etc. To the right is the final screenshot for the dinno. We can see that the centers are at the top of the horn, the center of the mouth, the bottoms of the four feet, the center of the back and the end of the tail.
In our project 3, the surface segmentation is used for the texture mapping purposes. But I will argue that the surface segmentation produced by the K-Means algorithm is not good for the texture mapping application.
From the screenshot of the dinno above, we can see that the tail is segmented as one piece. Apparently, this is bad for texture mapping because the planarity criteria is severely violated. It will make a patch with high stretch. Similar parts are the horn, the head and four legs. And more seriously, there is no guarantee that the resulting patches are able to be unfolded without further cuts.
The aim of the K-Means algorithm on surface segmentation is to segment models into “meaningful” parts. For example, the dinno is segmented into eight meaningful parts: horn, head, four legs, back and tail. An application of this kind of segmentation is skeleton extraction. By connecting the centers of the eight patches above, we will get a pretty nice skeleton of the dinno.
Below is some interesting screenshots for final segmentation on the cow model with different input K. We can see how the algorithm intelligently decides the “meaningful parts” for different K values. Ordered from top to bottom, left to right, the K values are 2, 4, 5, 7 and 10.
I saved the segmented models and plugged them into the texture mapping pipeline produced in project 3. Following tables show the comparisons between the original segmentation (given in project 3) and my new segmentation using fast marching K- Means. The first table shows the area-weighted stretches and the second table shows the packing ratios. Mean value weight scheme is used during unfolding patches for both segmentations.
Weighted Stretches Original Segmentation My Segmentation
Bunny 0.001143 0.
Feline 0.000944 0.
Dragon 0.000549 0.
Happy 0.000587 0.
Packing Ratios Original Segmentation My Segmentation
Bunny 0.655613 0.
Feline 0.651266 0.
Dragon 0.655831 0.
Happy 0.649695 0.
From the above tables, we can see that my new segmentation gives smaller stretches than the original segmentation, but yields lower packing ratios. The worse packing ratios can be explained by the observation that the sizes of the patches in my segmentation vary a lot. The better stretches are unexpected. The only explanation will be that the original segmentation is pretty bad and easy to beat.
I’m not very satisfied with the current fast marching K-Means method. There are various aspects that need to be improved. Here are some thoughts.
6.1 How to decide K
As we have seen in the screenshots above, the value of K is very critical for this algorithm. Different K values will yield different “meaningful parts”, just like we have seen on the cow. And an inappropriate K value will result in bad segmentation in terms of “meaningfulness”. For example, K=40 is apparently a bad choice for our relatively simple models. From the screenshots for the bunny and the dragon, we can’t tell the “meaning” of each patch.
Current algorithm requires the K to be input before the surface can be segmented. Sometimes this might not be plausible. For example, we may want to batch process a large number of surfaces and thus it might be impossible to have human being visually inspect all the models and assign K for each of them. Even if we can, it might be hard for human to decide K for some complex models. Therefore, it will be very useful if the algorithm can intelligently decide a good value for K based on the geometric properties.
Since we use a clustering algorithm (K-Means) to do the segmentation, the problem is essentially how to decide the optimal number of output clusters. The AI community has done some researches towards this goal. One thing to do is to first segment the surface into many small patches, and then merge neighboring patches that are “similar” to each other. Professor Xiaoli Fern suggested a common tool called Dendrogram [Den] that can be used to decide where to stop the merging process.
The problem is then centered on how to define the similarity measures between two patches. I don’t have an answer for this but I feel that the angular distance might be a good starting point.
hope the boundaries are at the real boundaries between the meaningful parts. For example, we hope to cut the bunny around the neck, the roots of the ears, etc.
Graph cut seems to be a common technology used for this purpose. At least in the two segmentation papers I have read, they both use graph cut after the clustering. The implementation should be easy. We can build a graph from the “boundary parts” (faces that are close to the boundary), and construct a flow on this graph based on the angular distances. Then a standard mini cut algorithm can be applied on this graph and find the optimized boundary.
By defining the capacity function based on the angular distance, this graph cut method will prefer to cut at the concave parts of the surface. Usually these parts indicate a change of meaningful parts.
[Katz & Tal 2003] Hierarchical Mesh Decomposition using Fuzzy Clustering and Cuts, SIGGRAPH 2003.
[Kimmel & Sethian 1997] Computing Geodesic Paths on Manifolds, Proc. Of National Academic of Sciences, 1997
[Zhou et al. 2004] Iso-charts: Stretch-driven Mesh Parameterization using Spectral Analysis, Eurographics Symposium on Geometry Processing, 2004.
[Den] http://en.wikipedia.org/wiki/Dendrogram