compute the PSNR and SSIM of only the restored regions of the image
7 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!