How to save and view the calculated psnr, mse and snr values of multiple images using array?

20 views (last 30 days)
MINO GEORGE on 14 Apr 2021
Answered: Monisha Nalluru on 20 Apr 2021
This is my code
[peaksnr, snr] = psnr(m, g);
how to display these measures in excel or in any other formats?

Answers (1)

Monisha Nalluru
Monisha Nalluru on 20 Apr 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;
% store whole calculations result in table
t = table(finalpsnr,finalsnr,finalmse);
% use writetable to write content to required file format

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!