Answered step by step
Verified Expert Solution
Question
1 Approved Answer
what else am i missing for the assignment? thanks Perform k-means color clustering in two photos you will take, and detect skin regions. The scopes
what else am i missing for the assignment?
Perform k-means color clustering in two photos you will take, and detect skin regions. The scopes of this assignment: (1) to identify qualitatively/visually, what data (images) can make processing casier, including resolution, distance from target, background complexity, lighting, etc:; (2) to evaluate the computational challenges; (3) to study a simple clustering method in image region segmentation and be able to identify alternative solutions. Specifically: 0. take two photos of a subject in a setting you define; the face region should be visible and not occluded; one or both hands (and/or arms) should also be visible. 1. implement "repetitive" k-means, as described below; you can use a fixed k (number of clusters). 2. cluster the image pixels with respect to color, and display the corresponding k probability maps. 3. threshold the probabilities to detect skin regions (binary outcome for each pixel); each pixel will have k probability values; for a pixel to be considered as skin region, the highest among its k probability values should correspond to the skin color cluster's) and should be over a threshold. Repetitive k-means: Every execution of k-means is an iterative process, from start to convergence, using randomly chosen cluster centroids during initialization. Consider an execution as a single instance in a "bigger" repetitive process, where you will execute k-means with different randomly chosen centroids. The output should be probability maps: e.g., for k=3, output should be three maps: P(x belongs to k=i)F), for i=[1,2,3](F= how often a pixel "jumps" to a ditferent cluster, or how salient the assignment of x to i is). Example: step 1: load image into variable X (of size hw3 ) step 1.5: numofexec = 1 (counts how many times you execute k-means; initialize to 1) step 2: randomly choose three pixels and use their color as initialization in the color space; i.e., (C1,C2,C3) for k=3, where C1,C2, C3 are 31 (or 13) matrices. step 3: perform k-means: Xout = somekmeansfun( X,k,C1,C2,C3)=m notice the input: variable k, and random centroids =m> you should assign a fixed value prior to step 1. The output Xout should be of size hw1. For more compact representation (see below), M/ : . . , numofexec) = Xout. See notes below. step 4i numofexec = numofexec +1; Repeat step 2 ; repeat step 3 . step 5: At the end, you will have a 3-dimensional matrix M : size( M)=[h, w. numofexec]. You can visualize the cluster assignments of the pixel X(i,j). as: v=M(i,j,z)= ssize (v)=[1, numofexec ](1 numofexec) = s plot it. For each pixel, you can calculate the frequency of its assignment to each cluster using V. Notes: - steps 2-4 should be in a for-loop. * in each exec., the cluster numbers may change: you need to reassign numbers based on the centroid values fe.g., use as reference the value of a chromatic component), For example: the "deep red" (high R-values, very low G,B-values) cluster may be labeled as "1" in one k-means execution, and as "2" in another execution; you will have to align/readjust those cluster number after each k-means execution. ** to randomly choose centroid values, you can use a random integer generator that will be sampling the image pixels thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started