Code covered by the BSD License  

Highlights from
K Means Algorithm with the application to image compression

K Means Algorithm with the application to image compression

by

 

This program uses the K means clustering algorithm to group the pixels in an image

displayImage(I, XCompressed, K)
function displayImage(I, XCompressed, K)

% Displays best final compressed image.

% Display the original image 
subplot(1, 2, 1);
imagesc(I); 
title('Original');

% Display compressed image side by side
subplot(1, 2, 2);
imagesc(XCompressed)
title(sprintf('Compressed, with %d colors.', K));

Contact us