我正在尝试在以下论文中实现一个简单的图像超分辨率算法(基于 DWT 的分辨率增强)
http://www.ripublication.com/aeee/52_pp%20%20%20405-412.pdf
我尝试使用 Matlab 实现本文图 3 中的算法。代码如下。
img1 = imread('lena1.jpg'); %original High resolution image
[height, width, dim] = size(img1);
%%Downsampling the image by averaging
avgfilter = fspecial('average', [2 2]);
avgimg = filter2(avgfilter, img1);
img = avgimg(1:2:end,1:2:end); %Input low resolution image
[LL,LH,HL,HH] = dwt2(img,'haar'); %Decomposing
%Bicubic interpolation by factor 2 on each subbands
LL1 = imresize(LL,2,'bicubic');
LH1 = imresize(LH,2,'bicubic');
HL1 = imresize(HL,2,'bicubic');
HH1 = imresize(HH,2,'bicubic');
%% Calculating Difference image
for i=1:256
for j=1:256
img3(i,j,:) = img(i,j,:) - LL1(i,j,:);
end
end
for i=1:256
for j=1:256
LH13(i,j,:) = img3(i,j,:) + LH1(i,j,:);
HL13(i,j,:) = img3(i,j,:) + HL1(i,j,:);
HH13(i,j,:) = img3(i,j,:) + HH1(i,j,:);
end
end
%bicubic interpolation(Here alpha = 2;Hence alpha/2 = 1)
img31 = imresize(img3,1,'bicubic');
LH131 = imresize(LH13,1,'bicubic');
HL131 = imresize(HL13,1,'bicubic');
HH131 = imresize(HH13,1,'bicubic');
img4 = idwt2(img31,LH131,HL131,HH131,'haar'); %IDWT
t = uint8(img4)
imshow(t);
imsave;
但是我得到了一个完全出乎意料的输出图像。为什么会这样。请帮助。提前致谢。
输入图像:

输出图像:


