You are on page 1of 14

6136

Differential Equations in Image Processing and Computer Vision 2023 MI


A
Lecture 5: 1 2

3 4
Nonlinear Isotropic Diffusion Filtering II:
Semidiscrete and Fully Discrete Theory 5 6

7 8
Contents
9 10
1. Motivation 11 12
2. Semidiscrete Well-Posedness and Scale-Space Theory
13 14
An Example


A Semidiscrete Theoretical Framework




15 16
Application to the Example


3. Fully Discrete Well-Posedness and Scale-Space Theory 17 18

Examples 19 20


A Discrete Theoretical Framework




Application to the Examples 21 22




© 2020 – 2023 Joachim Weickert, Pascal Peter 23 24

Recently on DIC ... MI


A
Recently on DIC ... 1 2

3 4
Perona-Malik filter avoids blurring and delocalisation of edges


5 6
edge enhancement by rapidly decreasing diffusivity function in |∇u|2


nonmonotone flux function causes forward–backward diffusion 7 8




has generalised solutions, but no continuous dependence on the initial data 9 10




well-posedness in case of Gaussian regularisation: g(|∇uσ |2) instead of g(|∇u|2)




11 12
practical properties of regularised Perona–Malik filter:


13 14
• more robust under noise
• less staircasing 15 16
• keeps advantages of Perona–Malik filter (well-localised, enhanced edges)
17 18
theoretical properties of regularised Perona–Malik filter:


• average grey level invariance 19 20


• extremum principle (causality) for t ∈ [0, ∞)
21 22
• many smoothing Lyapunov functionals
• convergence to a constant steady-state 23 24
6136

Outline MI
A
Lecture 5: 1 2

3 4
Nonlinear Isotropic Diffusion Filtering II:
Semidiscrete and Fully Discrete Theory 5 6

7 8
Contents
9 10
1. Motivation 11 12
2. Semidiscrete Well-Posedness and Scale-Space Theory
13 14
An Example


A Semidiscrete Theoretical Framework




15 16
Application to the Example


3. Fully Discrete Well-Posedness and Scale-Space Theory 17 18

Examples 19 20


A Discrete Theoretical Framework




Application to the Examples 21 22




© 2020 – 2023 Joachim Weickert, Pascal Peter 23 24

Motivation MI
A
Motivation 1 2

3 4
Lecture 4 dealt with isotropic nonlinear diffusion filters in the continuous setting.


In this setting, we have derived a well-posedness and scale-space theory. 5 6


Do similar results also hold for the algorithmically relevant discrete setting ? 7 8


We proceed in two steps: 9 10




• semidiscrete case: discrete in space, continuous in time


11 12
• fully discrete case: discrete in space and time
13 14
This will yield design criteria for reliable diffusion algorithms.


15 16

17 18

19 20

21 22

23 24
6136

Outline MI
A
Lecture 5: 1 2

3 4
Nonlinear Isotropic Diffusion Filtering II:
Semidiscrete and Fully Discrete Theory 5 6

7 8
Contents
9 10
1. Motivation 11 12
2. Semidiscrete Well-Posedness and Scale-Space Theory
13 14
An Example


A Semidiscrete Theoretical Framework




15 16
Application to the Example


3. Fully Discrete Well-Posedness and Scale-Space Theory 17 18

Examples 19 20


A Discrete Theoretical Framework




Application to the Examples 21 22




© 2020 – 2023 Joachim Weickert, Pascal Peter 23 24

Semidiscrete Well-Posedness and Scale-Space Theory (1) MI


A
Semidiscrete Well-Posedness and Scale-Space Theory 1 2

3 4
Example of a Space Discretisation
5 6
We want a spatial discretisation of the regularised diffusion equation


  7 8
∂tu = div g(|∇uσ |2) ∇u
    9 10
= ∂x g(|∇uσ |2) ∂xu + ∂y g(|∇uσ |2) ∂y u .
11 12
We apply central differences twice with half the step size in both directions.


13 14
This gives a compact approximation of the second order derivative in pixel (i, j):
15 16
 1  k k 
∂x g ∂xu ≈ g ∂xu i+1/2,j − g ∂xu i−1/2,j
h1 17 18
 
1 gi+1,j + gi,j ui+1,j − ui,j gi,j + gi−1,j ui,j − ui−1,j
≈ · − · 19 20
h1 2 h1 2 h1
21 22
where gi+1/2,j was replaced by the average of gi+1,j and gi,j .
As usual, h1 denotes the pixel size in x-direction. 23 24
6136

Semidiscrete Well-Posedness and Scale-Space Theory (2) MI


A
 This is not exotic: For g = 1 we obtain our homogeneous diffusion discretisation 1 2
1  
∂xxu ≈ 2 ui+1,j − 2 ui,j + ui−1,j . 3 4
h1
5 6
The nonlinear diffusivity function g depends on first order derivatives.


Here we can use central differences with full step size in both directions: 7 8

gi,j = g (∂xuσ )2 + (∂y uσ )2 i,j
9 10
 2  2 !
uσ,i+1,j − uσ,i−1,j uσ,i,j+1 − uσ,i,j−1
≈ g + . 11 12
2h1 2h2
13 14
We end up with one ordinary differential equation (ODE) for each inner pixel (i, j):


  15 16
dui,j 1 gi+1,j + gi,j ui+1,j − ui,j gi,j + gi−1,j ui,j − ui−1,j
= · − ·
dt h1 2 h1 2 h1 17 18
 
1 gi,j+1 + gi,j ui,j+1 − ui,j gi,j + gi,j−1 ui,j − ui,j−1
+ · − · . 19 20
h2 2 h2 2 h2

This system of ODEs is discrete in space, but still continuous in time. 21 22




Therefore, it is called a semidiscretisation of the diffusion equation.


23 24

Semidiscrete Well-Posedness and Scale-Space Theory (3) MI


A
Properties of this Semidiscretisation 1 2

The formula remains valid at boundary pixels with reflecting boundary conditions: 3 4


Just introduce mirrored dummy pixels as in Lecture 3.


5 6
gi,j approximates the diffusivity g(|∇uσ |2) = g(|∇(Kσ ∗ u)|2) in pixel (i, j).


7 8
Remember that g is a nonlinear C∞ function of |∇uσ |2 (cf. Lecture 4).


9 10
Thus, also gi,j is a nonlinear C∞ function of its argument.
It may depend on the entire set of pixel values {uk,` | k = 1, ..., n; ` = 1, ..., m}. 11 12

This even holds in the Perona-Malik case (i.e. without Gaussian regularisation): 13 14


gi,j remains a nonlinear C∞ function.


15 16

17 18

19 20

21 22

23 24
6136

Semidiscrete Well-Posedness and Scale-Space Theory (4) MI


A
Example in More Compact Notation 1 2

Representing pixel (i, j) by a single index k(i, j) leads to 3 4




X2 X
duk g` + gk 5 6
= (u` − uk ),
dt n=1
2h2n
`∈Nn (k)
7 8
where Nn(k) are the neighbours of pixel k in n-direction
(x for n = 1, y for n = 2; boundary pixels have less neighbours). 9 10
This can be written as a system of ordinary differential equations (ODEs):


11 12
dū(t)
= A(ū(t)) ū(t),
dt 13 14
where ū(t) = (u1, ..., uN )>, and the N × N matrix A(ū(t)) = (ak,`(ū(t))) satisfies
15 16
 gk +g`

 2h2n
(` ∈ Nn(k)),

 17 18
P
2 P gk +g`
ak,` := − 2h2n
(` = k),

 n=1 `∈Nn (k) 19 20


0 (else).
21 22
Note that ak,` is a C∞ function of u for all k and `, since g is C∞.


23 24

Semidiscrete Well-Posedness and Scale-Space Theory (5) MI


A
A Semidiscrete Theoretical Framework 1 2

We want to obtain well-posedness and scale-space theory for semidiscrete diffusion. 3 4




It should cover many semidiscretisations, including the previous example. 5 6




It should lead to similar results as in continuous case (Lecture 4).




7 8

9 10
Assumptions
11 12
Let f ∈ RN denote our discrete initial image.
We consider a general ODE system with the structure 13 14

dū(t) 15 16
= A(ū(t)) ū(t),
dt
17 18
ū(t)(0) = f ,
19 20
and assume that the N × N matrix A(ū(t)) = (ai,j (ū(t))) satisfies five properties:
21 22

23 24
6136

Semidiscrete Well-Posedness and Scale-Space Theory (6) MI


A
(S1) Smoothness: 1 2
A is a Lipschitz-continuous function of ū(t) for every bounded subset of RN :
3 4
There exists some L with kA(u)−A(v)k ≤ L ku−vk for all u, v in this subset.
Remark: This is satisfied e.g. if ai,j : RN → R is a C1 function for all i, j. 5 6

(S2) Symmetry: ai,j (ū(t)) = aj,i(ū(t)) ∀ i, j 7 8


N
X 9 10
(S3) Zero Column Sums: ai,j (ū(t)) = 0 ∀j
i=1
11 12
(S4) Nonnegative Off-diagonals: ai,j (ū(t)) ≥ 0 ∀ i 6= j
13 14
(S5) Irreducibility:
For any i, j there exist k0,...,kr with k0 = i and kr = j such that 15 16
ak0,k1 6= 0, ak1,k2 6= 0, ..., akr−1,kr 6= 0.
17 18
(“There is some path from pixel i to pixel j where communication happens.”)
19 20
Under these five assumptions, five results can be established:
21 22

23 24

Semidiscrete Well-Posedness and Scale-Space Theory (7) MI


A
Results 1 2

(a) Well-Posedness 3 4
There exists a unique solution.
5 6
It depends continuously on f and the right hand side of the ODE system.
7 8
(b) Average Grey Level Invariance
9 10
N N
1 X 1 X 11 12
uj (t) = fj =: µ ∀ t > 0.
N j=1 N j=1
13 14

15 16
(c) Maximum–Minimum Principle
17 18
min fj ≤ ui(t) ≤ max fj ∀ i, ∀ t > 0.
j j 19 20

21 22

23 24
6136

Semidiscrete Well-Posedness and Scale-Space Theory (8) MI


A
(d) Lyapunov Functions 1 2
N
X
V (t) := r(ui(t)) 3 4
i=1
5 6
is a Lyapunov function for all convex r ∈ C1(R):
V (t) is decreasing and bounded from below. 7 8

As in the continuous case, this implies 9 10


P N 1/p
decreasing p-norms ku(t)kp = |ui(t)|p for p ≥ 2, 11 12


i=1

1
P
N
13 14
decreasing even central moments |ui(t) − µ|2n,


N
i=1
P
N 15 16
increasing entropy − ui(t) ln ui(t).


i=1 17 18

(e) Convergence to a Constant Steady-State 19 20

21 22
lim ui(t) = µ ∀ i.
t→∞
23 24

Semidiscrete Well-Posedness and Scale-Space Theory (9) MI


A
Application to the Example 1 2

Our spatial finite difference discretisation of a continuous isotropic diffusion filter 3 4


satisfying (C1’), (C3’) fulfils the semidiscrete requirements (S1)–(S5):
5 6

Smoothness (S1) follows from fact that ak,` is C function of ū(t) (cf. Slide 6).


7 8
The symmetry (S2) is easy to check: For k 6= ` we have


gk + g` 9 10
ak,` = = a`,k (` ∈ Nn(k)),
2h2n
ak,` = 0 = a`,k (` 6∈ Nn(k)). 11 12

13 14
Zero column sums (S3) follow from


2
X X X 15 16
gk + g`
a`,` = − = − ak,` ∀ `.
n=1 k∈Nn (`)
2h2n 17 18
k,k6=`

19 20
Nonnegative off-diagonals (S4) are guaranteed by the definition of ak,` on Slide 6.


Irreducibility (S5) is satisfied: For two pixels i and j, consider any connecting path 21 22


along neighbours. For two such neighbours k and ` we have ak,` = gk2h+g 2 > 0.
`
n 23 24
6136

Semidiscrete Well-Posedness and Scale-Space Theory (10) MI


A
A Surprising Byproduct 1 2

Apply our standard semidiscretisation to the unregularised Perona–Malik filter. 3 4




In Lecture 4 we have learned: 5 6




The continuous Perona–Malik filter suffers from some well-posedness problems.


7 8
However, its spatial discretisation does also satisfy (S1)–(S5).


Thus, a space-discrete Perona–Malik filter is well-posed. 9 10




Moreover, it creates a scale-space transformation.


11 12

13 14

15 16

17 18

19 20

21 22

23 24

Outline MI
A
Lecture 5: 1 2

3 4
Nonlinear Isotropic Diffusion Filtering II:
Semidiscrete and Fully Discrete Theory 5 6

7 8
Contents
9 10
1. Motivation 11 12
2. Semidiscrete Well-Posedness and Scale-Space Theory
13 14
An Example


A Semidiscrete Theoretical Framework




15 16
Application to the Example


3. Fully Discrete Well-Posedness and Scale-Space Theory 17 18

Examples 19 20


A Discrete Theoretical Framework




Application to the Examples 21 22




© 2020 – 2023 Joachim Weickert, Pascal Peter 23 24


6136

Fully Discrete Well-Posedness and Scale-Space Theory (1) MI


A
Discrete Theory 1 2

3 4
Examples
5 6
dū(t)
Let the nonlinear ODE system = A(ū(t)) ū(t) satisfy (S1)–(S5).
dt
We want to study two different time discretisations. 7 8

9 10
1. Explicit Scheme
ū(t)k+1 − ū(t)k 11 12
= A(ū(t)k ) ū(t)k
τ
13 14
leads to matrix-vector multiplication
 15 16
k+1
ū(t) = I + τ A(ū(t) ) ū(t)k ,
k

17 18
where τ is the time step size,
19 20
the upper index denotes the time level,
and I is the N × N unit matrix. 21 22

23 24

Fully Discrete Well-Posedness and Scale-Space Theory (2) MI


A
2. Semi-Implicit Scheme 1 2

ū(t)k+1 − ū(t)k 3 4
= A(ū(t)k ) ū(t)k+1
τ
5 6
requires to solve a linear system of equations:
7 8

I − τ A(ū(t)k ) ū(t)k+1 = ū(t)k . 9 10

Can also be regarded formally as matrix-vector multiplication: 11 12


−1 13 14
ū(t)k+1 = I − τ A(ū(t)k ) ū(t)k .
15 16
Let us now discuss a theoretical framework that covers both time discretisations.
17 18

19 20

21 22

23 24
6136

Fully Discrete Well-Posedness and Scale-Space Theory (3) MI


A
A Discrete Theoretical Framework 1 2

Assumptions 3 4

Let f ∈ RN and compute (ū(t)k )k∈N0 by 5 6

ū(t)0 = f , 7 8
ū(t)k+1 = Q(ū(t)k ) ū(t)k , ∀ k ∈ N0 ,
9 10
where the N × N matrix Q = (qi,j ) is a (nonlinear) function of ū(t)k that satisfies
11 12
k k
(D1) Smoothness: qi,j (ū(t) ) is continuous in ū(t) for all i, j
13 14
k k
(D2) Symmetry: qi,j (ū(t) ) = qj,i(ū(t) ) ∀ i, j
XN 15 16
(D3) Unit Column Sums: qi,j (ū(t)k ) = 1 ∀j
i=1 17 18
k
(D4) Nonnegativity: qi,j (ū(t) ) ≥ 0 ∀ i, j
19 20
(D5) Positive Diagonal: qi,i(ū(t)k ) > 0 ∀i
21 22
(D6) Irreducibility
23 24

Fully Discrete Well-Posedness and Scale-Space Theory (4) MI


A
Results 1 2

(a) Well-Posedness 3 4
Obviously the solution ū(t)k exists and is unique.
5 6
It depends continuously on f for every k > 0.
7 8
(b) Average Grey Level Invariance
9 10
N N
1 X k 1 X 11 12
u = fj =: µ ∀ k ∈ N0 .
N j=1 j N j=1
13 14

(c) Maximum–Minimum Principle 15 16

min fj ≤ uki ≤ max fj ∀ i, ∀ k > 0. 17 18


j j
19 20

21 22

23 24
6136

Fully Discrete Well-Posedness and Scale-Space Theory (5) MI


A
(d) Lyapunov Sequences 1 2
N
X
V k := r(uki ) 3 4
i=1
is a Lyapunov sequence for all convex r ∈ C(R): 5 6
V k is decreasing in k and bounded from below.
7 8
This implies decreasing p-norms for p ≥ 2, decreasing central moments, and
increasing entropy. 9 10

(e) Convergence to a Constant Steady-State 11 12

13 14
lim uki = µ ∀ i.
k→∞
15 16

17 18

19 20

21 22

23 24

Fully Discrete Well-Posedness and Scale-Space Theory (6) MI


A
Application to the Examples 1 2

The discrete requirements (D1)–(D6) constitute simple design criteria for reliable 3 4
nonlinear diffusion algorithms.
5 6
Let A = (ai,j ) : R → R
N N ×N
satisfy the semidiscrete requirements (S1)–(S5).
Let us now check if the explicit and semi-implicit discretisations satisfy (D1)–(D6). 7 8

1. Explicit Scheme 9 10

ū(t)k+1 = I + τ A(ū(t)k ) ū(t)k
| {z } 11 12
Q(ū(t)k )
fulfils immediately the following discrete requirements: 13 14
• Smoothness of Q (D1) follows from the smoothness of A (S1). 15 16
• Symmetry of Q (D2) follows from the symmetry of A (S2).
17 18
• Unit column sums of Q (D3) follow from vanishing column sums of A (S3).
• Irreducibility of Q (D6) follows from irreducibility of A (S5): 19 20
For k 6= `, note that qk,` > 0 if ak,` > 0.
• For off-diagonal elements, nonnegativity (D4) follows from qi,j = τ ai,j and the 21 22
nonnegative off-diagonals of A (S4).
23 24
6136

Fully Discrete Well-Posedness and Scale-Space Theory (7) MI


A
How can We Guarantee Positive Diagonal Elements? 1 2
• Nonnegative / positive off diagonals (D4), (D5) are satisfied if 3 4
qi,i = 1 + τ ai,i > 0 ∀ i.
5 6
• This yields (note that ai,i < 0):
7 8
1
τ < .
max |ai,i(ū(t)k )| 9 10
i

• In the special case hn := 1 and 0 < gj ≤ 1 we obtain 11 12


X2 X gk + gi X2 X
|ai,i| = ≤ 1. 13 14
n=1
2h2n n=1
k∈Nn (i) k∈Nn (i)
15 16
• In 2D, every pixel has at most four neighbours. This gives |ai,i| ≤ 4.
17 18
• Thus, the explicit scheme must satisfy
1 19 20
τ < .
4
21 22
• This is the same severe restriction as for homogeneous diffusion (Lecture 3):
Many time steps are necessary for reaching some “interesting” diffusion time.
23 24

Fully Discrete Well-Posedness and Scale-Space Theory (8) MI


A
Stencil Notation for Practical Implementations 1 2

3 4
τ k
0 h22
gi,j+1/2 0
5 6
− hτ2 gi,j+1/2
k
2 7 8
τ k τ k
h21
gi−1/2,j − hτ2 k
gi−1/2,j + 1 − τ
h21
k
gi+1/2,j h21
gi+1/2,j
1
9 10
− hτ2 gi,j−1/2
k
2
11 12
τ k
0 h22
gi,j−1/2 0
13 14

k
• The diffusivity gi+1/2,j k
is approximated by the average of gi+1,j k
and gi,j . 15 16

• This stencil performs weighted averaging with time- and space-variant weights. 17 18
The weights depend on the evolving image and become small at edges.
Nevertheless, all weights sum up to 1. 19 20
The time step size restriction guarantees nonnegative weights and stability.
21 22
• Setting g := 1 gives the homogeneous diffusion stencil from Lecture 3.
23 24
6136

Fully Discrete Well-Posedness and Scale-Space Theory (9) MI


A
2. Semi-Implicit Scheme 1 2

−1 3 4
ū(t)k+1 = I − τ A(ū(t)k ) ū(t)k
5 6
One can show that (D1)–(D6) are satisfied for arbitrarily (!) large time steps τ .
It can be an interesting alternative to the explicit scheme, 7 8
if we can solve the resulting linear system of equations efficiently.
9 10
Such solvers will be discussed in the next lecture.
11 12

13 14

15 16

17 18

19 20

21 22

23 24

Fully Discrete Well-Posedness and Scale-Space Theory (10) MI


A
How General is This Theory ? 1 2

The semidiscrete and fully discrete diffusion theory is very general. 3 4




applies to many discretisations, also beyond the ones we discussed 5 6




covers even discrete nonlocal processes that do not come from PDEs


7 8
holds in any dimension


9 10
also applicable for data on surfaces or graphs


11 12

13 14

15 16

17 18

19 20

21 22

23 24
6136

Summary MI
A
Summary 1 2

3 4
Complete well-posedness and scale-space theories exist also for the semidiscrete


and fully discrete setting. 5 6


They yield results in analogy to the continuous case:


7 8
• existence, uniqueness, stability w.r.t. initial image
9 10
• extremum principle
• average grey level invariance 11 12
• many simplifying Lyapunov functions/sequences
13 14
• convergence to constant steady-state
15 16
The semidiscrete theory is satisfied by standard finite difference discretisation


(even for the unregularised Perona-Malik equation). 17 18

The discrete theory is satisfied 19 20




• by explicit scheme for times step sizes τ < 0.25 if g ≤ 1 and h1 = h2 = 1.


21 22
• by semi-implicit scheme for all time step sizes.
23 24

References MI
A
References 1 2

J. Weickert: Anisotropic Diffusion in Image Processing. Teubner, Stuttgart, 1998. 3 4




(https://www.mia.uni-saarland.de/weickert/Papers/book.pdf)
(Chapters 3 and 4 present a slightly more general semidiscrete and discrete theory covering also 5 6
anisotropic diffusion filters.)
7 8

9 10

11 12

13 14

15 16

17 18

19 20

21 22

23 24

You might also like