/
Images and Filters CSE 455 Images and Filters CSE 455

Images and Filters CSE 455 - PowerPoint Presentation

greemeet
greemeet . @greemeet
Follow
351 views
Uploaded On 2020-06-15

Images and Filters CSE 455 - PPT Presentation

Ali Farhadi Many slides from Steve Seitz and Larry Zitnick What is an image F Image Operations functions of functions F Image Operations functions of functions ID: 778185

image filters filter gaussian filters image gaussian filter functions seitz original lowe 013 linear smoothing source practice credit filtering

Share:

Link:

Embed:

Download Presentation from below link

Download The PPT/PDF document "Images and Filters CSE 455" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Images and Filters

CSE 455Ali Farhadi

Many slides from Steve Seitz and Larry

Zitnick

Slide2

What is an image?

Slide3

Slide4

Slide5

F

( ) =

Image Operations

(functions of functions)

Slide6

F

( ) =

Image Operations

(functions of functions)

Slide7

F

( ) =

Image Operations

(functions of functions)

0.1

0

0.8

0.9

0.9

0.9

0.2

0.40.30.6000.10.50.90.90.20.40.30.6000.10.90.90.20.40.30.6000.10.5

Slide8

F

( , ) =

Image Operations

(functions of functions)

0.23

Slide9

Local image functions

F

( ) =

Slide10

0

0

0

0

0

0

0

0

0

0

0

0000000000009090909090000009090909090000009090909090000009009090900

0

0

0

0

90

90

90

90

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

00000000000000909090909000000909090909000000909090909000000900909090000009090909090000000000000009000000000000000000

Credit: S. Seitz

Image filtering

1

1

1

1

1

1

1

1

1

Slide11

0

0

0

0

0

0

0

0

0

0

0

0000000000009090909090000009090909090000009090909090000009009090900

0

0

0

0

90

90

90

90

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

10

0

0

0

0

0

0

0

0

000000000000000909090909000000909090909000000909090909000000900909090000009090909090000000000000009000000000000000000

Image filtering

1

1

1

1

1

1

1

1

1

Credit: S. Seitz

Slide12

0

0

0

0

0

0

0

0

0

0

0

0000000000009090909090000009090909090000009090909090000009009090900

0

0

0

0

90

90

90

90

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

10

20

0

0

0

0

0

0

0

0000000000000000909090909000000909090909000000909090909000000900909090000009090909090000000000000009000000000000000000

Image filtering

1

1

1

1

1

1

1

1

1

Credit: S. Seitz

Slide13

0

0

0

0

0

0

0

0

0

0

0

0000000000009090909090000009090909090000009090909090000009009090900

0

0

0

0

90

90

90

90

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

10

20

30

0

0

0

0

0

0

00000000000000000909090909000000909090909000000909090909000000900909090000009090909090000000000000009000000000000000000

Image filtering

1

1

1

1

1

1

1

1

1

Credit: S. Seitz

Slide14

0

10

20

30

30

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

0

90

909000000909090909000000000000000900000000000000000

0

Image filtering111111111Credit: S. Seitz

Slide15

0

10

20

30

30

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

0

90

909000000909090909000000000000000900000000000000000

0

Image filtering111111111Credit: S. Seitz?

Slide16

0

10

20

30

30

50

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

90

90

90

90

0

0

0

0

0

90

0

90909000000909090909000000000000000900000000000000000

0

Image filtering111111111Credit: S. Seitz?

Slide17

0

0

0

0

0

0

0

0

0

0

0

0000000000009090909090000009090909090000009090909090000009009090900

0

0

0

0

90

90

90

90

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

90

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

10

20

30

30

30

20

10

020406060604020030609090906030030508080906030030508080906030020305050604020102030303030201010101000000

Image filtering

111111111Credit: S. Seitz

Slide18

What does it do?

Replaces each pixel with an average of its neighborhood

Achieve smoothing effect (remove sharp features)

1

1

1

1

1

1

1

1

1Slide credit: David Lowe (UBC)Box Filter

Slide19

Smoothing with box filter

Slide20

Practice with linear filters

0

0

0

0

1

0

0

0

0

Original

?Source: D. Lowe

Slide21

Practice with linear filters

0

0

0

0

1

0

0

0

0

Original

Filtered (no change)Source: D. Lowe

Slide22

Practice with linear filters

0

0

0

1

0

0

0

0

0

Original

?Source: D. Lowe

Slide23

Practice with linear filters

0

0

0

1

0

0

0

0

0

Original

Shifted leftBy 1 pixelSource: D. Lowe

Slide24

Practice with linear filters

Original

1

1

1

1

1

1

1

1

1

000020000-?Source: D. Lowe

Slide25

Practice with linear filters

Original

1

1

1

1

1

1

1

1

1

000020000-Sharpening filter Accentuates differences with local averageSource: D. Lowe

Slide26

Sharpening

Source: D. Lowe

Slide27

Other filters

-1

0

1

-2

0

2

-1

0

1

Vertical Edge

(absolute value)Sobel

Slide28

Other filters

-1

-2

-1

0

0

0

1

2

1

Horizontal Edge

(absolute value)Sobel

Slide29

Basic gradient filters

0

0

0

1

0

-1

0

0

0

0

-1000001010-1orHorizontal GradientVertical Gradient10-1or

Slide30

Gaussian filter

*

=

Input image

f

Filter

h

Output image

g

Compute empirically

Slide31

Gaussian vs. mean filters

What does real blur look like?

Slide32

Spatially-weighted average

0.003 0.013 0.022 0.013 0.003

0.013 0.059 0.097 0.059 0.013

0.022 0.097 0.159 0.097 0.022

0.013 0.059 0.097 0.059 0.013

0.003 0.013 0.022 0.013 0.003

5 x 5,  = 1

Slide credit: Christopher Rasmussen

Important filter: Gaussian

Slide33

Smoothing with Gaussian filter

Slide34

Smoothing with box filter

Slide35

Gaussian filters

What parameters matter here?

Variance

of Gaussian: determines extent of smoothing

Source: K.

Grauman

Slide36

Smoothing with a Gaussian

Parameter

σ

is the “scale” / “width” / “spread” of the Gaussian kernel, and controls the amount of smoothing.

Source: K.

Grauman

Slide37

First and second derivatives

*

=

Slide38

First and second derivatives

Original

First Derivative x

Second Derivative x, y

What are these good for?

Slide39

Subtracting filters

Original

Second Derivative

Sharpened

Slide40

for some

Combining filters

*

*

0

0

0

0

0

0

0

0000-101000000000000000000-1000-14-1000-10000000==It’s also true:

Slide41

Combining Gaussian filters

More blur than either individually (but less than )

*

=

?

Slide42

Separable filters

*

=

Compute Gaussian in horizontal direction, followed by the vertical direction.

Not all filters are separable.

Freeman and

Adelson

, 1991

Much faster!

Slide43

Sums of rectangular regions

243

239

240

225

206

185

188

218

211

206

21622524223921811067313415221320620822124324212358948213277108208208215235217115212243236247139912092082112332081312222192261961147420821321423221713111677150695652201228223232232182186184179159123

93

232

235

235

232

236

201

154

216

133

129

81

175

252

241

240

235

238

230

128

172

138

65

63

234

249

241

245

237

236

247

143

59

78

10

94

255

248

247

251

234

237

245

193

55

33

115

144

213255253251248245161

128149109138654715623925519010739102947311458177511372332331481682031794327171281726121602552551092226193524How do we compute the sum of the pixels in the red box?After some pre-computation, this can be done in constant time for any box.This “trick” is commonly used for computing Haar wavelets (a fundemental building block of many object recognition approaches.)

Slide44

Sums of rectangular regions

The trick is to compute an “integral image.” Every pixel is the sum of its neighbors to the upper left.

Sequentially compute using:

Slide45

Sums of rectangular regions

A

B

C

D

Solution is found using:

A + D – B - C

Slide46

Linear vs. Non-Linear Filters

Gaussian and Median Filters

Slide47

Spatially varying filters

Some filters vary spatially.

Useful for

deblurring

.

Durand, 02

Slide48

*

*

*

input

output

Same Gaussian kernel everywhere.

Slides courtesy of

Sylvian

Paris

Constant blur

Slide49

*

*

*

input

output

The kernel shape depends on the image content.

Slides courtesy of

Sylvian

Paris

Bilateral filter

Maintains edges when blurring!

Slide50

Borders

What to do about image borders:

black

fixed

periodic

reflected