I performed bicubic interpolation on a 256*256 image(img)
dest = interp2(img,'bicubic')
and i got a 511 * 511 image.I want to compute PSNR of a 512 * 512 image(original) and the 'dest' image as follows
original = double(original);
dest = double(dest);
[M N] = size(original);
error = original - dest;
MSE = sum(sum(error .* error)) / (M * N);
if(MSE > 0)
PSNR = 10*log(255*255/MSE) / log(10);
disp(['PSNR = ', num2str(PSNR)])
else
PSNR = 99;
disp(['PSNR = ', num2str(PSNR)])
end
But I'm getting error due to different matrix dimensions.How to avoid this error.Is it possible to calculate PSNR of images with different size?Please help