CMPUT 307 - Lab 8 Clustering of Large Point Cloud Models
In this lab you will be given a number of 3D models on which you are going to apply PCA followed by clustering. The purpose will be to choose the initial cluster centers in a more scientific and systematic manner. The skeleton code for this exercise will not be provided and you need to implement the complete code (in Matlab) satisfying the following requirements:
(a) Download Materials.zip file and decompress it in your Matlab directory. Open and run the lab8.m file to read and load the dragon.ply model into your program. The points of the model will be storage in the variable X. After running the code you will see a dragon as shown in Figure 1. (b) Determine N, the number of points in the model in Part (a). (c) Perform a PCA on the N points of the model. Determine the First Eigen Vector. For this step, you can directly call pca() function from the library. You do not need to write the pca algorithm. (d) Transform the points of your model by a rotation, so that the First Eigen Vector becomes the New X-axis. (e) Sort the transformed points following Part (d), based on the new X values. (f) Determine the Minimum X value MinX, and Maximum X value MaxX, following Part (e). (g) Divide the interval (MinX, MaxX) into 100 parts (Xi, Xi+1), i = 0, ..., 100; such that each part contains about the same number of points. (h) For each interval in Part (g) do the following:
- CreateN/1000clustersfromallthepointsintheinterval.Commentonhowyou chose the initial cluster centers.
- Do the clustering. You can directly call the k-means function from the library. You do not need to write the k-means algorithm.
- Store the final cluster centers and the distance of each cluster center to a point on the boundary of this cluster. We will call this distance the radius of acluster. (i) Writeanewdatafilecontainingeachclustercenteranditsradius,consideringallthe intervals in Part (h). Figure 1
(j) Display the new data file in Part (i) as a collection of transparent spheres; where each sphere represents a cluster center having a radius equal to the radius of this cluster. Then draw all the points in Part (d) on the same figure. Submit a zip file with all your code used during these exercises, and a pdf file containing all the plots.