ece 468: digital image processing lecture...

40
ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic [email protected]

Upload: others

Post on 12-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

ECE 468: Digital Image Processing

Lecture 13

Prof. Sinisa Todorovic

[email protected]

Page 2: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Outline

• Image Restoration by Filtering (Textbook 5.3)

Page 3: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Image Restoration in the Frequency Domain

G(u, v) = H(u, v)F (u, v) + N(u, v)

F̂ (u, v) = G(u, v)HR(u, v)

Page 4: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Review

Var[cX] = c2Var[X]

Var[c + X] = Var[X]

E[c + X] = c + E[X]

E[cX] = cE[X]

Expected value

Variance

X random variable c deterministic constant

Page 5: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Review

Expected value

Variance

E[g(x, y)] = f(x, y) ⇤ h(x, y) + E[⌘(x, y)]

g(x, y) = f(x, y) ⇤ h(x, y) + ⌘(x, y)

Var[g(x, y)] = E[g(x, y)2]� E

2[g(x, y)]

corruptedimage

Var[g(x, y)] = Var[⌘(x, y)]

Page 6: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Gaussian Noise + Arithmetic vs. Geometric Mean Filter

g(x, y) = f(x, y) + �(x, y)

Sxy

filterwindow

inputoutput

arithmetic mean filtering

geometric mean filtering

f̂(x, y) =

⇤⇧

(s,t)�Sxy

g(s, t)

1mn

f̂(x, y) =1

mn

(s,t)�Sxy

g(s, t)

arithmetic mean geometric mean

Page 7: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Gaussian Noise + Arithmetic vs. Geometric Mean Filter

g(x, y) = f(x, y) + �(x, y)

Sxy

filterwindow

inputoutput

arithmetic mean filtering

geometric mean filtering

f̂(x, y) =

⇤⇧

(s,t)�Sxy

g(s, t)

1mn

f̂(x, y) =1

mn

(s,t)�Sxy

g(s, t)

arithmetic mean geometric mean

Page 8: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Salt-and-Pepper Noise + Median Filter

g(x, y) = f(x, y) + �(x, y)

Sxy

filterwindow

inputoutput

median filtering

f̂(x, y) = median(s,t)�Sxyg(s, t)

repeated application of median filter

Page 9: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Adaptive Filter

mSxy =1

mn

(s,t)�Sxy

g(s, t)

f̂(x, y) = g(x, y)��2

�2Sxy

�g(x, y)�mSxy

arithmetic mean

arithmetic variance �2

Sxy=

1mn

(s,t)�Sxy

(g(s, t)�mSxy )2

output of the filter

Page 10: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Gaussian Noise + Adaptive Filter

Properties:

• Zero-noise

• On edges

f̂(x, y) = g(x, y)��2

�2Sxy

�g(x, y)�mSxy

�2� = 0 � f̂(x, y) = g(x, y)

�2� � �2

Sxy� f̂(x, y) = g(x, y)

Page 11: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Adaptive Filter

f̂(x, y) = g(x, y)��2

�2Sxy

�g(x, y)�mSxy

= g(x, y) ⇤

0

@

2

40 0 00 1 00 0 0

3

5��

2⌘

2S

xy

2

40 0 00 1 00 0 0

3

5� 1mn

2

41 1 11 1 11 1 1

3

5

1

A

Page 12: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Gaussian Noise + Adaptive Filter

Page 13: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Degradation Modeling

Page 14: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Degradation Modeling

g(x, y) = h(x, y) ⇤ f(x, y) + �(x, y)

G(u, v) = H(u, v)F (u, v) + N(u, v)

Page 15: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Modeling Degradation Due to Atmospheric Turbulence

H(u, v) = e�k(u2+v2)5/6

Page 16: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Modeling Uniform Linear Motion Blur

Page 17: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Modeling Uniform Linear Motion Blur

g(x, y) =� T

0f(x� x0(t), y � y0(t))dt

T - duration of the exposure

blurred output:

Page 18: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Modeling Uniform Linear Motion Blur

g(x, y) =� T

0f(x� x0(t), y � y0(t))dt

T - duration of the exposure

blurred output:

G(u, v) = F (u, v)� T

0e�2j�[ux0(t)+vy0(t)]dt

Page 19: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Modeling Uniform Linear Motion Blur

g(x, y) =� T

0f(x� x0(t), y � y0(t))dt

T - duration of the exposure

blurred output:

G(u, v) = F (u, v)� T

0e�2j�[ux0(t)+vy0(t)]dt

� H(u, v) =� T

0e�2j�[ux0(t)+vy0(t)]dt

Page 20: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Modeling Uniform Linear Motion Blur

x0(t) =at

Ty0(t) =

bt

T

H(u, v) =� T

0e�2j�[ux0(t)+vy0(t)]dt

=T

�(ua + vb)sin[�(ua + vb)]e�j�(ua+ub)

Page 21: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Image Restoration

Page 22: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Image Restoration by Inverse Filtering

G(u, v) = H(u, v)F (u, v) + N(u, v)

F̂ (u, v) =G(u, v)H(u, v)

Page 23: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Image Restoration by Inverse Filtering

G(u, v) = H(u, v)F (u, v) + N(u, v)

Page 24: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Image Restoration by Inverse Filtering

F̂ (u, v) = F (u, v) +N(u, v)H(u, v)

G(u, v) = H(u, v)F (u, v) + N(u, v)

Page 25: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Inverse Filtering

Bad news:

• Even when H(u,v) is known, there is always unknown noise

• Often H(u,v) has values close to zero

F̂ (u, v) = F (u, v) +N(u, v)H(u, v)

Page 26: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Example: Inverse Filtering

H(u, v) = exp⇤�k

�(u�M/2)2 + (v �N/2)2

⇥5/6⌅

Atmospheric turbulence effect

Page 27: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Example: Inverse Filtering

G(u, v)H(u, v)

Page 28: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filtering = Mean Squared Error Filtering

• Incorporates both:

• Degradation function

• Statistical characteristics of noise

• Assumption: noise and the image are uncorrelated

• Optimizes the filter so that MSE is minimized

Page 29: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

Parseval’s Theorem

Unknown original

Corruptedoriginal

Wienerfilter

unknown original after Wiener filtering

Page 30: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

Parseval’s Theorem

Unknown original

Corruptedoriginal

Wienerfilter

unknown original after Wiener filtering

Page 31: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

Unknown original

Corruptedoriginal

Wienerfilter

Page 32: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

independent signals

Page 33: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

Page 34: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

Page 35: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

Page 36: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter — Derivation

inverse filter

Page 37: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Wiener Filter -- Approximation

Signal-to-noise ratio

Page 38: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Example: Wiener Filtering

Page 39: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Example: Wiener Filtering

Page 40: ECE 468: Digital Image Processing Lecture 13web.engr.oregonstate.edu/~sinisa/courses/OSU/ECE468/...ECE 468: Digital Image Processing Lecture 13 Prof. Sinisa Todorovic sinisa@eecs.oregonstate.edu

Next Class

• Image reconstruction from projections (Textbook 5.11)

• Radon Transform (Textbook 5.11.3)