How to save and view the calculated psnr, mse and snr values of multiple images using array?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
This is my code
[peaksnr, snr] = psnr(m, g);
MSE=mean2((m-g).^2);
how to display these measures in excel or in any other formats?
0 commentaires
Réponses (1)
Monisha Nalluru
le 20 Avr 2021
From my understanding you wanted to save the result of psnr, mse, snr in excel file.
If all the images filename is stored in array then you for loop to calculate psnr, mse, snr
imagesname = ['image1','image2']; % all images names
refimg = imread('referenceimage');
finalpsnr = []; % store psnr of each image
finalsnr = [];
finalmse = [];
for i=1:length(imagesname)
img = imread(imagesname(i));
[psnr,snr] = psnr(img, refimg);
mse = mean2((img - refimg).^2);
finalpsnr(i) = psnr;
finalsnr(i) = snr;
finalmse(i) = mse;
end
% store whole calculations result in table
t = table(finalpsnr,finalsnr,finalmse);
% use writetable to write content to required file format
writetable(t,'cal.xlsx');
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!