资源简介
能直接运行,适合初学者,输入一张低分辨率图片,输出高分辨率图片。
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% POCS Image Reconstruction
% -------------------------
% AUTHOR: Stephen Rose Maher Khoury
% DATE: March 1 1999
% PURPOSE: Generates SR frame using the POCS method
% Notes:
% -init.m contains the affine transformation parameters
% -Assuming a gaussian PSF
% -uv are affine transformation vectors for (xy)
% -mcXmcY are transformed coordines in SR frame
%
% Variables:
% -ref = LR reference frame
% -upref = HR reference frame
% -NumberOfframes = Number of pixel frames to consider
% -frame = LR frame currently being examined
% -weights = weights based on Gaussian PSF
%%% Initialization
%init;
NumberOfframes = 5;
k = zeros(14);
%%% Create the high-resolution reference frame 对应算法:(1)选择一个参考帧k
ref = imread(‘C:\Users\John\Desktop\22.jpg‘);
[m1n1]=size(ref)
figure;
imshow(ref);
colormap(gray);
drawnow;%刷新屏幕,有延时作用。
ref =double(ref);%(1:size(ref1)行./21:size(ref2)./2)列);
%%%Interpolate values at inbetween points 对应算法(2)将低分辨图像插值到高分辨网格上
[x y] = meshgrid(1:size(ref2) 1:size(ref1));
[X Y] = meshgrid(1:2.*size(ref2) 1:2.*size(ref1));
upref = interp2(xydouble(ref)X./2Y./2‘linear‘);
%zi = interp2(xyzxiyi ‘method‘)对二维网格(X,Y)上的数据Z进行插值
%对一组点(xyz)?按method指定的插值算法进行二维插值,并计算插值点(xiyi)的函数值zi。
%其中(xyz)?是已给的数据点,(xiyi)是插值点坐标
upref(isnan(upref)) = 0;
figure;
ShowIm(upref);
[m2n2]=size(upref)
colormap(gray);
drawnow;
%%% Iterate the entire process
for iter=1:10
disp(iter);
%%% Iterate over the frames
for num = 2:NumberOfframes
%%% Read in the frame
if (num < 10);
frame = pgmread(strcat(‘E:\SR\POCS\POCS\taxi\taxi0‘num2str(num)‘.pgm‘)); %把数值转换成字符串
else
frame = pgmread(strcat(‘E:\SR\POCS\POCS\taxi\taxi0‘num2str(num)‘.pgm‘));
end
frame = double(frame);%(1:size(frame1)./21:size(frame2)./2));
%%%Calculate the affine motion parameters for this frame
k = affine(frameref); % Calculates affine motion parameters 基于光流法的图像配准?
- 上一篇:随机信号的DOA估计方法
- 下一篇:直线插补PLC程序可运行
评论
共有 条评论