How to Calculate mse?
Mostra commenti meno recenti
How to Calculate mse? This is correct mse = mean(mean((originalImage-embeddedImage).^2));
Risposte (1)
Image Analyst
il 8 Mag 2015
0 voti
No, only if they're floating point images, not integer images like uint8. You need to cast them to double so that your numbers don't get clipped at 0 if they would go negative.
You're best off using the built-in immse(). Otherwise if you want to do it yourself because you're missing the toolbox, see my attached code.
2 Commenti
Image Analyst
il 8 Mag 2015
Reem's "Answer" moved here:
function [PSNR]=psnr(originalImage,embeddedImage)
mse = mean(mean((originalImage-embeddedImage).^2));
MAXI=255; %MAXI is the maximum possible pixel value of the image.
%When the pixels are represented using 8 bits per sample, this is 255.
PSNR=10*log10(MAXI^2/mse);
end
This code
Image Analyst
il 8 Mag 2015
Not if they're typical images. Like I explained and showed you in the psnr.m file I attached for you, you need to case to double if they're uint8 which most images are.
mse = mean2((double(originalImage) - double(embeddedImage)).^2);
Categorie
Scopri di più su Image Arithmetic in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!