Please enable Javascript to view the contents

·  ☕ 3 分钟

## 1. 算法原理

### 1.1. 基本原理

• 输入：$n$对控制点对$(\pmb p_i,\pmb q_i)$，$i=1,2,\cdots,n$，其中$\pmb p_i\in\mathbb R^2$为控制起始点，$\pmb q_i\in\mathbb{R}^2$为控制目标点
• 目标：找到一个映射$f:\mathbb R^2\rightarrow \mathbb{R}^2$，满足$f(\pmb p_i)=\pmb q_i$，$i=1,2,\cdots,n$

### 1.2. Inverse distance-weighted interpolation methods(IDW)[1]

IDW 算法基本原理是根据给定的控制点对和控制点对的位移矢量，计算控制点对周围像素的反距离加权权重影响，实现图像每一个像素点的位移。

$$f(\pmb p)=\sum_{i=1}^n\omega_i(\pmb p)f_i(\pmb p)$$

$$w_i(\pmb p)=\frac{\sigma_i(\pmb p)}{\sum_{j=1}^n\sigma_j(\pmb p)}$$
$\sigma_i(\pmb p)$反映第$i$对控制点对像素$\pmb p$得反距离加权权重影响程度，可以直接取：
$$\sigma_i(\pmb p)=\frac{1}{|\pmb p-\pmb p_i|^\mu}$$

$$\sigma_i(\pmb p)=\left[\frac{R_i-d(\pmb p,\pmb p_i)}{R_id(\pmb p,\pmb p_i)}\right]^\mu$$
$f_i$为线性函数，满足：
$$f_i(\pmb p)=\pmb q_i+\pmb T_i(\pmb p-\pmb p_i)$$

$$\pmb T_i=\begin{bmatrix} t_{11}^{(i)}&t_{12}^{(i)}\\ t_{21}^{(i)}&t_{22}^{(i)} \end{bmatrix}$$

$$\arg\min_{\pmb T_i} E(\pmb T_i)=\sum_{j=1,j\neq i}^n\sigma_i(\pmb p_j)|\pmb q_j-f_i(\pmb p_j)|^2$$

$$\pmb T_i\sum_{j=1,j\neq i}\sigma_i(\pmb p_j)\pmb p\pmb p^T=\sum_{j=1,j\neq i}\sigma_i(\pmb p_j)\pmb q\pmb p^T$$

$$\pmb T_i=\left(\sum_{j=1,j\neq i}\sigma_i(\pmb p_j)\pmb q\pmb p^T\right)\left(\sum_{j=1,j\neq i}\sigma_i(\pmb p_j)\pmb p\pmb p^T\right)^{-1}$$

### 1.3. Radial basis functions interpolation method(RBF)[2]

$$f(\pmb p)=\sum_{i=1}^n\alpha_ig_i(|\pmb p-\pmb p_i|)+\pmb{Ap}+\pmb B$$

\begin{aligned} g_i(d)&=(d+r_i)^{\pm\frac{1}{2}}\ r_i&=\min_{j\neq i}d(\pmb p_i,\pmb p_j) \end{aligned}

## 2. 实验结果

### 2.2. IDW算法

$\mu$取值 修复前 修复后
$\mu=-1$
$\mu=-2$

### 2.3. RBF算法

$\mu$取值 修复前 修复后
$\mu=-0.5$
$\mu=0.5$

Emmm……：

## 参考文献

[1] D. Ruprecht and H. Muller. Image warping with scattered data interpolation. IEEE Computer Graphics and Applications, 15(2):37–43, 1995. 10

[2] N. Arad and D. Reisfeld. Image warping using few anchor points and radial functions. In Computer graphics forum, volume 14, pages 35–46. Wiley Online Library, 1995.

Wenbo Chen
CG Student