图像插值就是利用已知邻近像素点的灰度值(或rgb图像中的三色值)来产生未知像素点的灰度值,以便由原始图像再生出具有更高分辨率的图像。
通过例子来理解interp2函数:
- 1
- 2
- 3
- 4
- 5
- 6
- 1
- 2
- 3
- 4
- 5
- 6
进行插值
- 1
- 2
- 3
- 4
- 5
- 6
- 1
- 2
- 3
- 4
- 5
- 6
使用格式:
Vq = interp2(X,Y,V,Xq,Yq)
Vq = interp2(V,Xq,Yq)
Vq = interp2(V)
Vq = interp2(V,k)
Vq = interp2(_,method)
Vq = interp2(_,method,extrapval)
输入:
-
X,Y — Sample grid points
matrices | vectors -
V — Sample values
matrix - Xq,Yq — Query points
scalars | vectors | matrices | arrays - k — Refinement factor
1 (default) | real, nonnegative, integer scalar - method — Interpolation method
‘linear’ (default) | ‘nearest’ | ‘cubic’ | ‘spline’ - extrapval — Function value outside domain of X and Y
scalar
输出:
- Vq — Interpolated values
scalar | vector | matrix