1. You need to manually implement the K-Means algorithm. You also need to implement Image Color Quantization as a function using your KMeans algorithm. Note that the empty cluster center should be checked and avoided.  2. Apply your function on the given image (test.jpg) by setting the numbers of clusters to 2, 8, 16, and 32, respectively. Illustrate the original image and images with color quantization. 3. Randomly pick the colors of pixels as centroids (instead the centroids calculated by the KMeans algorithm) and conduct color quantization. Show the original image and images with color quantization with K=2, 8, 16, and 32, respectively. Compare the image generated using K-Means algorithm and randomly picked centroids. 4. Pick an image you like and conduct the Image Color Quantization using K-Means. (Pick any values of K you like.) Use the test image attached. You should manually implement the K-Means algorithm. You can only use packages: numpy (for calculation and implementation of K-Means algorithm), matplotlib (for image load and show), sys, and os. Citation is a must if you find any resources helpful. Write everything in a single Jupyter notebook and add comments for your code if needed.

icon
Related questions
Question

1. You need to manually implement the K-Means algorithm. You 
also need to implement Image Color Quantization as a function using your K
Means algorithm. Note that the empty cluster center should be checked and avoided. 

2. Apply your function on the given image (test.jpg) by setting the numbers of clusters to 2, 
8, 16, and 32, respectively. Illustrate the original image and images with color quantization.

3. Randomly pick the colors of pixels as centroids (instead the centroids calculated by the K
Means algorithm) and conduct color quantization. Show the original image and 
images with color quantization with K=2, 8, 16, and 32, respectively. Compare 
the image generated using K-Means algorithm and randomly picked centroids. 
4. Pick an image you like and conduct the Image Color Quantization using K-Means. (Pick 
any values of K you like.) Use the test image attached.

You should manually implement the K-Means algorithm. You can only use packages: numpy (for 
calculation and implementation of K-Means algorithm), matplotlib (for image load and show), sys, 
and os. Citation is a must if you find any resources helpful. Write everything in a single Jupyter 
notebook and add comments for your code if needed.

Expert Solution
steps

Step by step

Solved in 2 steps with 9 images

Blurred answer