% create a script:
%  ○ load market.jpg
%  ○ check whether is it color (today we would like to work with color images!)
%  ○ convert it to the necessary data-format
%  ○ use vl_kmeans to cluseter the datapoints, in the beginning to 30 different clusters
%  ○ convert back the result data to a normal image
%  ○ display it

im = imread('market.jpg');
if (size(im,3) ~= 3)
    error 'This picture is colorful!'
end

[N M c] = size(im);
[x y] = meshgrid(1:M,1:N);
im(:,:,4) = x;
im(:,:,5) = y;

transformed_data = reshape(im, [N*M 5]);

[C, A] = vl_kmeans(double(transformed_data), 5);
