“fixing the gaussian blur”: the bilateral...
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/1.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/2.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/3.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/4.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/5.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/6.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/7.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/8.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/9.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/10.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/11.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/12.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/13.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/14.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/15.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/16.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/17.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/18.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/19.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/20.jpg)
σ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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/21.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/22.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/23.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/24.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/25.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/26.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/27.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/28.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/29.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/30.jpg)
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](https://reader030.vdocuments.site/reader030/viewer/2022021503/5af973847f8b9aff288d30e8/html5/thumbnails/31.jpg)
Questions ?