当前位置:文档之家› 第六章图像插值

第六章图像插值

a 1-a
f(n+a)=(1-a)f(n)+af(n+1), 0<a<1
Note: when a=0.5, we simply have the average of two
x x0 x x1 L( x ) y0 y1 x0 x1 x1 x0
Numerical Examples
1D Zero-order (Replication)
f(n)
n
f(x) x
1D First-order Interpolation (Linear)
f(n)
n
f(x) x
Linear Interpolation Formula
Heuristic: the closer to a pixel, the higher weight is assigned Principle: line fitting to polynomial fitting (analytical formula) f(n) f(n+a) f(n+1)
Scenario I: Resolution Enhancement
Low-Res.
High-Res
High Resolution Imaging Science Experiment
High Resolution Imaging Science Experiment
/mro/mission/instruments/hirise/
%%%%%%%%%%%%%%%%%%%%%%%%%%% % How to implement image interpolation by yourself? % %%%%%%%%%%%%%%%%%%%%%%%%%%%% % zero-order interpolation (replication) [M,N]=size(x); z0=zeros(2*M,2*N); z0(1:2:2*M,1:2:2*N)=x; h=[1 1;1 1]; z0=filter2(h,z0); % display interpolated image figure,imshow(z0,[]);
% zero-order interpolation (replication) y0=interp2(x,'nearest');
% display interpolated image figure,imshow(y0,[]);
% first-order interpolation (bilinear interpolation) y1=interp2(x,'linear'); % display interpolated image figure,imshow(y1,[]); % check bilinear property x(1:2,1:2) y1(1:5,1:5) % bicubic interpolation y2=interp2(x,'cubic'); % display interpolated image figure,imshow(y2,[]);
% read the PGM image into MATLAB x=imread('fl_orig.pgm'); % display the image imshow(x); % convert image to double format x=double(x); whos x
% read the instruction of interp2 help interp2 (or imresize)
Pixel Replication
low-resolution image (100×100) high-resolution image (400×400)
Bilinear Interpolmage (100×100)
high-resolution image (400×400)
Scenario II: Image Inpainting
Non-damaged
Damaged
Image warping is the process of digitally manipulating an image such that any shapes portrayed in the image have been significantly distorted. Warping may be used for correcting image distortion as well as for creative purposes (e.g., morphing[1]).
f(n)=[0,120,180,120,0]
Interpolate at 1/2-pixel
f(x)=[0,60,120,150,180,150,120,60,0], x=n/2
Interpolate at 1/3-pixel
f(x)=[0,20,40,60,80,100,120,130,140,150,160,170,180,…], x=n/6
Graphical Interpretation of Interpolation at Half-pel
row
column
f(m,n)
g(m,n)
最近邻插值
Numerical Examples
a
zero-order a a a a c c c c b b d d b b d d
b
c
d first-order a (a+b)/2 (a+c)/2 (a+b+c+d)/4 c (c+d)/2 b (b+d)/2 d
真实值: 10.7238
Introduction
• What is image interpolation?
– An image f(x,y) tells us the intensity values at the integral lattice locations, i.e., when x and y are both integers – Image interpolation refers to the guess of intensity values at missing locations, i.e., x and y can be arbitrary – Note that it is just a guess (Note that all sensors have finite sampling distance)
– We want GOOD images
• If some block of an image gets damaged during the transmission, we want to repair it
– We want COOL images
• Manipulate images digitally can render fancy artistic effects as we often see in movies
已知函数表求满足:
L(x0)=y0, L(x1)=y1 的线性函数 L(x)
过两点直线方程
x f (x )
x0 y0
x1 y1
y1 y0 L( x ) y0 ( x x0 ) x1 x0
引子 求 115 的近似值(函数值: 10.7238)
11 10 115 10 (115 100) 10.7143 121 100
1D Third-order Interpolation (Cubic)*
f(n) n
f(x) x
1D Third-order Interpolation (Cubic)*
http://www.paulinternet.nl/?page=bicubic
压缩的概念:
观测的离散数据可以想象成现实中无穷多 信息的代表。通过给定数据求出插值函数意味 着用简单的规则代替无穷多信息。尽管期待这 种简单规则精确地反映实际情况是不现实的, 但是它可以充分接近实际。这一类压缩是有损 的压缩, 即它会产生误差。
From 1D to 2D
Engineers’ wisdom: divide and conquer 2D interpolation can be decomposed into two sequential 1D interpolations. The ordering does not matter (row-column = column-row) Such separable implementation is not optimal but enjoys low computational complexity “If you don’t know how to solve a problem, there must be a related but easier problem you know how to solve. See if you can reduce the problem to the easier one.” - rephrased from G. Polya’s “How to Solve It”
% check replication property x(1:4,1:4) z0(1:9,1:9)
% first-order interpolation (bilinear interpolation) [M,N]=size(x); z1=zeros(2*M,2*N); z1(1:2:2*M,1:2:2*N)=x; h=[1 2 1;2 4 2;1 2 1]/4; z1=filter2(h,z1); % display interpolated image figure,imshow(z1,[]);
相关主题