Can we do something cool with edges already? S. Avidan and A. Shamir - - PowerPoint PPT Presentation

can we do something cool with edges already s avidan and
SMART_READER_LITE
LIVE PREVIEW

Can we do something cool with edges already? S. Avidan and A. Shamir - - PowerPoint PPT Presentation

Can we do something cool with edges already? S. Avidan and A. Shamir Seam Carving for Content-Aware Image Resizing SIGGRAPH 2007 Paper: http://www.win.tue.nl/~wstahw/edu/2IV05/seamcarving.pdf Sanja Fidler CSC420: Intro to Image Understanding 1


slide-1
SLIDE 1

Can we do something cool with edges already?

  • S. Avidan and A. Shamir

Seam Carving for Content-Aware Image Resizing SIGGRAPH 2007

Paper: http://www.win.tue.nl/~wstahw/edu/2IV05/seamcarving.pdf Sanja Fidler CSC420: Intro to Image Understanding 1 / 27

slide-2
SLIDE 2

Simple Application: Seam Carving

Content-aware resizing Find path from top to bottom row with minimum gradient energy Remove (or replicate) those pixels

Sanja Fidler CSC420: Intro to Image Understanding 2 / 27

slide-3
SLIDE 3

Simple Application: Seam Carving

Content-aware resizing Find path from top to bottom row with minimum gradient energy

Sanja Fidler CSC420: Intro to Image Understanding 2 / 27

slide-4
SLIDE 4

Simple Application: Seam Carving

Content-aware resizing

Sanja Fidler CSC420: Intro to Image Understanding 2 / 27

slide-5
SLIDE 5

Seam Carving

A vertical seam s is a list of column indices, one for each row, where each subsequent column differs by no more than one slot. Let G denote the image gradient magnitude. Optimal 8-connected path: s∗ = argminsE(s) = argmins

n

  • i=1

G(si) Can be computed via dynamic programming Compute the cumulative minimum energy for all possible connected seams at each entry (i, j): M(i, j) = G(i, j) + min (M(i − 1, j − 1), M(i − 1, j), M(i − 1, j + 1)) Backtrack from min value in last row of M to pull out optimal seam path. [Source: K. Grauman]

Sanja Fidler CSC420: Intro to Image Understanding 3 / 27

slide-6
SLIDE 6

Seam Carving – Examples

Implement seam carving for 5% extra credit on first assignment

Sanja Fidler CSC420: Intro to Image Understanding 4 / 27

slide-7
SLIDE 7

Image Pyramids

Sanja Fidler CSC420: Intro to Image Understanding 5 / 27

slide-8
SLIDE 8

Finding Waldo

Let’s revisit the problem of finding Waldo This time he is on the road image template (filter)

Sanja Fidler CSC420: Intro to Image Understanding 6 / 27

slide-9
SLIDE 9

Finding Waldo

He comes closer but our filter doesn’t know that How can we find Waldo? image template (filter)

Sanja Fidler CSC420: Intro to Image Understanding 7 / 27

slide-10
SLIDE 10

Idea: Re-size Image

Re-scale the image multiple times! Do correlation on every size! template (filter)

Sanja Fidler CSC420: Intro to Image Understanding 8 / 27

slide-11
SLIDE 11

Sanja Fidler CSC420: Intro to Image Understanding 9 / 27

slide-12
SLIDE 12

This image is huge. How can we make it smaller?

Sanja Fidler CSC420: Intro to Image Understanding 9 / 27

slide-13
SLIDE 13

Image Sub-Sampling

Idea: Throw away every other row and column to create a 1/2 size image

1/4 1/8

[Source: S. Seitz]

Sanja Fidler CSC420: Intro to Image Understanding 10 / 27

slide-14
SLIDE 14

Image Sub-Sampling

Why does this look so crufty?

!"#$$%&'$())*+$ !",$$%#'$())*+$ !"&$

[Source: S. Seitz]

Sanja Fidler CSC420: Intro to Image Understanding 11 / 27

slide-15
SLIDE 15

Image Sub-Sampling

[Source: F. Durand]

Sanja Fidler CSC420: Intro to Image Understanding 12 / 27

slide-16
SLIDE 16

Even worse for synthetic images

I want to resize my image by factor 2 And I take every other column and every other row (1st, 3rd, 5th, etc) Figure: Dashed line denotes the border of the image (it’s not part of the image)

Sanja Fidler CSC420: Intro to Image Understanding 13 / 27

slide-17
SLIDE 17

Even worse for synthetic images

I want to resize my image by factor 2 And I take every other column and every other row (1st, 3rd, 5th, etc) Where is the rectangle! Figure: Dashed line denotes the border of the image (it’s not part of the image)

Sanja Fidler CSC420: Intro to Image Understanding 13 / 27

slide-18
SLIDE 18

Even worse for synthetic images

What’s in the image? Now I want to resize my image by half in the width direction And I take every other column (1st, 3rd, 5th, etc)

Sanja Fidler CSC420: Intro to Image Understanding 14 / 27

slide-19
SLIDE 19

Even worse for synthetic images

What’s in the image? Now I want to resize my image by half in the width direction And I take every other column (1st, 3rd, 5th, etc)

Sanja Fidler CSC420: Intro to Image Understanding 14 / 27

slide-20
SLIDE 20

Even worse for synthetic images

What’s in the image? Now I want to resize my image by half in the width direction And I take every other column (1st, 3rd, 5th, etc) Where is the chicken!

Sanja Fidler CSC420: Intro to Image Understanding 14 / 27

slide-21
SLIDE 21

Even worse for synthetic images

What’s happening? [Source: L. Zhang]

Sanja Fidler CSC420: Intro to Image Understanding 15 / 27

slide-22
SLIDE 22

Aliasing

Occurs when your sampling rate is not high enough to capture the amount

  • f detail in your image

To do sampling right, need to understand the structure of your signal/image [Source: R. Urtasun]

Sanja Fidler CSC420: Intro to Image Understanding 16 / 27

slide-23
SLIDE 23

Aliasing

Occurs when your sampling rate is not high enough to capture the amount

  • f detail in your image

To do sampling right, need to understand the structure of your signal/image The minimum sampling rate is called the Nyquist rate [Source: R. Urtasun]

Sanja Fidler CSC420: Intro to Image Understanding 16 / 27

slide-24
SLIDE 24

Aliasing

Occurs when your sampling rate is not high enough to capture the amount

  • f detail in your image

To do sampling right, need to understand the structure of your signal/image The minimum sampling rate is called the Nyquist rate [Source: R. Urtasun]

Sanja Fidler CSC420: Intro to Image Understanding 16 / 27

slide-25
SLIDE 25
  • Mr. Nyquist

Harry Nyquist says that one should look at the frequencies of the signal. One should find the highest frequency (via Fourier Transform) To sample properly you need to sample with at least twice that frequency For those interested: http://en.wikipedia.org/wiki/Nyquist%E2%80% 93Shannon_sampling_theorem He looks like a smart guy, we’ll just believe him

Sanja Fidler CSC420: Intro to Image Understanding 17 / 27

slide-26
SLIDE 26

2D example

Good sampling Bad sampling

[Source: N. Snavely]

Sanja Fidler CSC420: Intro to Image Understanding 18 / 27

slide-27
SLIDE 27

Going back to Downsampling ...

When downsampling by a factor of two, the original image has frequencies that are too high High frequencies are caused by sharp edges How can we fix this? [Adopted from: R. Urtasun]

Sanja Fidler CSC420: Intro to Image Understanding 19 / 27

slide-28
SLIDE 28

Going back to Downsampling ...

When downsampling by a factor of two, the original image has frequencies that are too high High frequencies are caused by sharp edges How can we fix this? [Adopted from: R. Urtasun]

Sanja Fidler CSC420: Intro to Image Understanding 19 / 27

slide-29
SLIDE 29

Gaussian pre-filtering

Solution: Blur the image via Gaussian, then subsample. Very simple!

!"#$%

!"###$# &%

'#!'()*"+% !"#$% '#!'()*"+% ,%

!%# !%###$# &%

!&#

!"#

[Source: N. Snavely]

Sanja Fidler CSC420: Intro to Image Understanding 20 / 27

slide-30
SLIDE 30

Subsampling with Gaussian pre-filtering

G 1/4 G 1/8 Gaussian 1/2

[Source: S. Seitz]

Sanja Fidler CSC420: Intro to Image Understanding 21 / 27

slide-31
SLIDE 31

Compare with ...

1/4 (2x zoom) 1/8 (4x zoom) 1/2

[Source: S. Seitz]

Sanja Fidler CSC420: Intro to Image Understanding 22 / 27

slide-32
SLIDE 32

Where is the Rectangle?

My image Figure: Dashed line denotes the border of the image (it’s not part of the image)

Sanja Fidler CSC420: Intro to Image Understanding 23 / 27

slide-33
SLIDE 33

Where is the Rectangle?

My image Let’s blur Figure: Dashed line denotes the border of the image (it’s not part of the image)

Sanja Fidler CSC420: Intro to Image Understanding 23 / 27

slide-34
SLIDE 34

Where is the Rectangle?

My image Let’s blur And now take every other row and column Figure: Dashed line denotes the border of the image (it’s not part of the image)

Sanja Fidler CSC420: Intro to Image Understanding 23 / 27

slide-35
SLIDE 35

Where is the Chicken?

My image

Sanja Fidler CSC420: Intro to Image Understanding 24 / 27

slide-36
SLIDE 36

Where is the Chicken?

My image Let’s blur

Sanja Fidler CSC420: Intro to Image Understanding 24 / 27

slide-37
SLIDE 37

Where is the Chicken?

My image Let’s blur And now take every other column

Sanja Fidler CSC420: Intro to Image Understanding 24 / 27

slide-38
SLIDE 38

Gaussian Pyramids [Burt and Adelson, 1983]

A sequence of images created with Gaussian blurring and downsampling is called a Gaussian Pyramid In computer graphics, a mip map [Williams, 1983] How much space does a Gaussian pyramid take compared to original image? [Source: S. Seitz]

Sanja Fidler CSC420: Intro to Image Understanding 25 / 27

slide-39
SLIDE 39

Gaussian Pyramids [Burt and Adelson, 1983]

A sequence of images created with Gaussian blurring and downsampling is called a Gaussian Pyramid In computer graphics, a mip map [Williams, 1983] How much space does a Gaussian pyramid take compared to original image? [Source: S. Seitz]

Sanja Fidler CSC420: Intro to Image Understanding 25 / 27

slide-40
SLIDE 40

Example of Gaussian Pyramid

[Source: N. Snavely]

Sanja Fidler CSC420: Intro to Image Understanding 26 / 27

slide-41
SLIDE 41

Summary – Stuff You Should Know

To down-scale an image: blur it with a small Gaussian (e.g., σ = 1.4) and downsample To up-scale an image: interpolation (we won’t cover this in class) Gaussian pyramid: Blur with Gaussian filter, downsample result by factor 2, blur it with the Gaussian, downsample by 2...

Matlab functions:

fspecial: creates a Gaussian filter with specified σ imfilter: convolve image with the filter I(1:2:end, 1:2:end): takes every second row and column imresize: Matlab’s function for resizing the image

Sanja Fidler CSC420: Intro to Image Understanding 27 / 27