C:\Users\yy\Desktop\image1与C:\Users\yy\Desktop\image2与C:\Users\yy\Desktop\image3
时间: 2023-06-29 13:14:31 浏览: 112
桌面图片
好的,下面是实现对比三个jpg格式图片的PSNR,SSIM,NIQE的matlab代码。
```
% 导入三张图片
img1 = imread('C:\Users\yy\Desktop\image1.jpg');
img2 = imread('C:\Users\yy\Desktop\image2.jpg');
img3 = imread('C:\Users\yy\Desktop\image3.jpg');
% 计算三张图片的PSNR
psnr1 = psnr(img1, img2);
psnr2 = psnr(img1, img3);
psnr3 = psnr(img2, img3);
% 计算三张图片的SSIM
ssim1 = ssim(img1, img2);
ssim2 = ssim(img1, img3);
ssim3 = ssim(img2, img3);
% 计算三张图片的NIQE
niqe1 = niqe(img1);
niqe2 = niqe(img2);
niqe3 = niqe(img3);
% 输出结果
fprintf('PSNR of image1 and image2: %.2f\n', psnr1);
fprintf('PSNR of image1 and image3: %.2f\n', psnr2);
fprintf('PSNR of image2 and image3: %.2f\n', psnr3);
fprintf('SSIM of image1 and image2: %.2f\n', ssim1);
fprintf('SSIM of image1 and image3: %.2f\n', ssim2);
fprintf('SSIM of image2 and image3: %.2f\n', ssim3);
fprintf('NIQE of image1: %.2f\n', niqe1);
fprintf('NIQE of image2: %.2f\n', niqe2);
fprintf('NIQE of image3: %.2f\n', niqe3);
```
请将以上代码保存为.m文件并在matlab中运行。程序会输出三张图片的PSNR,SSIM和NIQE值,具体值取决于您的图片内容。
阅读全文