1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Bài giảng Chapter 6: Linear filters

70 23 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 70
Dung lượng 2,21 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The lecture presents the contents: Using a simpler operation to generate a higher order operation, Multiple summations, General formula, Doing the same with functions, Multiplication and addition of two functions, Operation that uses addition and multiplication...

Trang 1

Department of Mechatronics

Chapter 6 Linear Filters

Prof Fei Fei Li, Stanford University

Trang 2

2D Filter

Convolution

Linear Systems

Trang 3

Department of Mechatronics

Multiplication

Using a simpler operat ion to generate a higher

order operation

Mult iple summat ions

General form ula

Trang 4

Doing the same with functions

Applying the operations on

each value separated.

The result is a function.

Trang 5

Department of Mechatronics

Multiplication and addition of

two functions

Trang 6

Operation that uses addition and multiplication.

Result is a function.

It is a way to combine to functions.

It is like weighting one function with the other.

Flipping one function and then summing up the products for each positions for a given offset n.

( ) ( ) (n )

Trang 7

Department of Mechatronics

Flipping the function

Trang 8

Multiply and add

Trang 9

Department of Mechatronics

Multiply and add

Trang 10

Multiply and add

Trang 11

Department of Mechatronics

Multiply and add

Trang 12

Multiply and add

Trang 13

Department of Mechatronics

Multiply and add

Trang 14

Multiply and add

Trang 15

Department of Mechatronics

Multiply and add

Trang 16

Multiply and add

Trang 17

Department of Mechatronics

Result

Trang 18

Comparison

Trang 19

Department of Mechatronics

Continuous Convolution

• Summation becomes an integral

Trang 21

Department of Mechatronics

Filter

• Signal y(n) is a

convolution of u(n) with

the Transfer function

h(n)

• Filtering can be done by

the convolution of two signals

Trang 22

2D Filtering

A 2 D in 1 age f[i,j] can be fi l tered by a 2D kernel h[u,v] to

produce an output image g[i,j]

T hi s i s called a cross-correlation operation and written :

h i s called t l 1e " filter ", " kernel " or " mask ".

Trang 23

Department of Mechatronics

2D Filtering

Trang 24

Example finding edges

Differentiating to find the steep parts of t he picture

Trang 25

Department of Mechatronics

Example Simple NoiseReduct i on

Cutting of the high frequency noise by low pass

filtering with the sine like kernel

For not changing the aspect of the image the sum

of the kernel must be 1

1/13

Trang 26

Images asfunctions

• An Image as a function f from R 2 to R M :

f( x,y) gives the intensity at position ( x, y )

 Defined over a rectangle, with a finite range:

Domanin Support range :[ , ]x[ , ] [0, 255]

f a b c d

Trang 27

Department of Mechatronics

Images asfunctions

A color imag e :

• An Image as a function f from R 2 to R M :

f( x,y) gives the intensity at position ( x, y )

 Defined over a rectangle, with a finite range:

Domanin Support range

:[ , ]x[ , ] [0, 255]

f a b c d

( , ) ( , ) ( , )

Trang 28

Images as discrete functions

Images are usually digital (discrete):

- Sample the 20 space on a regular grid

Represented as a matrix of integer values

Trang 29

Department of Mechatronics

Images as discrete functions

Cartesian coordinates

Trang 30

Images as discrete functions

Trang 31

Department of Mechatronics

Systems and Filters

• Filtering:

original pixel values

Goals:

• Extract useful information from the images

 Features (edges, corners, blobs )

Super-resolution ; in-pain t ing ; de-noising

Trang 32

De -noi s i ng

Ori g in a l S a lt and p e pp e r n o i se

Super -re s olut i on

In-painting

Trang 33

Department of Mechatronics

2D discrete- space systems (filters)

Trang 34

Filter

Trang 35

Department of Mechatronics

Moving average

Trang 36

Moving average

Trang 37

Department of Mechatronics

Moving average

Trang 38

Moving average

Trang 39

Department of Mechatronics

Moving average

Trang 40

Moving average

Trang 41

Department of Mechatronics

Moving average

• Replaces each pi x el w it h an

• Achie v e smoothing effect

Trang 42

Moving average

Trang 43

Department of Mechatronics

Shift-invariance

Trang 44

Is the moving avera ge system is shift inva riant?

Trang 45

Department of Mechatronics

Is the moving average system is shift invariant?

Trang 46

Linear Systems (filters)

• Linear filtering:

- Fo rm a new i m age whose p i xe l s are a we i ghted

su m of orig i na l p i xe l va l ues

- Use t h e same set of weig h ts at eac h poi n t

• S is a linear sys t em ( f unc t ion) i ff i t S satisfies

Trang 47

Department of Mechatronics

Linear Shift Invariant System - LSI

Trang 48

The Dirac delta function as the limit (in the sense

of distributions) of the sequence of Gaussians

Kronecker delta

Trang 49

Department of Mechatronics

LSI (linear shift invariant ) Systems

Impulse response

Trang 50

Example: i mpu l se response of t h e 3 by 3 mov i ng

ave r age fi lte r :

LSI (linear shift invariant ) Systems

Trang 51

Department of Mechatronics

An LSI system is completely specified by its impulse

response.

LSI (linear shift invariant ) Systems

sift i ng property of the de l ta f unction

Trang 52

Discrete convolution

• Fold h[n,m] about or igin to form h[-k,-l]

• Shift the folded results by n,m to form h[n - k,m - I]

• Multiply h[n - k,m - I] by f[k,I]

• Sum over all k,I

• Repeat for every n, m

Trang 53

Department of Mechatronics

Discrete convolution

• Fold h[n,m] about or igin to form h[-k,-l]

• Shift the folded results by n,m to form h[n - k,m - I]

• Multiply h[n - k,m - I] by f[k,I]

• Sum over all k,I

• Repeat for every n, m

Trang 54

Discrete convolution

• Fold h[n,m] about or igin to form h[-k,-l]

• Shift the folded results by n,m to form h[n - k,m - I]

• Multiply h[n - k,m - I] by f[k,I]

• Sum over all k,I

• Repeat for every n, m

Trang 55

Department of Mechatronics

Convolution in 2D - Examples

Original

Trang 56

Original Filtered

Convolution in 2D - Examples

Trang 57

Department of Mechatronics

Original

Convolution in 2D - Examples

Trang 58

Origina l S hifted l eft

Convolution in 2D - Examples

Trang 59

Department of Mechatronics

Origin al

Convolution in 2D - Examples

Trang 60

Convolution in 2D - Examples

Trang 61

Department of Mechatronics

Original

Convolution in 2D - Examples

Trang 62

Convolution in 2D – Sharpening Filter

Or ig in al

Trang 63

Department of Mechatronics

Trang 65

Department of Mechatronics

Image support and edge effect

• A computer w ill only c onvolv e finite support signals.

ngula r region

fi ni t e support signa Is.

Trang 66

• A computer will only convolve finite support signals.

• What happens at the edge?

Image support and edge effect

Trang 67

Department of Mechatronics

Zero-Padding

Boundary Padding Options

See the reference page for imfilter for details.

Replicated Boundary Pixels

Trang 68

Cross correlation

Trang 69

Department of Mechatronics

Matlab: filter2 imfilter Matlab: conv2

Trang 70

Filtering: Boundary Issues

• What is the size of the output?

• MATLAB: filter2(g,f,shape)

– shape = ‘full’: output size is sum of sizes of f and g

– shape = ‘same’: output size is same as f

– shape = ‘valid’: output size is difference of sizes of f and g

valid

g g

g g

Ngày đăng: 13/01/2020, 01:39