m
Line 17: Line 17:
 
== Color Quantization Application ==
 
== Color Quantization Application ==
  
In image processing, a common problem is determining how to compress an image without losing essential information. This is particularly relevant for color images, since they require the storage of three parallel matrices to store information for the red, green, and blue components in the image. Using k-means, combinations of colors can be quantized into a certain number of levels. In the context of k-means, these color levels would be the centroid. For each pixel, the closest centroid is determined by treating each pixel as a vector of <r,g,b> and using the distance formula to find the distance between the pixel and each centroid. The algorithm assigns each centroid a color value that represents the average of all the pixels that were closest to that centroid.
+
In image processing, a common problem is determining how to compress an image without losing essential information. This is particularly relevant for color images, since they require the storage of three parallel matrices to store information for the red, green, and blue components in the image. Using k-means, combinations of colors can be quantized into a certain number of levels. In the context of k-means, these color levels would be the centroid. For each pixel, the closest centroid is determined by treating each pixel as a vector of <r,g,b> and using the distance formula to find the distance between the pixel and each centroid. The algorithm assigns each centroid a color value that represents the average of all the pixels that were closest to that centroid.  
  
 +
The images below show the result of using K-means to quantize a color image. The image that is quantized with 256 levels is almost indistinguishable from the original.
 +
 +
{| class="wikitable"
 +
|-
 +
! Original Image !! K = 2 !! K = 20 !! K = 256
 +
|-
 +
| [[File:kmeans_orig.jpg|225px|thumb|left]] || [[File:kmeans_2.png|225px|thumb|left]] || [[File:kmeans_20.png|225px|thumb|left]] || [[File:kmeans_256.png|225px|thumb|left]]
 +
|}
 
----
 
----
 
== Phoneme Classification Application ==
 
== Phoneme Classification Application ==

Revision as of 17:12, 22 April 2017


K-Means Clustering Applications in Digital Signal Processing

by Sara Wendte


Introduction

K-means clustering is a simple unsupervised learning method. This method can be applied to implement color quantization in an image by finding clusters of pixel values. Another useful application would be automatic classification of phonemes in a speech signal by finding clusters of formant values for different speakers.


Theory


Color Quantization Application

In image processing, a common problem is determining how to compress an image without losing essential information. This is particularly relevant for color images, since they require the storage of three parallel matrices to store information for the red, green, and blue components in the image. Using k-means, combinations of colors can be quantized into a certain number of levels. In the context of k-means, these color levels would be the centroid. For each pixel, the closest centroid is determined by treating each pixel as a vector of <r,g,b> and using the distance formula to find the distance between the pixel and each centroid. The algorithm assigns each centroid a color value that represents the average of all the pixels that were closest to that centroid.

The images below show the result of using K-means to quantize a color image. The image that is quantized with 256 levels is almost indistinguishable from the original.

Original Image K = 2 K = 20 K = 256
Kmeans orig.jpg
Kmeans 2.png
Kmeans 20.png
Kmeans 256.png

Phoneme Classification Application


References

"14.2-Clustering-KMeansAlgorithm- Machine Learning - Professor Andrew Ng",
https://www.youtube.com/watch?v=Ao2vnhelKhI.

Stanford CS 221,"K Means",
http://stanford.edu/~cpiech/cs221/handouts/kmeans.html.

Purdue ECE 438, "ECE438 - Laboratory 9: Speech Processing (Week 1)", October 6, 2010,
https://engineering.purdue.edu/VISE/ee438L/lab9/pdf/lab9a.pdf.



Back to 2017 Spring ECE 438 Boutin

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang