+ All Categories
Home > Documents > 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer...

60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer...

Date post: 25-Dec-2015
Category:
Upload: everett-stanley
View: 218 times
Download: 2 times
Share this document with a friend
Popular Tags:
46
60-520 Presentation Image Filters Student : Xiaoliu Chen Instruc tor: Dr. I. Ahmad School of Computer Science University of Windsor November 2003
Transcript
Page 1: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

60-520 Presentation

Image Filters

Student: Xiaoliu ChenInstructor: Dr. I. Ahmad

School of Computer ScienceUniversity of Windsor

November 2003

Page 2: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 2

Outline

Introduction Spatial Filtering

– Smoothing– Sharpening

Frequency-Domain Filtering– Low pass– High pass

Summary

Page 3: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 3

Introduction

Filtering is the process of replacing a pixel with a value based on some operations or functions.

The operations/functions used on the original image are called filters.

– or masks, kernels, templates, windows…

Page 4: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 4

Introduction

In digital image processing, filters are usually used to

– suppress the high frequencies in an image• i.e., smoothing the image

– suppress the low frequencies in an image• i.e., enhancing or detecting edges in the image

Page 5: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 5

Introduction

Image filters fall into two categories:

– Spatial domain• Filters are based on direct manipulation of

pixels on an image plane.

– Frequency domain• Filters are based on modifying the Fourier

transform (FT) of an image.

Page 6: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 6

Spatial Filters

The general processes can be denoted by the expression:

– f(x,y) is the input image– g(x,y) is the processed image– T is an operator on f, defined over some

neighborhood of (x,y)

)],([),( yxfTyxg

Page 7: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 7

The principal approach in defining a neighborhood about a point (x,y)

– use a subimage area centered at (x,y)

– shapes of the neighborhood• circle• square• rectangular

Spatial Filters

Page 8: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 8

Example: 3×3 neighborhood about a point (x,y) in an image

x

(x,y)

Image f(x,y)(x+1,y+1)(x,y+1)(x-1,y+1)

(x+1,y)(x,y)(x-1,y)

(x+1,y-1)(x,y-1)(x-1,y-1)

y

Spatial Filters

Page 9: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 9Pixels under mask

Image f(x,y)

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

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

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

w(1,1)w(0,1)w(-1,1)

w(1,0)w(0,0)w(-1,0)

w(1,-1)w(0,-1)w(-1,-1)Mask

Mask coefficients

x

y

Page 10: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 10

Spatial Filters – linear filters

For linear spatial filtering, the result, R, at a point (x,y) is

R=w(-1,-1)f(x-1,y-1) + w(0,-1)f(x,y-1) +

…+ w(0,0)f(x,y) +…

+ w(0,1)f(x,y+1) + w(1,1)f(x+1,y+1)

Page 11: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 11

Spatial Filters – convolution

In general, linear filtering of an image is given by the expression:

– The image f is of size M×N

– The filter mask is of size m×n

m=2a+1, n=2b+1

a

as

b

bt

tysxftswyxg ),(),(),(

Page 12: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 12

Spatial Filters – smoothing

Smoothing filters are used for blurring and for noise reduction.

Smoothing, linear spatial filter

– average filters– reduce “sharp” transitions– side effect

Page 13: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 13

Spatial Filters – smoothing, linear

Mean filters– example: 111

111

111

9

1

OriginalGaussian noise 3×3 mean filter 5×5 mean filter

Page 14: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 14

Spatial Filters – smoothing, linear

Mean filters– example: 111

111

111

9

1

Salt and pepper 3×3 mean filter 5×5 mean filter

Page 15: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 15

Spatial Filters – smoothing, linear

Weighted average filters– example:

– general expression: 121

242

121

16

1

a

as

b

bt

a

as

b

bt

tsw

tysxftswyxg

),(

),(),(),(

Page 16: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 16

Spatial Filters – smoothing, nonlinear

Order-statistic filters

– nonlinear spatial filters

– order/rank the pixels contained in the image area encompassed by the filter

Page 17: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 17

Spatial Filters – smoothing, nonlinear

Median filters– replace a pixel value with the median of its

neighboring pixel values– example:

23 25 26 30 40

22 24 26 27 35

18 20 50 25 34

19 15 19 23 33

11 16 10 20 30

Neighborhood values:15, 19, 20, 23,

24, 25, 26, 27, 50

Median value: 24

Page 18: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 18

Spatial Filters – smoothing, nonlinear

Median filters– have excellent noise-reduction capabilities

Gaussian noise removedby 3×3 mean filter

Gaussian noise removed By 3×3 median filter

V.S.

Page 19: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 19

Spatial Filters – smoothing, nonlinear

Median filters– are particularly effective in salt & pepper

Salt & pepper removedby 3×3 mean filter

Salt & pepper removed By 3×3 median filter

V.S.

Page 20: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 20

Spatial Filters – smoothing, nonlinear

Max filters– maximum of neighboring pixel values– useful for finding the brightest points in an

image

Min filters– minimum of neighboring pixel values– useful for finding the darkest points in an

image

Page 21: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 21

Spatial Filters – sharpening

Principal objective– highlight fine detail in an image– enhance detail that has been blurred

Sharpening can be accomplished by spatial differentiation

Page 22: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 22

Spatial Filters – sharpening

For one dimensional function f(x)– first order derivative

– second order derivative

)()1( xfxfx

f

)(2)1()1(2

2

xfxfxfx

f

Page 23: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 23

Spatial Filters – sharpening

– A sample

(a) a scan line (b) image strip

(c) first derivative (d) second derivative

7777000013100006000123455

0007000-1-221000-6600-1-1-1-1-1

00-770011-411006-126010000-1

(a)

(b)

(c)

(d)

Page 24: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 24

Spatial Filters – sharpening

The Laplacian– second derivative of a two dimensional

function f(x,y)

= [f(x+1,y)+f(x-1,y)+f(x,y+1)+f(x,y-1)]

-4f(x,y)

2

2

2

22

y

f

x

ff

Page 25: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 25

Spatial Filters – sharpening

The Laplacian– use a convolution mask to approximate

010

1-41

010

111

1-81

111

-12-1

2-42

-12-1

Page 26: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 26

Spatial Filters – sharpening

The Laplacian– example:

Page 27: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 27

Spatial Filters – sharpening

The Laplacian– example:

Page 28: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 28

Frequency Filters – Fourier transform

Fourier transform (FT)– decompose an image into its sine and

cosine components– transform real space images into Fourier or

frequency space images– In a frequency space image, each point

represents a particular frequency contained in the real domain image.

Page 29: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 29

Frequency Filters – Fourier transform

Discrete Fourier transform (DFT)

Inverse DFT

1

0

1

0

)//(2),(1

),(M

x

N

y

NvyMuxjeyxfMN

vuF

1

0

1

0

)//(2),(),(M

u

N

v

NvyMuxjevuFyxf

Page 30: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 30

Frequency Filters – Fourier transform

– example:

FT

(log)

Page 31: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 31

Basic steps for filtering in the frequency domain

Frequency Filters

Filterfunction

FilterfunctionDFTDFT Inverse

DFT

InverseDFT

f(x,y)Input image

g(x,y)Processed image

F(u,v) H(u,v)F(u,v)

Page 32: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 32

Frequencies in an image correspond to the rate of change in pixel values

– High frequencies• rapid changes of gray level values

– Low frequencies• slow changes of gray level values

Frequency Filters

Page 33: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 33

Lowpass filters– attenuate high frequencies while “passing”

low frequencies

Highpass filters– attenuate low frequencies while “passing”

high frequencies

Frequency Filters

Page 34: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 34

Ideal lowpass filters (ILPF)

Frequency Filters – lowpass filters

0

0

),( if0

),( if1),(

DvuD

DvuDvuH

Page 35: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 35

Butterworth lowpass filters (BLPF)

Frequency Filters – lowpass filters

nDvuDvuH

20 ]/),([1

1),(

Page 36: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 36

Gaussian lowpass filters (GLPF)

Frequency Filters – lowpass filters

22 2/),(),( vuDevuH

Page 37: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 37

Highpass filters

– Ideal higpass filters (IHPF)

– Butterworth highpass filters (BHPF)

– Gaussian highpass filters (GHPF)

Frequency Filters – highpass filters

),(1),( vuHvuH lphp

Page 38: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 38

Page 39: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 39

Bandpass filters– attenuate very low frequencies and very

high frequencies

– enhance edges while reducing the noise at the same time

Frequency Filters – bandpass filters

),(),( vuHvuHH lphpbp

Page 40: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 40

Frequency Filters

Original Gaussian noise ILPF withcut-off frequency of 1/3

ILPF withcut-off frequency of 1/2

BLPF withcut-off frequency of 1/3

BLPF withcut-off frequency of 1/2

Examples: (lowpass filters)

Page 41: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 41

Examples: (highpass filters)

Frequency Filters

Page 42: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 42

Frequency Filters

Relationship and comparison with spatial filters– spatial filtering

– frequency filtering

),(),(),( yxfyxhyxg

),(),( vuHyxh

),(),(),( vuFvuHvuG

Page 43: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 43

Frequency Filters

Comparison with spatial filters

– more computational efficient– more intuitive

Page 44: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 44

Summary

Filtering is the operation of applying a transform on an image in order to enhance it.

Filtering techniques can be subdivided into two types– Spatial domain filtering– Frequency domain filtering

Page 45: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 45

Summary

Filtering techniques are very useful in image analysis and processing– Noise removal– Edge detection

Page 46: 60-520 Presentation Image Filters Student:Xiaoliu Chen Instructor:Dr. I. Ahmad School of Computer Science University of Windsor November 2003.

Image Filters 46

The end

Thank you

&

Questions ?


Recommended