资源简介
迭代反投影法实现程序,可以用于超分辨率复原。

代码片段和文件信息
function [I frames] = iteratedbackprojection(s delta_est)
% ITERATEDBACKPROJECTION - iterated back projection SR algorithm
% s: images in cell array (s{1} s{2}...)
% factor: gives size of reconstructed image
if nargout > 1
outputframes = true;
else
outputframes = false;
end
%% Initialization
lambda = 0.1; % define the step size for the iterative gradient method
dI1=imread(‘E:\matlab\IBP2\ref.jpg‘);
srcDir=uigetdir(‘E:\matlab\IBP2\ibp11‘); %获得选择的文件夹
cd(srcDir);
allnames=struct2cell(dir(‘*.jpg‘)); %只处理jpg文件
[klen]=size(allnames); %获得jpg文件的个数
for ii=1:len
name=allnames{1ii};
s{ii}=imread(name); %读取文件
end
%% Movie variables
movieCounter = 1;
imOrigBig = imresize(dI1 2 ‘nearest‘);
if(outputframes)
figure;
end
% -- End of Movie Variables
% Start with an estimate of our HR image: we use an upsampled version of
% the first LR image as an initial estimate.
X = imOrigBig;
X_prev = X;
%imshow(X);
%PSF = generatePSF([1 0 0] [1 2 1] X);
blur = [0 1 0;...
1 2 1;...
0 1 0];
blur = blur / sum(blur(:));
sharpen = [0 -0.25 0;...
-0.25 2 -0.25;...
0 -0.25 0];
%% Main loop
% --- Save each movie frame ---
if(outputframes)
imshow(X);
frames(movieCounter) = getframe;
movieCounter = movieCounter + 1;
end
% -----------------------------
G = uint8(zeros(size(X)));
for ii=2:5 %delta_est矩阵中取2到5行
temp = circshift(X -[round(2 * delta_est(ii1)) round(2 * delta_est(ii2))]); %参考帧偏移
%temp = PSF * temp;
temp = imfilter(temp blur ‘symmetric‘);
temp = temp(1:2:end 1:2:end); %降采样
temp = temp - s{ii}; %图像相减
%temp = PSF‘ * temp;
temp = imfilter(temp sharpen ‘symmetric‘);
temp = imresize(temp 2 ‘nearest‘); %插值
P = circshift(temp [round(2 * delta_est(ii1)) round(2 * delta_est(ii2))]);
% disp(class(P));
% disp(class(G));
%disp(size(P));
%disp(size(G));
% G = plus(PG);
% G = G+P;
G = G + circshift(temp [round(2 * delta_est(ii1)) round(2 * delta_est(ii2))]);
end
% Now that we have the gradient we will go in its direction with a step
% size of lambda
X = X + (lambda) * G;
%figure;
%imshow(X);
I = X;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3030 2013-12-09 14:36 iteratedbackprojection.m
- 上一篇:仿VS编辑界面,控件拖拽,属性框
- 下一篇:导线平差计算EXCEL
相关资源
- iftop-0.17
- 光学模拟软件OptiwaveOptiBPMv9.0.rar
- 集成供应链计划IBP
- zlib源码+libpng源码,可运行工程
- libpng-1.6.29.tar.gz
- libpng源代码
- libpcap qt
- 这是libpcap的使用程序和文档
- libPLS文件包
- [rar文件] libharu2.3.0 (含libhpdf.liblibp
- actiBPM插件
- PNG图片转换工具,针对QT开发中png图片
- libpng-1.6.12.tar.gz
- libpsd v1.0
- zlib和libpng源码
- tcpdump(tcpdump-4.9.2.tar.gz & libpcap-1.8.1
- 最新的 libprotobuf.lib、libprotoc.lib和pr
- png++库安装指南和代码
- tcpdump 源代码
- libpng 使用vs调用的原始包
- libpcap 详解源代码
- libpng+zlib 有源代码和已经编译好的d
- OptiBPM教程
- libpng的库文件,lib文件,dll文件
- libpcap编程-编写自己的网络嗅探程序
- libpng.lib,zlib.lib,libpng16.dll
- libpng-1.0.10rc1.tar.tar
- libpcap-1.9.0
- 几种堆(BinFibPair)在Dijkstra算法上的
- 三缓冲区 多线程处理抓包
评论
共有 条评论