Hello I jave good expertise in K means clustering and vector quantization algorithms. I can complete this task in a day.
I'll attach sample of my Vector quantization code. I have my own K means code as well.
function [codedData,compressionRatio] = ...
vectorquantization(codebook,dataVectors)
% Vector quantization of an Image
% This function performs the vector quantization of an input gray scale
% image data vector and gives the output which contains the coded indices.
% =========================================================================
% Vector Quantization
% =========================================================================
% Inputs: codebook --> Codebook consists of the representative vectors.
% dataVectors --> Input data vectors.
% Outputs: codedData --> Encoded values.
% compressionRatio --> Compression ratio in bits per pixels
%
%
%
% =========================================================================
[nCodes,~] = size(codebook); % Number of codes in the codebook.
[nVectors,nElements] = size(dataVectors); % Number of data vectors.
codedData = uint8(zeros(1,nVectors));
codebook = double(codebook);
distanceL2 = zeros(1,nCodes);
cunt=0;
for iVector = 1:nVectors
for iCode = 1:nCodes
distanceL2(iCode) = euclideandistance(dataVectors(iVector,:),...
codebook(iCode,:));
end
temp = find((distanceL2) == min(distanceL2));
if(lengt