Medical Image Analysis CS 593 / 791 Computer Science and Electrical Engineering Dept. West Virginia University 23rd January 2006
Outline 1 Recap 2 Edge Enhancement 3 Experimental Results 4 The rest of the paper... 5 Anisotropic Diffusion
Outline 1 Recap 2 Edge Enhancement 3 Experimental Results 4 The rest of the paper... 5 Anisotropic Diffusion
Edge Enhancement Inhomogeneous diffusion may actually enhance edges, for a certain choice of g(). 1D example: Let s(x) = I x, and φ(s) = g(s)s = g(i x)i x. The 1D heat equation becomes I t = x (g(i x)i x ) = x φ(s) = φ (s)i xx t (I x) is the rate of change of edge slope with respect to time. t (I x) = x (I t) = φ (s)i 2 xx + φ (s)i xxx
Edge Enhancement t (I x) = φ (s)i 2 xx + φ (s)i xxx For a step edge with I x > 0 look at the inflection point, p. Observe that I xx (p) = 0, and I xxx (p) < 0. I, I x, I xx, I xxx t (I x)(p) = φ (s)i xxx (p) The sign of this quantity depends only on φ (s).
Edge Enhancement t (I x) = φ (s)i 2 xx + φ (s)i xxx For a step edge with I x > 0 look at the inflection point, p. Observe that I xx (p) = 0, and I xxx (p) < 0. I, I x, I xx, I xxx t (I x)(p) = φ (s)i xxx (p) The sign of this quantity depends only on φ (s).
Edge Enhancement At the inflection point: t (I x)(p) = φ (s)i xxx (p) If φ (s) > 0, then t (I x)(p) < 0 (slope is decreasing). If φ (s) < 0, then t (I x)(p) > 0 (slope is increasing). Since φ(s) = g(s)s, selecting the function g(s) determines which edges are smoothed and which are sharpened.
Outline 1 Recap 2 Edge Enhancement 3 Experimental Results 4 The rest of the paper... 5 Anisotropic Diffusion
The function φ(s) = g(s)s φ(0) = 0 φ (s) > 0 for s < K φ (s) < 0 for s > K lim s φ(s) 0
The function g(s) Perona and Malik suggest two possible functions (s = I ): I ( ) g( I ) = e K 2 g( I ) = 1 1 + ( I (α > 0) K )1+α
Effect of varying K on g() 1 g( I ) = 1 + ( I (α > 0) K )1+α Figure: K = 2, 4, 6
Effect of varying α on g() 1 g( I ) = 1 + ( I (α > 0) K )1+α Figure: α = 1, 3, 5, 7, 9
Effect of varying K and α on c() Figure: I and I.
Effect of varying K on c() Figure: K = 3, 5, 10, 100.
Effect of varying α on c() Figure: α = 1, 2, 3, 5.
Outline 1 Recap 2 Edge Enhancement 3 Experimental Results Discretized Inhomogeneous Heat Equation Perona-Malik Implementation Discrete Maximum Principle Adaptive Parameter Setting 4 The rest of the paper... 5 Anisotropic Diffusion
Discretized Inhomogeneous Heat Equation Explicit Formulation I t = c(x, y, t) 2 I + c I Using centered differences for the Laplacian and gradients: I t+1 x,y I t x,y λ = c x,y (I t x 1,y + It x+1,y + It x,y 1 + It x,y+1 4It x,y) + ( c x+1,y c x 1,y 2 + ( c x,y+1 c x,y 1 2 )( I x+1,y I x 1,y ) 2 )( I x,y+1 I x,y 1 ) 2
Discretized Inhomogeneous Heat Equation Implicit Formulation Same diagonal structure as homogeneous heat equation? Yes. Symmetric? No. Diagonal dominance? Data dependent.
Discretized Inhomogeneous Heat Equation Implicit Formulation Same diagonal structure as homogeneous heat equation? Yes. Symmetric? No. Diagonal dominance? Data dependent.
Discretized Inhomogeneous Heat Equation Implicit Formulation Same diagonal structure as homogeneous heat equation? Yes. Symmetric? No. Diagonal dominance? Data dependent.
Discretized Inhomogeneous Heat Equation Implicit Formulation Same diagonal structure as homogeneous heat equation? Yes. Symmetric? No. Diagonal dominance? Data dependent.
Perona-Malik Implementation Explicit Formulation I t = c(x, y, t) 2 I + c I By splitting the Laplacian and averaging the forward and backward differences in the gradient: I t+1 x,y I t x,y λ = c x,y [(I t x 1,y It x,y) + (I t x+1,y It x,y) + (I t x,y 1 It x,y) + (I t x,y+1 It x,y)] + c x (I x+1,y I x,y 2 + c y (I x,y+1 I x,y 2 + I x,y I x 1,y ) 2 + I x,y I x,y 1 ) 2
Perona-Malik Implementation Explicit Formulation I t = c(x, y, t) 2 I + c I I t+1 x,y I t x,y λ = (c x,y 1 c 2 x )(It x 1,y It x,y) + (c x,y + 1 c 2 x )(It x+1,y It x,y) + (c x,y 1 c 2 x )(It x,y 1 It x,y) + (c x,y + 1 c 2 x )(It x,y+1 It x,y)
Perona-Malik Implementation Explicit Formulation c x,y + 1 c 2 x c x,y 1 c 2 x c x+ 1 2,y c x 1 2,y c x+ 1 c x 1 Where s x,y = I(x, y). 2,y g( s x,y + s x+1,y ) 2 2,y g( s x,y + s x 1,y ) 2
Perona-Malik Implementation Explicit Formulation I t+1 x,y I t x,y λ = g( s x,y + s x 1,y )(Ix 1,y t 2 It x,y) + g( s x,y + s x+1,y )(Ix+1,y t 2 It x,y) + g( s x,y + s x,y 1 )(Ix,y 1 t 2 It x,y) + g( s x,y + s x,y+1 )(Ix,y+1 t 2 It x,y)
Perona-Malik Implementation Anisotropic Implementation Compute g() using the projection of the gradient along one direction. For example, in g( sx,y +s x+1,y 2 ), let s x,y = I (x, y) x s x+1,y = I (x + 1, y) x Computing s x,y using forward differences, and s x+1,y using backward differences s x,y = I x+1,y I x,y s x+1,y = I x+1,y I x,y, so g( sx,y +s x+1,y 2 ) = g( I(x + 1, y) I(x, y) ).
Perona-Malik Implementation Explicit Formulation I t+1 x,y I t x,y λ = g( I x 1,y I x,y )(I t x 1,y It x,y) + g( I x+1,y I x,y )(I t x+1,y It x,y) + g( I x,y 1 I x,y )(I t x,y 1 It x,y) + g( I x,y+1 I x,y )(I t x,y+1 It x,y) Notation: The authors use to denote finite differences. This is not the gradient operator ( ).
Perona-Malik Implementation N I i,j I i 1,j I i,j S I i,j I i+1,j I i,j E I i,j I i,j+1 I i,j W I i,j I i,j 1 I i,j Image neighborhood system c Ni,j = g( N I i,j ) c Si,j = g( S I i,j ) c Ei,j = g( E I i,j ) c Wi,j = g( W I i,j )
Perona-Malik Implementation Explicit Formulation The previous explicit formulation I t+1 x,y I t x,y λ = g( I x 1,y I x,y )(I t x 1,y It x,y) + g( I x+1,y I x,y )(I t x+1,y It x,y) + g( I x,y 1 I x,y )(I t x,y 1 It x,y) + g( I x,y+1 I x,y )(I t x,y+1 It x,y) can be rewritten as I t+1 x,y = I t x,y + λ(c Ni,j N I i,j + c Si,j S I i,j + c Ei,j E I i,j + c Wi,j W I i,j ) t
Discrete Maximum Principle Let I Mij = max(i, I N, I S, I E, I W ) Ix,y t+1 = Ix,y t + λ(c Ni,j N I i,j + c Si,j S I i,j + c Ei,j E I i,j + c Wi,j W I i,j ) Ix,y t+1 = Ix,y(1 t λ(c Ni,j + c Si,j + c Ei,j + c Wi,j )) + λ(c Ni,j I Ni,j + c Si,j I Si,j + c Ei,j I Ei,j + c Wi,j I Wi,j ) Since all c s and λ are positive and between 0,1: I t+1 x,y I t M ij (1 λ(c Ni,j + c Si,j + c Ei,j + c Wi,j )) + I t M ij (λ(c Ni,j + c Si,j + c Ei,j + c Wi,j )) = I t M ij
Discrete Maximum Principle Let I Mij = max(i, I N, I S, I E, I W ) Ix,y t+1 = Ix,y t + λ(c Ni,j N I i,j + c Si,j S I i,j + c Ei,j E I i,j + c Wi,j W I i,j ) Ix,y t+1 = Ix,y(1 t λ(c Ni,j + c Si,j + c Ei,j + c Wi,j )) + λ(c Ni,j I Ni,j + c Si,j I Si,j + c Ei,j I Ei,j + c Wi,j I Wi,j ) Since all c s and λ are positive and between 0,1: I t+1 x,y I t M ij (1 λ(c Ni,j + c Si,j + c Ei,j + c Wi,j )) + I t M ij (λ(c Ni,j + c Si,j + c Ei,j + c Wi,j )) = I t M ij
Adaptive Parameter Setting Set K every iteration Compute a histogram, f i, of I Find K such that 90% of the pixels have gradient magnitude < K. (If b i=1 f i 0.9n 2 then bin b corresponds to gradient magnitude K ).
Outline 1 Recap 2 Edge Enhancement 3 Experimental Results 4 The rest of the paper... 5 Anisotropic Diffusion
Edge Detection Due to Edge enhancement Edge localization edge detection algorithms will benefit from using this nonlinear diffusion process rather than using linear diffusion (Gaussian convolution).
Energy Minimization and Markov Random Field Models The anisotropic diffusion algorithm minimizes some energy function. Smoothness conditional dependence on nearest neighbors (Markovian property)
Outline 1 Recap 2 Edge Enhancement 3 Experimental Results 4 The rest of the paper... 5 Anisotropic Diffusion Introduction
Introduction The problem with inhomogeneous diffusion Noise on edges will not be reduced. Even with the anisotropic implementation of Perona-Malik, noise on diagonal edges will not be handled properly.
Introduction The problem with inhomogeneous diffusion The inhomogeneous heat equation I t = div(c(x, y, t) I) only controls the magnitude of intensity (or heat) flow. The anisotropic heat equation I t = div(d(x, y, t) I), where D(x, y, t) is a matrix-valued function, can also control the direction of intensity (or heat) flow.
Introduction Next: Wednesday: Susan Lemieux will continue the MRI acquisition lecture. Friday: Weickert A review of nonlinear diffusion filtering. The physical laws of heat flow and diffusion. Anisotropic diffusion filtering.