Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise...

16
Noise Reduction Dr. Kaaren May Memorial University June 2012

Transcript of Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise...

Page 1: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Noise Reduction

Dr. Kaaren May Memorial University

June 2012

Page 2: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Example 1: Temporal Noise Reduction •  Suppose an image f(x,y) has been corrupted

by additive noise η(x,y):

•  Assume that at every pair of coordinates the noise is uncorrelated and has zero mean

•  If we have a series of noisy images of the same scene taken at different time instants, then by averaging these images together we can reduce the noise

2

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

Page 3: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Temporal Noise Reduction

•  Let

•  Then

•  And

•  Note that the assumption is that underlying scene is the same at each time instant

•  If there is any motion in the scene, then averaging frames introduces motion blur

3

g(x, y) = 1K

gii=1

K

! (x, y)

E{g(x, y)} = f (x, y)

! g (x,y)2 =

1K!"(x,y)2

Page 4: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Temporal Noise Reduction

4

•  Series of 5 images in low light on high ISO setting (3200)

•  Average the 5 images •  Assumes noise is zero mean and

uncorrelated

Page 5: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Noise in averaged frame is significantly reduced

Single input frame Temporal average

5

Page 6: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Spatial Domain Processing

•  The previous example showed how noise reduction can be accomplished via temporal filtering v  Taking the average of images recorded at different time instants

•  This assumes that the only difference between the input images is the noise that has been added to them

•  If there is any motion, this has to be taken into account before filtering

•  In most cases, need to rely on spatial rather than temporal filtering for noise removal

6

Page 7: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Neighborhood Operators

7

Origin

x

y

Image f

Spatial domain

(x,y)

3 x 3 neighborhood of (x,y)

Origin

x

y

Image f

Spatial domain

Neighborhood is moved from pixel to pixel to generate output image

Page 8: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

A neighborhood operator can be linear or nonlinear

Linear operators •  (Weighted) average •  Other linear spatial

filters:

Nonlinear operators •  Median •  Minimum •  Maximum •  Thresholding

8

g(x, y) = w(s, t) f (x + s, y+ t)t=!b

b

"s=!a

a

"

w(!1,0) w(!1,1)w(!1,!1)

w(0,!1) w(0, 0) w(0,1)

w(1,!1) w(1, 0) w(1,1)

f (x !1, y) f (x !1, y+1)f (x !1, y!1)

f (x, y!1) f (x, y) f (x, y+1)

f (x +1, y!1) f (x +1, y) f (x +1, y+1)

g(x, y)

Page 9: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

What distinguishes linear from nonlinear operators?

9

•  Consider a general operator H that takes input image f(x,y) and produces output g(x,y)

•  H is a linear operator if H f (x, y)[ ] = g(x, y)

H a1 f1(x, y)+ a2 f2 (x, y)[ ] = a1H f1(x, y)[ ]+ a2H f2 (x, y)[ ]= a1g1(x, y)+ a2g2 (x, y)

Page 10: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Example 2: Spatial Noise Reduction

10

RGB = imread(filename); I = rgb2gray(RGB);

Page 11: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

7 x 7 Box Filter (Linear)

11

h = ones(7)/49; A = imfilter(I, h, 'replicate');

Page 12: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

7 x 7 Gaussian Filter (Linear)

12

hsize = 7; sigma = 1.5; h = fspecial('gaussian',hsize,sigma); C = imfilter(I, h, 'replicate');

Page 13: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

7 x 7 Median Filter (Nonlinear)

13 B = medfilt2(I, [7 7], 'symmetric');

Page 14: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Smoothing/Filtering

•  Course notes and demo of salt and pepper noise removal

14

Page 15: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Median Filtering

•  Course notes, example plus demo

15

Page 16: Noise Reduction Dr. Kaaren May Memorial University › ~kmay › Courses › ENG7854 › Noise Reduction.pdf · Temporal Noise Reduction • Let • Then • And • Note that the

Course Notes

•  See http://www.engr.mun.ca/~kmay/courses.html

16