Effacer les filtres
Effacer les filtres

compute the PSNR and SSIM of only the restored regions of the image

7 vues (au cours des 30 derniers jours)
Patrice Gaofei
Patrice Gaofei le 29 Déc 2020
Hello everyone,
Please, I would like to know how to calculate the PSNR and SSIM of only the restored regions of an image given the corresponding label of those regions. In fact, I have performed image inpainting using some masks, and I would like to assess the accuracy of the restoration results. However, I am required to assess only the regions that have been inpainted. Please, how can this be achieved? This is the
allPSNR = zeros(1, numImages);
allSSIM = zeros(1, numImages);
for k = 1 : numImages
baseFileName = theFiles(k).name;
fullFileName = fullfile(theFiles(k).folder, baseFileName);
baseFileName1 = theFiles1(k).name;
fullFileName1 = fullfile(theFiles1(k).folder, baseFileName1);
lab = imread(fullFileName);
img = imread(fullFileName1);
allPSNR(k) = psnr(img, lab);
allSSIM(k) = ssim(img, lab);
end
meanPSNR = mean(allPSNR);
meanSSIM = mean(allSSIM);
code that I have written for calculating the evaluation metrics for the entire image. Please, how can I modify the code in such a way that only the restored regions will be considered, given that I have the masks that were used during restoration. Any comments/suggestions would be highly appreciated.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by