资源简介

该程序是一个matlab GUI程序,打开.m文件可以运行GUI后,按照GUI界面降低分辨率,添加库便可以识别,方便大家学习,交流

资源截图

代码片段和文件信息

function [s ground_truth] = create_images(imdeltaphiscalenrsnr)
% CREATE_IMAGES - 通过位移和旋转生成低分辨率图像
%    [s ground_truth] = create_images(imdeltaphiscalenrsnr)
%    生成低分辨率图像NR,从高分辨率图像IM
%    位移DELTA (1/8的倍数) and 旋转角度PHI (degrees)
%    the low resolution images have a factor SCALE less pixels
%    in both dimensions than the input image IM
%    如果SNR是确定的 根据SNR添加给图像不同的噪声

%y = resample(x p q)
%采用多相滤波器对时间序列进行重采样,
%得到的序列y的长度为原来的序列x的长度的p/q倍,p和q都为正整数。
%此时,默认地采用使用FIR方法设计的抗混叠的低通滤波器
im=resample(im21)‘; % upsample the image by 2
im=resample(im21)‘;
for i=2:nr
    %delta中的元素为0到1,delta(i2)*2*scale为0到8
    im2{i} = shift(im-delta(i2)*2*scale-delta(i1)*2*scale); % shift the images by integer pixels
    if (phi(i) ~= 0)
        %B = imrotate(Aanglemethodbbox)
        %method设定插值算法,有三种:最邻近线性插值nearest,双线性插值bilinear,双三次插值bicubic
        %bbox参数用于指定输出图像属性:
        %crop: 通过对旋转后的图像B进行裁剪, 保持旋转后输出图像B的尺寸和输入图像A的尺寸一样
        %loose: 使输出图像足够大, 以保证源图像旋转后超出图像尺寸范围的像素值没有丢失。 一般上这种格式产生的图像的尺寸都要大于源图像的尺寸。
        %将图像A(图像的数据矩阵)绕图像的中心点旋转angle度, 正数表示逆时针旋转, 负数表示顺时针旋转。
        %返回旋转后的图像矩阵。 
        %以这种格式调用该函数, 该函数默认采用最近邻线性插值(Nearest-neighbor interpolation)。
        %旋转后的图像超出的部分填充0(黑色)。
      im2{i} = imrotate(im2{i}phi(i)‘bicubic‘‘crop‘); 
    end
end
im2{1} = im; % 第一幅图象没有被旋转

for i=1:nr
    im2{i} = lowpass(im2{i}[0.12 0.12]); % 低通滤波
                                            % such that they satisfy the conditions specified in the paper
                                            % a small aliasing-free part of the frequency domain is needed
    if (i==1) % construct ground truth image as reconstruction target
     ground_truth=downsample(im2{i}4)‘;
     ground_truth=downsample(ground_truth4)‘;
    end
    %降低采样率. 
    %将信号低通以后根据内插函数将采样率降低 
    %作用就是减少数据率便于处理 
    im2{i} = downsample(im2{i}2*scale)‘; % downsample the images by 8
    im2{i} = downsample(im2{i}2*scale)‘;
end

% add noise to the images (if an SNR was specified)
if (nargin==6)
  for i=1:nr
    S = size(im2{i});
    n = randn(S(1)S(2));
    n = sqrt(sum(sum(im2{i}.*im2{i}))/sum(sum(n.*n)))*10^(-snr/20)*n;
    s{i} = im2{i}+n;
    %snr = 10*log10(sum(sum(im2{i}.*im2{i}))/sum(sum(n.*n)))
  end
else
  s=im2;
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-12 14:54  人脸超分辨\
     文件       11670  2017-01-03 18:20  人脸超分辨\10.jpg
     文件       12602  2018-06-28 15:52  人脸超分辨\10_LR_1.tif
     文件         988  2018-06-28 16:01  人脸超分辨\10_LR_1_LR_1.tif
     文件         988  2018-06-28 16:01  人脸超分辨\10_LR_1_LR_2.tif
     文件         986  2018-06-28 16:01  人脸超分辨\10_LR_1_LR_3.tif
     文件         988  2018-06-28 16:01  人脸超分辨\10_LR_1_LR_4.tif
     文件       12590  2018-06-28 15:52  人脸超分辨\10_LR_2.tif
     文件       12584  2018-06-28 15:52  人脸超分辨\10_LR_3.tif
     文件       12580  2018-06-28 15:52  人脸超分辨\10_LR_4.tif
     文件       63620  2018-06-28 16:38  人脸超分辨\CINAMES.mat
     文件       63620  2018-06-28 16:38  人脸超分辨\CIPATH.mat
     文件        2641  2017-01-05 09:47  人脸超分辨\create_images.m
     文件      171690  2018-06-28 16:32  人脸超分辨\dehaze - 副本_LR_1.tif
     文件       11140  2018-06-28 16:35  人脸超分辨\dehaze - 副本_LR_1_LR_1.tif
     文件         940  2018-06-28 16:38  人脸超分辨\dehaze - 副本_LR_1_LR_1_LR_1.tif
     文件         940  2018-06-28 16:38  人脸超分辨\dehaze - 副本_LR_1_LR_1_LR_2.tif
     文件         940  2018-06-28 16:38  人脸超分辨\dehaze - 副本_LR_1_LR_1_LR_3.tif
     文件         940  2018-06-28 16:38  人脸超分辨\dehaze - 副本_LR_1_LR_1_LR_4.tif
     文件       11140  2018-06-28 16:35  人脸超分辨\dehaze - 副本_LR_1_LR_2.tif
     文件       11138  2018-06-28 16:35  人脸超分辨\dehaze - 副本_LR_1_LR_3.tif
     文件       11138  2018-06-28 16:35  人脸超分辨\dehaze - 副本_LR_1_LR_4.tif
     文件      171418  2018-06-28 16:32  人脸超分辨\dehaze - 副本_LR_2.tif
     文件      171676  2018-06-28 16:32  人脸超分辨\dehaze - 副本_LR_3.tif
     文件      171370  2018-06-28 16:32  人脸超分辨\dehaze - 副本_LR_4.tif
     文件         852  2017-01-03 15:59  人脸超分辨\fuyuan.m
     文件         308  2017-01-01 12:59  人脸超分辨\gauss_pyramid.m
     文件       13757  2017-01-05 10:31  人脸超分辨\generation.fig
     文件       10233  2016-12-31 16:12  人脸超分辨\generation.m
     目录           0  2018-07-02 15:44  人脸超分辨\gs图库\
     文件     3259602  2018-06-28 20:26  人脸超分辨\gs图库\中光1.JPG
............此处省略43个文件信息

评论

共有 条评论