图像超分辨重建MATLAB源代码

1 算法介绍

传统的超分辨重建算法往往采用梯度下降法进行求解,迭代时步长往往通过经验确定。而且不同的图像的最优步长往往不相同。步长过大会导致发散,步长过小会导致收敛缓慢。本算法基于对正则化超分辨重建算法实现的基础上,对步长的选取进行了优化,推导出了每次迭代时的最优步长大小,并将其自适应化,改进了超分辨算法的收敛性,从而能够在更短的时间内取得更加精确的重建结果。相关具体内容请参考对应的论文:Yingqian Wang, Jungang Yang, Chao Xiao, and Wei An, "Fast convergence strategy for multi-image superresolution via adaptive line search," IEEE Access, vol. 6, no. 1, pp. 9129-9139.

2 部分代码


 
%% BIBTEX TO CITE:
% @article{wang2018fast,
%   title={Fast Convergence Strategy for Multi-Image Superresolution via Adaptive Line Search},
%   author={Wang, Yingqian and Yang, Jungang and Xiao, Chao and An, Wei},
%   journal={IEEE Access},
%   volume={6},
%   pages={9129--9139},
%   year={2018},
%   publisher={IEEE}
% }

%% %%%%%%%%Copyright (c) 2018, All rights reserved.%%%%%%%%%%%%%%%%%%%%%%

clear all
clc

filename = 'Set';
files = dir(fullfile( filename,'*.bmp'));
file_num = 2;       % different number corresponds to defferent test images in 'Set'
reg_term = 1;       %regularization term: 1-BTV, 2-Tikhonov

Image =imread([filename,'\',files(file_num).name]);
SZ = size(size(Image));

if (SZ(2)==2)       % turn grayscale image to RGB image
    for qw = 1:3
        IMAGE (:,:,qw) = Image;
    end
else
    IMAGE = Image;
end

%% Image Degradation
D = [1,1;-2,1;-1,-3;3,-2];                    % Shearing shift
Gau = fspecial( 'gaussian', [3 3], 1);   % Gaussian bluring kernel
spf = 2;                                              % sampling factor
sigma2 = 1;                                       % variation of noise
LR = ImDegrate(IMAGE,D,Gau,spf,sigma2); % image degradation function

%% Turn RGB to YCbCr, and only SR the Y component
[~, ~, ~, M] = size(LR);
for w = 1:M
    LR(:,:,:,w) = rgb2ycbcr(uint8( squeeze(LR(:,:,:,w))));
end

maxiter = 10;  % maximum number of iteration

y1(:,:,:) =  LR(:,:,1,:);
y2(:,:,:) =  LR(:,:,2,:);
y3(:,:,:) =  LR(:,:,3,:);

HRitp1 =  imresize(y1(:,:,1), spf, 'bicubic');  % bicubic interpolation
HRitp1 = ImWarp(HRitp1, -D(1,1), -D(1,2));  % shift recovering

I1 = Wang_SR(HRitp1, y1, D, Gau, spf, maxiter, reg_term);   %Our proposed SR method

HRitp2 =  imresize(y2(:,:,1), spf, 'bicubic');
HRitp2 = ImWarp(HRitp2, -D(1,1), -D(1,2));
I2 = HRitp2;

HRitp3 =  imresize(y3(:,:,1), spf, 'bicubic');
HRitp3 = ImWarp(HRitp3, -D(1,1), -D(1,2));
I3 = HRitp3;

ImZ(:, :, 1) =  I1;
ImZ(:, :, 2) =  I2;
ImZ(:, :, 3) =  I3;

ImZ = ycbcr2rgb(uint8( ImZ)); % Turn YCbCr to RGB

figure; imshow( uint8( ImZ ) ); title('Wang et al.');
figure; imshow( uint8( IMAGE ) ); title('groundtruth');

%%  Evaluation

If = double(ImZ);   %output image
Is = double(IMAGE); %reference image
[row,col,~]=size(If); 

%RMSE
rmse=0;
for color = 1:3
    Ifc = If(:,:,color);  Isc = Is(:,:,color);
    SSE=sum(sum((Ifc-Isc).^2));
    rmsec=sqrt(SSE/(row*col));
    rmse = rmse+rmsec/3;
end
rmse

%PSNR
psnr=0;
for color = 1:3
    Ifc = If(:,:,color);  Isc = Is(:,:,color);
    maxIs = max(max(Isc));
    minIs = min(min(Isc));
    PSNRc = 10*log10((row*col*(maxIs-minIs)^2)/sum(sum((Ifc-Isc).^2)));
    psnr = psnr+PSNRc/3;
end
psnr

%SSIM
ssim=0;
for color = 1:3
    Ifc = uint8(If(:,:,color));  Isc = uint8(Is(:,:,color));
    ssimc = cal_ssim(Ifc, Isc, 0, 0);
    ssim = ssim + ssimc/3;
end
ssim


3 仿真结果

 

 

4 参考文献

[1] Wang Y ,  Yang J ,  Xiao C , et al. Fast Convergence Strategy for Multi-image Superresolution via Adaptive Line Search[J]. IEEE Access, 2018:1-1.

5 代码下载

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Matlab科研辅导帮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值