
306 Variational Methods in Image Processing
i−1,j−1 i+1,j−1
i−1,j
i−1,j+1 i+1,j+1
i+1,ji,j
h
i,j−1
i,j+1
h
P
i+1,j−1
i+1,j+1
i+1,j
h
i,j−1
i,j+1
h
2
i,j
Q
FIGURE 13.1: Integration domains.
boundary, we look at the integral of equation (13.1) (or (13.2)) over a square ,
P , centered at a grid po int (see Figure 13.1):
0 =
ˆ
P
∇ · σ∇udx =
ˆ
∂P
σ
∂u
∂n
dS,
n denoting the unit outward normal to ∂P .
Using finite differences to approximate the normal derivative of u in this
formula, we obtain:
0 = σ
i+
1
2
,j
u
i+1,j
− u
i,j
h
h + σ
i,j−
1
2
u
i,j−1
− u
i,j
h
h
+ σ
i−
1
2
,j
u
i−1,j
− u
i,j
h
h + σ
i,j+
1
2
u
i,j+1
− u
i,j
h
h,
0 =
−(σ
i+
1
2
,j
+ σ
i,j−
1
2
+ σ
i−
1
2
,j
+ σ
i,j+
1
2
)
h
2
u
i,j
+
σ
i+
1
2
,j
h
2
u
i+1,j
+
σ
i,j−
1
2
h
2
u
i,j−1
+
σ
i−
1
2
,j