泊松融合笔记

参考书籍

张恭庆. 变分学讲义[M]. 北京:高等教育出版社, 2011.
Pérez, Patrick, Gangnet M , Blake A . Poisson image editing[J]. ACM Transactions on Graphics, 2003, 22(3):313.

  1. 使用的引理
    引理2.1 (du Bois-Reymond)若 ψ ∈ C [ t 0 , t 1 ] \psi\in C[t_0,t_1] ψC[t0,t1],且
    ∫ J ψ ( t ) ⋅ λ ˙ ( t ) d t = 0 , ∀ λ ∈ C 0 1 ( J ) , \int_{J}\psi(t)\cdot\dot{\lambda}(t)dt=0,\forall\lambda\in C_0^1(J), Jψ(t)λ˙(t)dt=0,λC01(J)
    其中 C 0 1 ( J ) = { u ∈ C 1 ( J ) ∣ u ( t 0 ) = u ( t 1 ) = 0 } C_0^1(J)=\left\{ u\in C^1(J)|u(t_0)=u(t_1)=0\right\} C01(J)={uC1(J)u(t0)=u(t1)=0},则 ψ = c o n s t \psi=const ψ=const

  2. 主要公式推导
    原问题的等价形式
    Δ f = ∇ ⋅ v ( x , y ) = d i v ( v ( x , y ) ) , ∀ ( x , y ) ∈ Ω , w i t h f ∣ R ∖ Ω = f ∗ ∣ R ∖ Ω \Delta f=\nabla\cdot v(x,y)=div(v(x,y)),\forall (x,y)\in\Omega,with\quad f|_{\mathscr{R}\setminus\Omega}=f^*|_{\mathscr{R}\setminus\Omega} Δf=v(x,y)=div(v(x,y)),(x,y)Ω,withfRΩ=fRΩ
    其中 R ⊂ R 2 \mathscr{R}\subset R^2 RR2 表示背景图像区域, v ( x , y ) = ( ∂ I ( x , y ) ∂ x , ∂ I ( x , y ) ∂ y ) v(x,y)=(\frac{\partial I(x,y)}{\partial x},\frac{\partial I(x,y)}{\partial y}) v(x,y)=(xI(x,y),yI(x,y))是前景图片合并前的梯度, f : R 2 → R f:R^2\rightarrow R f:R2R,表示合并后在 Ω \Omega Ω区域的灰度值函数,在目标区域的梯度要尽量接近合并前前景图片的梯度, f ∗ f^* f表示合并后在 Ω \Omega Ω区域之外的灰度值函数,在边界处灰度连续,即 f ∣ R ∖ Ω = f ∗ ∣ R ∖ Ω f|_{\mathscr{R}\setminus\Omega}=f^*|_{\mathscr{R}\setminus\Omega} fRΩ=fRΩ

    F ( f ) = { ∫ Ω ∣ ∣ ∇ f − v ∣ ∣ 2 d x } , s . t . f ∣ R ∖ Ω = f ∗ ∣ R ∖ Ω F(f)=\left\{\int_{\Omega}||\nabla f-v||^2dx\right\},s.t. \quad f|_{\mathscr{R}\setminus\Omega}=f^*|_{\mathscr{R}\setminus\Omega} F(f)={Ωfv2dx},s.t.fRΩ=fRΩ,
    定义 S 0 = { g ∈ C 2 ( R ) ∣ g ∣ ∂ Ω = 0 } S_0=\left\{g\in \mathscr{C}^2(\mathscr{R}) | g|_{\partial\Omega}=0\right\} S0={gC2(R)gΩ=0}
    根据单变量函数求极值的条件得到
    lim ⁡ ϵ → 0 F ( f + ϵ g ) − F ( f ) ϵ = 0 , ∀ g ∈ S 0 \lim\limits_{\epsilon\rightarrow0}\frac{F(f+\epsilon g)-F(f)}{\epsilon}=0,\forall g\in S_0 ϵ0limϵF(f+ϵg)F(f)=0,gS0
    将上式展开
    0 = lim ⁡ ϵ → 0 1 ϵ { ∫ Ω ∣ ∣ ∇ ( f + ϵ g ) − v ∣ ∣ 2 − ∣ ∣ ∇ ( f ) − v ∣ ∣ 2 d t } = lim ⁡ ϵ → 0 1 ϵ { ∫ Ω ( 2 ϵ ∇ g ⋅ ( ∇ f − v ) + ϵ 2 ∣ ∣ ∇ g ∣ ∣ 2 ) d t } = ∫ Ω ( 2 ∇ g ⋅ ( ∇ f − v ) ) d x = ∫ Ω ∑ i = 1 3 ( 2 ( ∇ g ) i ⋅ ( ∇ f − v ) i ) d x \begin{aligned} 0&=\lim\limits_{\epsilon\rightarrow0}\frac{1}{\epsilon}\left\{\int_{\Omega}||\nabla(f+\epsilon g)-v||^2-||\nabla(f)-v||^2dt\right\} \\ &=\lim\limits_{\epsilon\rightarrow0}\frac{1}{\epsilon}\left\{\int_{\Omega}(2\epsilon\nabla g\cdot(\nabla f-v)+\epsilon^2||\nabla g||^2)dt\right\} \\ &=\int_{\Omega}(2\nabla g\cdot(\nabla f-v))dx \\ &=\int_{\Omega}\sum_{i=1}^3(2(\nabla g)_i\cdot(\nabla f-v)_i)dx \end{aligned} 0=ϵ0limϵ1{Ω(f+ϵg)v2(f)v2dt}=ϵ0limϵ1{Ω(2ϵg(fv)+ϵ2g2)dt}=Ω(2g(fv))dx=Ωi=13(2(g)i(fv)i)dx
    由引理可得
    ( ∇ f − v ) i = c o n s t , i = 1 , 2 , 3 (\nabla f-v)_i=const,i=1,2,3 (fv)i=const,i=1,2,3
    所以有
    ∇ f − v = c o n s t \nabla f-v=const fv=const
    对等式两边取旋度得到
    ∇ ⋅ ( ∇ f − v ) = 0 \nabla\cdot(\nabla f-v)=0 (fv)=0
    从而得到
    Δ f ( x , y ) = ∇ ⋅ v ( x , y ) = d i v ( v ( x , y ) ) , ∀ ( x , y ) ∈ Ω , w i t h f ∣ R ∖ Ω = f ∗ ∣ R ∖ Ω \Delta f(x,y)=\nabla\cdot v(x,y)=div(v(x,y)),\forall (x,y)\in\Omega,with\quad f|_{\mathscr{R}\setminus\Omega}=f^*|_{\mathscr{R}\setminus\Omega} Δf(x,y)=v(x,y)=div(v(x,y)),(x,y)Ω,withfRΩ=fRΩ
    下一篇:FFT求解泊松方程

你可能感兴趣的:(计算机视觉)