Top Banner
A Gentle Introduction to Bilateral Filtering and its Applications “Fixing the Gaussian Blur”: the Bilateral Filter Sylvain Paris – Adobe
31

“Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

May 14, 2018

Download

Documents

phamdat
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · 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 – Adobe

Page 2: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Blur Comes from Averaging across Edges

*

*

*

input output

Same Gaussian kernel everywhere.

Page 3: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Bilateral Filter No Averaging across Edges

*

*

*

input output

The kernel shape depends on the image content.

[Aurich 95, Smith 97, Tomasi 98]

Page 4: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

space weight

not new

range weight

I

new

normalization factor

new

Bilateral Filter Definition: an Additional Edge Term

Same idea: weighted average of pixels.

Page 5: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Illustration a 1D Image

•  1D image = line of pixels

•  Better visualized as a plot

pixel intensity

pixel position

Page 6: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

space

Gaussian Blur and Bilateral Filter

space range normalization

Gaussian blur

Bilateral filter [Aurich 95, Smith 97, Tomasi 98]

space

space range

p

p

q

q

Page 7: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Bilateral Filter on a Height Field

output input

reproduced from [Durand 02]

Page 8: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Space and Range Parameters

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

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

Page 9: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Influence of Pixels Only pixels close in space and in range are considered.

space

range

Page 10: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σs = 2

σs = 6

σs = 18

σr = 0.1 σr = 0.25 σr = ∞

(Gaussian blur)

input

Exploring the Parameter Space

Page 11: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σs = 2

σs = 6

σs = 18

σr = 0.1 σr = 0.25 σr = ∞

(Gaussian blur)

input

Varying the Range Parameter

Page 12: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

input

Page 13: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σr = 0.1

Page 14: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σr = 0.25

Page 15: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σr = ∞ (Gaussian blur)

Page 16: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σs = 2

σs = 6

σs = 18

σr = 0.1 σr = 0.25 σr = ∞

(Gaussian blur)

input

Varying the Space Parameter

Page 17: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

input

Page 18: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σs = 2

Page 19: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σs = 6

Page 20: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

σs = 18

Page 21: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

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

Page 22: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

A Few More Advanced

Remarks

Page 23: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

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

Page 24: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Iterating the Bilateral Filter

•  Generate more piecewise-flat images

•  Often not needed in computational photo.

Page 25: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

input

Page 26: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

1 iteration

Page 27: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

2 iterations

Page 28: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

4 iterations

Page 29: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Bilateral Filtering Color Images

For gray-level images

For color images

intensity difference

color difference

scalar

3D vector (RGB, Lab)

input

output

Page 30: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Hard to Compute

•  Nonlinear

•  Complex, spatially varying kernels – Cannot be precomputed, no FFT…

•  Brute-force implementation is slow > 10min

Page 31: “Fixing the Gaussian Blur”: the Bilateral Filterpeople.csail.mit.edu/sparis/siggraph07_course/slides08/03... · A Gentle Introduction to Bilateral Filtering and its Applications

Questions ?