I hava a function for quantization and decrease the bit depth of images and then increase it and compare with original image.As result I need a table like this:(MSE:mean square error)
but I don't know a much about companding and uniform qauntizations. this is my function.
function [Q,Q2,Err] = quantization (I,b);
img=imread(I);
Q=uint8(img/2^(8-b));
Q2=uint8(Q*2^(8-b));
Err=mean(mean((double(img) - double(Q2)).^2,2),1);
subplot(1,4,1), imshow(img)
subplot(1,4,2), imshow(Q)
subplot(1,4,3), imshow(Q2)
display(Err)
end
help me please...