1 泊松图像编辑(Poisson Image Editing )
泊松图像编辑(Poisson Image Editing)的核心观点是图像融合时,用色彩梯度代替色彩强度可以产生更真实的效果。
经无缝融合(seamless cloning)后,融合图像的蒙板区域内色彩强度与源图像的蒙板区域色彩强度不一致;但融合图像的蒙板区域内色彩梯度与源图像的蒙板区域色彩梯度基本相同。此外,融合图像的在蒙板区域边界处色彩强度与目标图像的色彩强度相同。
参考文献:Rez P, Gangnet M, Blake A. Poisson image editing.[J]. Acm Transactions on Graphics, 2003, 22(3):313-318.
1.1 引言(Introduction)
该方法的数学思想是给定狄利克雷边界条件的泊松偏微分方程。
(1)图像中,拉普拉斯算子提取的二阶变化量在感知上最明显;
(2)唯一解:有界域上的标量函数可由其边界值和域内拉普拉斯算子唯一确定(即, φ ( x , y ) \varphi(x, y) φ(x,y)由 f ( x , y ) f(x, y) f(x,y)和 g ( x , y ) g(x, y) g(x,y)唯一确定,见1.2.0 泊松方程)。
泊松方程的求解过程也可理解为最小化问题:给定边界条件,在 L 2 L_2 L2范数意义下,计算梯度最接近引导向量场(guidance vector field)的函数。
1.2 导向插值求解泊松方程(Poisson solution to guided interpolation)
1.2.0 泊松方程(Poisson’s Equation)
- 泊松方程
− Δ φ = f - \Delta \varphi = f −Δφ=f
- 狄利克雷边界条件(Dirichlet boundary condition)
微分方程的“第一类边界条件”,给定微分方程的解在边界处的值。
- 给定狄利克雷边界条件的泊松偏微分方程
{ − Δ φ ( x , y ) = f ( x , y ) x , y ∈ Ω φ ( x , y ) = g ( x , y ) x , y ∈ ∂ Ω \begin{cases} -\Delta \varphi(x, y) = f(x, y) & x, y \in \Omega \\ \varphi(x, y) = g(x, y)& x, y \in \partial \Omega \end{cases} { −Δφ(x,y)=f(x,y)φ(x,y)=g(x,y)x,y∈Ωx,y∈∂Ω
其中 Ω ⊂ R n \Omega \subset R^n Ω⊂Rn为有界开集, Δ = ∂ 2 ∂ x 2 + ∂ 2 ∂ y 2 \Delta = \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} Δ=∂x2∂2+∂y2∂2为拉普拉斯算子(Laplacian operator)。
1.2.1 引导插值(Guided Interpolation)
- 引导插值:利用引导向量场(guidance vector field)进行图像插值。
S S S: R 2 R^2 R2的闭子集,表示图像的定义域;
Ω \Omega Ω: S S S的闭子集,其边界为 ∂ Ω \partial \Omega ∂Ω;
f ∗ f^{\ast} f∗:定义在 Ω \Omega Ω域边界及外部( S − Ω + ∂ Ω S- \Omega + \partial \Omega S−Ω+∂Ω)上的已知标量函数(scalar function);
f f f:定义在 Ω \Omega Ω域内部( Ω − ∂ Ω \Omega - \partial \Omega Ω−∂Ω)上的未知标量函数(scalar function);
v \mathbf{v} v:定义在 Ω \Omega Ω域上的矢量场(vector field)
- 最小化问题:
min f ∬ Ω ∣ ∇ f − v ∣ 2 with f ∣ ∂ Ω = f ∗ ∣ ∂ Ω \min_f \iint_{\Omega} \left| \nabla f - \mathbf{v} \right|^2 \quad \text{with} \ \left. f \right|_{\partial \Omega} = \left. f^{\ast} \right|_{\partial \Omega} fmin∬Ω∣∇f−v∣2with f∣∂Ω=f∗∣∂Ω
(3)
其中, ∇ = [ ∂ ∂ x , ∂ ∂ x ] \nabla = \left[ \frac{\partial }{\partial x}, \frac{\partial }{\partial x} \right] ∇=[∂x∂,∂x∂]为梯度算子(gradient operator),矢量场 v \mathbf{v} v为引导场(guidance field)。该问题的解为给定狄利克雷边界条件的泊松偏微分方程的唯一解:
Δ f = ∇ ⋅ v over Ω with f ∣ ∂ Ω = f ∗ ∣ ∂ Ω \Delta f = \nabla \cdot \mathbf{v} \ \text{over} \ \Omega \quad \text{with} \ \left. f \right|_{\partial \Omega} = \left. f^{\ast} \right|_{\partial \Omega} Δf=∇⋅v over Ωwith f∣∂Ω=f∗∣∂Ω
(4)
其中, ∇ ⋅ v = ∂ u ∂ x + ∂ v ∂ y \nabla \cdot \mathbf{v} = \frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} ∇⋅v=∂x∂u+∂y∂v表示 v = ( u , v ) \mathbf{v} = \left( u, v\right) v=