天天看點

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

1 簡介

數字時代早已來臨,圖像作為其中主要的資訊傳播媒介,已經廣泛應用于各種場景。在衆多領域中,人們對于圖像的畫質有較高的需求,比如醫療圖像領域、衛星遙感領域等。是以對于高速發展的資訊時代來說,低分辨率的圖像已然很難滿足特定場景的需求。超分辨率圖像重建技術是通過一些算法将一張或者多張低分辨率圖像重建出一張高分辨率圖像。已經提出的基于卷積神經網絡的圖像超分辨率算法雖然解決了傳統圖像超分辨率重建算法存在魯棒性不強、計算複雜等問題,但還是存在參數較多、重建後圖像不清晰等現象,而且對于細節比較豐富的圖像存在重建能力差,視覺效果差的問題。為解決以上問題,本文深入研究深度學習中的卷積神經網絡在圖像超分辨率領域的應用效果。

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼
【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼
【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼
【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼
【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼
【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

2 部分代碼

% =========================================================================
% Test code for Super-Resolution Convolutional Neural Networks (SRCNN)
% =========================================================================
close all;
clear all;
%% read ground truth image
im  = imread('Set5\butterfly_GT.bmp');
%im  = imread('Set14\zebra.bmp');
%% set parameters
up_scale = 3;
model = 'model\9-5-5(ImageNet)\x3.mat';
% up_scale = 3;
% model = 'model\9-3-5(ImageNet)\x3.mat';
% up_scale = 3;
% model = 'model\9-1-5(91 images)\x3.mat';
% up_scale = 2;
% model = 'model\9-5-5(ImageNet)\x2.mat'; 
% up_scale = 4;
% model = 'model\9-5-5(ImageNet)\x4.mat';
%% work on illuminance only
if size(im,3)>1
    im = rgb2ycbcr(im);
    im = im(:, :, 1);
end
im_gnd = modcrop(im, up_scale);
im_gnd = single(im_gnd)/255;
%% bicubic interpolation
im_l = imresize(im_gnd, 1/up_scale, 'bicubic');
im_b = imresize(im_l, up_scale, 'bicubic');
%% SRCNN
im_h = SRCNN(model, im_b);
%% remove border
im_h = shave(uint8(im_h * 255), [up_scale, up_scale]);
im_gnd = shave(uint8(im_gnd * 255), [up_scale, up_scale]);
im_b = shave(uint8(im_b * 255), [up_scale, up_scale]);
%% compute PSNR
psnr_bic = compute_psnr(im_gnd,im_b);
psnr_srcnn = compute_psnr(im_gnd,im_h);
%% show results
fprintf('PSNR for Bicubic Interpolation: %f dB\n', psnr_bic);
fprintf('PSNR for SRCNN Reconstruction: %f dB\n', psnr_srcnn);
figure, imshow(im_b); title('雙三次插值');
figure, imshow(im_h); title('SRCNN重建');
%imwrite(im_b, ['Bicubic Interpolation' '.bmp']);
%imwrite(im_h, ['SRCNN Reconstruction' '.bmp']);      

3 仿真結果

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼
【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

【圖像增強】基于深度學習的超分辨率圖像增強含Matlab源碼

4 參考文獻

[1]王慧雲. 基于深度學習的圖像超分辨率重建[D]. 電子科技大學, 2020.

[2]黃思炜. 基于深度學習的超分辨率圖像重建算法研究[D]. 太原理工大學.

部落客簡介:擅長智能優化算法、神經網絡預測、信号處理、元胞自動機、圖像處理、路徑規劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。

繼續閱讀