资源简介
实现对整个LIVE数据库共982张图片的处理,ssim_index.m文件在论坛上很好找,就不上传了。
代码片段和文件信息
%图片1~227的处理,即jp2k文件夹
fid = fopen(‘D:\database\LIVE\jp2k\info.txt‘);
FC = textscan(fid‘%s%s%f‘);
fclose(fid);
src_image = FC{1};
dst_image = FC{2};
for k=1:227
src_name = [‘D:\database\LIVE\refimgs\‘ src_image{k}];
dst_name = [‘D:\database\LIVE\jp2k\‘ dst_image{k}];
img1=imread(src_name);
img2=imread(dst_name);
img1=rgb2gray(img1);
img2=rgb2gray(img2);
img1=double(img1);
img2=double(img2);
[mssim ssim_map] = ssim_index(img1 img2);
ssim_results(k)=mssim;
end
%图片228~460的处理,即jpeg文件夹
fid = fopen(‘D:\database\LIVE\jpeg\info.txt‘);
FC = textscan(fid‘%s%s%f‘);
fclose(fid);
src_image = FC{1};
dst_image = FC{2};
for k=228:460
N=k-227;
src_name = [‘D:\database\LIVE\refimgs\‘ src_image{N}];
dst_name = [‘D:\database\LIVE\jpeg\‘ dst_image{N}];
img1=imread(src_name);
img2=imread(dst_name);
img1=rgb2gray(img1);
img2=rgb2gray(img2);
img1=double(img1);
img2=double(img2);
[mssim ssim_map] = ssim_index(img1 img2);
ssim_results(k)=mssim;
end
%图片461~634的处理,即wn文件夹
fid = fopen(‘D:\database\LIVE\wn\info2.txt‘);
FC = textscan(fid‘%s%s%f‘);
fclose(fid);
src_image = FC{1};
dst_image = FC{2};
for k=461:634
N=k-460;
src_name = [‘D:\database\LIVE\refimgs\‘ src_image{N}];
dst_name = [‘D:\database\LIVE\wn\‘ dst_image{N}
- 上一篇:s7-200 eeprom 写入库
- 下一篇:SAR方位向成像matlab代码及注释
评论
共有 条评论