필터 지우기
필터 지우기

How to calcualte psnr of images of two different size?

조회 수: 4 (최근 30일)
anu
anu 2017년 4월 3일
댓글: Ozan Can Sahin 2020년 10월 26일
I am having one image 0f 500 * 500 size. I have resized it to 250 * 250. How to calculate psnr between two images?

답변 (1개)

Image Analyst
Image Analyst 2017년 4월 3일
Call
p = psnr(image1, image2);
If they're different sizes, then resize one of them.
image2Resized = imresize(image2, size(image1), 'nearest');
p = psnr(image1, image2Resized );
  댓글 수: 7
Image Analyst
Image Analyst 2020년 10월 25일
Each method will give a slightly different PSNR. Bicubic should be fine. Use others and compare them if you want.
Ozan Can Sahin
Ozan Can Sahin 2020년 10월 26일
I tried both PSNR and SSIM, it worked without errors but I've seen something that doesn't make sense. I've tried comparing Bicubic Interpolation and Nearest Neighbour Interpolation to see if PSNR and SSIM works properly, however I got better results for NN compared to bicubic which doesn't make sense. And this is valid for not only one single image but I've tried it with a few different images. You can see those in the screenshot attached, the code is on the left and the values are on the right. Any ideas why am I getting such results like this?

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by