Fixing the Gaussian Blur: the Bilateral Filter Sylvain Paris MIT - - PowerPoint PPT Presentation

fixing the gaussian blur the bilateral filter
SMART_READER_LITE
LIVE PREVIEW

Fixing the Gaussian Blur: the Bilateral Filter Sylvain Paris MIT - - PowerPoint PPT Presentation

A Gentle Introduction A Gentle Introduction to Bilateral Filtering to Bilateral Filtering and its Applications and its Applications Fixing the Gaussian Blur: the Bilateral Filter Sylvain Paris MIT CSAIL Blur Comes from Blur Comes


slide-1
SLIDE 1

A Gentle Introduction to Bilateral Filtering and its Applications A Gentle Introduction to Bilateral Filtering and its Applications

“Fixing the Gaussian Blur”: the Bilateral Filter

Sylvain Paris – MIT CSAIL

slide-2
SLIDE 2

Blur Comes from Averaging across Edges Blur Comes from Averaging across Edges

* * *

input

  • utput

Same Gaussian kernel everywhere.

slide-3
SLIDE 3

Bilateral Filter No Averaging across Edges Bilateral Filter No Averaging across Edges

* * *

input

  • utput

The kernel shape depends on the image content.

[Aurich 95, Smith 97, Tomasi 98]

slide-4
SLIDE 4

space weight

not new

range weight

I new

normalization factor

new

Bilateral Filter Definition: an Additional Edge Term Bilateral Filter Definition: an Additional Edge Term

( )

( )

− − I I G G

q p

q p | | || ||

r s

σ σ

=

S

W

q p

1 I I BF

q p

] [

Same idea: weighted average of pixels.

slide-5
SLIDE 5

Illustration a 1D Image Illustration a 1D Image

  • 1D image = line of pixels
  • Better visualized as a plot

pixel intensity pixel position

slide-6
SLIDE 6

space

Gaussian Blur and Bilateral Filter Gaussian Blur and Bilateral Filter

space range normalization

Gaussian blur ( )

( )

− − =

S

I I I G G W I BF

q q q p p p

q p | | || || 1 ] [

r s

σ σ

Bilateral filter

[Aurich 95, Smith 97, Tomasi 98] space space range p p q q

( )

− =

S

I G I GB

q q p

q p || || ] [

σ

slide-7
SLIDE 7

q q p p

Bilateral Filter on a Height Field Bilateral Filter on a Height Field

  • utput

input

( )

( )

− − =

S

I I I G G W I BF

q q q p p p

q p | | || || 1 ] [

r s

σ σ

p p

reproduced from [Durand 02]

slide-8
SLIDE 8

Space and Range Parameters Space and Range Parameters

  • space σs : spatial extent of the kernel, size of

the considered neighborhood.

  • range σr : “minimum” amplitude of an edge

( )

( )

− − =

S

I I I G G W I BF

q q q p p p

q p | | || || 1 ] [

r s

σ σ

slide-9
SLIDE 9

Influence of Pixels Influence of Pixels

p p

Only pixels close in space and in range are considered.

space range

slide-10
SLIDE 10

σs = 2 σr = 0.1 σr = 0.25 σr = ∞

(Gaussian blur)

σs = 6 σs = 18

input

Exploring the Parameter Space Exploring the Parameter Space

slide-11
SLIDE 11

σs = 2 σr = 0.1 σr = 0.25 σr = ∞

(Gaussian blur)

σs = 6 σs = 18

input

Varying the Range Parameter Varying the Range Parameter

slide-12
SLIDE 12

input

slide-13
SLIDE 13

σr = 0.1

slide-14
SLIDE 14

σr = 0.25

slide-15
SLIDE 15

σr = ∞

(Gaussian blur)

slide-16
SLIDE 16

σs = 2 σs = 6 σs = 18 σr = 0.1 σr = 0.25 σr = ∞

(Gaussian blur)

input

Varying the Space Parameter Varying the Space Parameter

slide-17
SLIDE 17

input

slide-18
SLIDE 18

σs = 2

slide-19
SLIDE 19

σs = 6

slide-20
SLIDE 20

σs = 18

slide-21
SLIDE 21

How to Set the Parameters How to Set the Parameters

Depends on the application. For instance:

  • space parameter: proportional to image size

– e.g., 2% of image diagonal

  • range parameter: proportional to edge amplitude

– e.g., mean or median of image gradients

  • independent of resolution and exposure
slide-22
SLIDE 22

A Few More Advanced Remarks A Few More Advanced Remarks

slide-23
SLIDE 23

Bilateral Filter Crosses Thin Lines Bilateral Filter Crosses Thin Lines

  • Bilateral filter averages across

features thinner than ~2σs

  • Desirable for smoothing: more pixels = more robust
  • Different from diffusion that stops at thin lines

close-up kernel

slide-24
SLIDE 24

Iterating the Bilateral Filter Iterating the Bilateral Filter

  • Generate more piecewise-flat images
  • Often not needed in computational photo.

] [

) ( ) 1 ( n n

I BF I =

+

slide-25
SLIDE 25

input

slide-26
SLIDE 26

1 iteration

slide-27
SLIDE 27

2 iterations

slide-28
SLIDE 28

4 iterations

slide-29
SLIDE 29

Bilateral Filtering Color Images Bilateral Filtering Color Images

( )

( )

− − =

S

I I I G G W I BF

q q q p p p

q p | | || || 1 ] [

r s

σ σ

( )

( )

− − =

S

G G W I BF

q q q p p p

C C C q p || || || || 1 ] [

r s

σ σ

For color images

color difference

For gray-level images

intensity difference

The bilateral filter is The bilateral filter is extremely easy to adapt to your need. extremely easy to adapt to your need.

scalar 3D vector (RGB, Lab)

input

  • utput
slide-30
SLIDE 30

Hard to Compute Hard to Compute

  • Nonlinear
  • Complex, spatially varying kernels

– Cannot be precomputed, no FFT…

  • Brute-force implementation is slow > 10min

( )

( )

− − =

S

I I I G G W I BF

q q q p p p

q p | | || || 1 ] [

r s

σ σ

slide-31
SLIDE 31

Questions? Questions?