Question: if using matlab, please provode code 1 (30pts) Theory Questions 1. Given the following image pixel intensity values I=[102103] (a) Perform k-means clustering with k=2.
1 (30pts) Theory Questions 1. Given the following image pixel intensity values I=[102103] (a) Perform k-means clustering with k=2. Your initial references vectors will be a1=[1] and a2=[2]. You will be "running" the k-means algorithm manually. Until the cluster assignments don't change: i. Assign an observation (pixel) to the reference vector it is closest to, using the Euclidean distance on the pixel value. ii. Update the reference vectors to be the means of their members. Show the value of the reference vectors, and the cluster assignments for each iteration you must perform (10pts). (b) Using the same grayscale image above, compute the weights between the pixels for a fully-connected, undirected graph representation. You can either show this as a drawing of the graph (in which case, a hand-drawn visualizations, inserted into your PDF, with the weights on the edges is fine) or provide the weight matrix (the upper-diagonal of it is fine, since it will be symmetric). For the weights of the edges connecting pixels, we'll use a combination of their value and location. For pixel a, let a, be its value/intensity, and (ax,ay) be its location. We can then compute the similarity/weight between pixels a and b as: w(a,b)=e((atb0)2+(atbk)2+(ayby)2) In addition, consider a pixel not to be connected to itself (weight =0 ). You should leave your weights in terms of e (10pts). (c) Find the minimum non-trivial graph cut using the matrix formulation way shown in class. You may (and should) use function like svd do eigen-decomposition for you. You'll likely need to read its documentation to understand how to the inputs and outputs work. Show the intermediate matrices needed for your eigen-decomposition, namely D and W, and what the choeen eigenvalue/vector pair is. Finally draw your new (cut) graph (and include that image) and/or just tell us which pixels belong to which groups. (10pts)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
