Sunteți pe pagina 1din 37

1 Segmentierung medizinischer Bilddaten Stefan Burkhardt

8 Anisotropic diffusion filtering


8 Anisotropic diffusion filtering
Images contain of the image itself and noise
Noise: random, little disturbances of the image
To improve the segmentation: the noise should be reduced
Condition:
Remove noise
But: keep the image
information unchanged
2 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8 Anisotropic diffusion filtering
Diffusion
Physical process for balancing concentration changes
Now:
the image intensity can be seen as a concentration
The noise can be modelled as little concentration
inhomogeneities
These inhomogeneities could be smoothed by diffusion
Diffusion should only be perpendicular e.g. to edges
3 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.1 Physical background
Physical background of diffusion
Given: a concentration distribution u
Ficks law:
Concentration gradient causes a flux j
j aims to compensate the gradient
D: diffusion tensor, in general a positive definite,
symmetric matrix
u = D j
4 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.1 Physical background
Physical background of diffusion (2)
Diffusion is mass transport without destroying mass or
creating new mass
Continuity equation
t denotes the time,
t
u the deviation of u with respect to t
|
|
.
|

\
|

= =
y x
u
t
j j
j div
5 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.1 Physical background
Physical background of diffusion (3)
diffusion equation
Application in many physical transport process, e.g. for
heat transfer it is called heat-transfer-equation
Image processing:
Identify the concentration with the grey value at a certain
location
( ) u u
t
= D div
6 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.1 Physical background
Physical background of diffusion (4)
Diffusion tensor:
Constant over the whole image: homogeneous (or
linear) diffusion
Often it is a function of the structure of the image itself:
nonlinear diffusion
Isotropic: j and the concentration gradient are parallel
Anisotropic: otherwise
7 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.2 Linear diffusion
Linear isotropic diffusion
Mostly used for smoothing images
The image I itself is the initial starting for the diffusion
process
We use D = 1 since D only influences the speed of the
diffusion
) , ( ) 0 , , (
div
y x I y x u
u u
t
=
=
8 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.2 Linear diffusion
Linear isotropic diffusion (2)
t=4 t=8 t=12
t=20 t=16 t=24 t=40
t=0
9 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.2 Linear diffusion
Linear isotropic diffusion (3)
Advantages:
Continuously simplifying of the image
Reducing the noise in the image
Disadvantages:
Linear isotropic diffusion does not only reduce noise
It also blues important features like edges
No a-priori knowledge is taken into account
Result: it makes edges harder to identify
10 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.3 Nonlinear diffusion
Nonlinear diffusion
Improvement:
Preservation of the edges, only smooting between edges
Need to assign a position specific diffusivity
Adapting the diffusivity g to the gradient in the actual
image u(x,y,t)
We obtain the equation
( ) ( ) u u u =
2
div g
t
11 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.3 Nonlinear diffusion
0 u for 1
u for 0


g
g
Nonlinear diffusion (2)
Conditions for g
Perona & Malik:
( )
2
2
2
1
1

u
u g

+
=
12 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.3 Nonlinear diffusion
Nonlinear diffusion (3)
t=4 t=8 t=12
t=20 t=16 t=24 t=40
t=0
13 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.3 Nonlinear diffusion
Nonlinear diffusion (4)
t=4 t=20 t=40
t=40 t=20 t=4
Linear
diffusion
Nonlinear
diffusion
14 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.3 Nonlinear diffusion
Nonlinear diffusion (5)
Advantages
Steering of the diffusion at each point of the image is
possible
So diffusion can be reduced on edges
The result: edge-preserving image smoothing
But: the smoothing of the edges cannot be completely
circumvented
Next: anisotropic approaches
15 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.4 Nonlinear anisotropic diffusion
Nonlinear anisotropic diffusion
Until now: determination of the amount of diffusion
depending on local features (here: the gradient).
Other features could be possible
Idea: we could define the diffusion tensor so that the
diffusion goes around some structures
Here: diffusion should preserve edges
On edges: no diffusion over edges, but diffusion parallel
to edges should be enabled
16 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.4 Nonlinear anisotropic diffusion
Nonlinear anisotropic diffusion (2)
Combination of two features
Non-linearity
-The diffusion at border is much less than the
diffusion elsewhere
Anisotropy
-Diffusion should be perpendicular to edge
-No diffusion over edges
17 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.4 Nonlinear anisotropic diffusion
Nonlinear anisotropic diffusion (3)
How to define the diffusion tensor D?
Remember: D is a positive definite symmetric matrix
It has two different eigenvalues and two eigenvectors
Therewith the eigenvectors are perpendicular
The eigenvectors gives the main diffusion direction
The corresponding eigenvalues the strength of diffusion
in the direction of the eigenvectors.
18 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Definition of the eigenvectors
We want to stop the diffusion over the edge. Therewith we
need as one eigenvector the direction of the gradient.
The second is perpendicular and can be seen as the
tangential vector to the edge
8.4 Nonlinear anisotropic diffusion
[ ]
[ ]
|
|
.
|

\
|

=
x
y
v
v
v
u
u
v
1
1
2
1
Nonlinear anisotropic diffusion (4)
u v
u v

2
1
||
19 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Definition of the eigenvalues
First: We want to stop the diffusion over the edge
(direction v1). We use the non-linearity and define
Perpendicular to the edge the diffusion should not be
stopped
8.4 Nonlinear anisotropic diffusion
( )
2
1
u g =
Nonlinear anisotropic diffusion (5)
1
2
=
20 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Now, we obtain D as
Result is an edge-enhancing anisotropic diffusion
8.4 Nonlinear anisotropic diffusion
T
|
|
|
.
|

\
|

|
|
.
|

\
|

|
|
|
.
|

\
|
=
| |
| |
0
0
| |
| |
2
1
2 1 2 1
v v v v D

Nonlinear anisotropic diffusion (6)


21 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.4 Nonlinear anisotropic diffusion
Nonlinear anisotropic diffusion (7)
t=4 t=8 t=12
t=20 t=16 t=24 t=40
t=0
22 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.4 Nonlinear anisotropic diffusion
Nonlinear anisotropic diffusion (8)
t=4 t=20 t=40
t=40 t=20 t=4
Nonlinear
diffusion
Nonlinear
anisotropic
diffusion
23 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.5 Numerical implementations
Numerical implementation
We have
Looking for a solution u(x,y,t)
Either for a specific t = t
0
Or for t
Problem: the equation cannot be analytically solved
Numerical solution is necessary
) , ( ) 0 , , ( y x I y x u =
24 Segmentierung medizinischer Bilddaten Stefan Burkhardt
1. step: discretizing the time axis
Determination of a time step
- depends on the numerical stability
only the times
are taken into account
We obtain u(x,y,t
i
)
8.5 Numerical implementations
Numerical implementation (2)
= = i t t
i
25 Segmentierung medizinischer Bilddaten Stefan Burkhardt
2. step: finding an approximation for the derivative with
respect to t
The Taylor serie for u(x,y,t) leads to
Neglecting the remain and transform the equation leads to
8.5 Numerical implementations
( ) R t y x u
t
t y x u t y x u +

+ = + ) , , ( ) , , ( ) , , (
Numerical implementation (3)
) , , ( ) , , ( ) , , (
1 i i i
t y x u
t
t y x u t y x u

+ =
+

26 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Conditions to the step size:
Dimensions: m, grid width: h
Costs per iteration: very low
Efficiency: low (many iterations needed to get a result)
8.5 Numerical implementations
m
h
2
2
<
Numerical implementation (4)
27 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Until now we used the so-called explicit scheme
Other notation
with
I: identity matrix
u
i
values of u(x,y,t
i
) stacked in vector form
A
l
(u
k
) matrix version of the diffusion tensors
8.5 Numerical implementations
Notation
( )
i
m
l
i
l
i
u u A I u |
.
|

\
|
+ =

=
+
1
1

28 Segmentierung medizinischer Bilddaten Stefan Burkhardt


Semi-implicit scheme
Additive operator splitting
8.5 Numerical implementations
( )
i
m
l
i
l
i
u u A I u |
.
|

\
|
=

=
+

1
1
1

Improvements
( ) ( )
i
m
l
i
l
i
m
m
u u A I u =

=
+

1
1
1
1

29 Segmentierung medizinischer Bilddaten Stefan Burkhardt


Semi-implicit scheme: We can write the derivative of u
with respect to t as
Implicit: because u
i+1
is used
Semi-implicit: operator A
l
(u
i
) is combined with u
i+1
Transformation of the equation leads to
8.5 Numerical implementations
( )
1
1
1
+
=
+
=

i
m
l
i
l
i i
A u u
u u

Semi-implicit scheme
( )
i
m
l
i
l
i
u u A I u
(

=
+

1
1
1

30 Segmentierung medizinischer Bilddaten Stefan Burkhardt


Features:
Stable for < , but: convergence usually becomes
slower for too large
Cost per iteratorion: high, because the matrix must be
built and inverted in each iteration, O(n
2
)
Efficiency: medium (better than the explicit scheme
because of the possible larger , but further improvement
is possible)
Question: How could the invertion of the matrix be more
effective
Hint: each A
l
is a simple tri-diagonal matrix
8.5 Numerical implementations
Semi-implicit scheme (2)
31 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Objective: split the derivation operator for each spatial
direction
Then we get for each direction a simple tri-diagonal matrix
Such matrices can be very efficiently inverted
Advantage:
Keep the unrestrictedness of
Make the calculation more effective
8.5 Numerical implementations
Additive operator splitting (AOS)
32 Segmentierung medizinischer Bilddaten Stefan Burkhardt
One can write
as
8.5 Numerical implementations
( )
(



=
m
l
i
l
1
u A I
Additive operator splitting (2)
( ) [ ]

=

m
l
i
m
m
1
1
1
u A I
33 Segmentierung medizinischer Bilddaten Stefan Burkhardt
For the computation of the inverse matrix we use the
approximation
The now occuring error is
only of second and higher order
This means: the first derivatives have no errors
8.5 Numerical implementations
( )
1 1
1

+ + B A B A
Additive operator splitting (3)
34 Segmentierung medizinischer Bilddaten Stefan Burkhardt
And we approximate the inverse matrix by
Therewith we obtain the equation
8.5 Numerical implementations
( ) ( ) [ ]
1
1
1
1
1
1

=

=


(


m
l
i
m
l
i
l
m
m
u A I u A I
Additive operator splitting (4)
( ) [ ]
i
m
l
i i
m
m
u u A I u
1
1
1
1
1

=
+

=
35 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Differences and improvements
A split in the operator for each spatial direction has been
performed
The pixels can be arranged for each operator separately
As result each operator is tri-diagonal matrix and is
inverted separately.
Such 3-diagonal matrices can be inverted in linear time
O(n), not in O(n
2
)
8.5 Numerical implementations
Additive operator splitting (5)
36 Segmentierung medizinischer Bilddaten Stefan Burkhardt
Features
Stable for <
Cost per iteratorion: low, but a little higher than for the
explicit scheme
Efficiency: high
8.5 Numerical implementations
Additive operator splitting (6)
37 Segmentierung medizinischer Bilddaten Stefan Burkhardt
8.5 Numerical implementations
high low < AOS
medium high < Semi-
implicit
low very low explicit
efficiency Cost per
iteration
Stability Scheme
Conclusion
m
h
2
2
<

S-ar putea să vă placă și