Fixing the Gaussian Blur : the Bilateral Filter

Similar documents
High-Dynamic-Range Imaging & Tone Mapping

Fast Bilateral Filtering for the Display of High-Dynamic-Range Images

! High&Dynamic!Range!Imaging! Slides!from!Marc!Pollefeys,!Gabriel! Brostow!(and!Alyosha!Efros!and! others)!!

Tonemapping and bilateral filtering

Fast Bilateral Filtering for the Display of High-Dynamic-Range Images

The Dynamic Range Problem. High Dynamic Range (HDR) Multiple Exposure Photography. Multiple Exposure Photography. Dr. Yossi Rubner.

Tone mapping. Digital Visual Effects, Spring 2009 Yung-Yu Chuang. with slides by Fredo Durand, and Alexei Efros

Problem Set 3. Assigned: March 9, 2006 Due: March 23, (Optional) Multiple-Exposure HDR Images

Realistic Image Synthesis

High dynamic range imaging and tonemapping

Flash Photography Enhancement via Intrinsic Relighting

HDR imaging and the Bilateral Filter

Prof. Feng Liu. Spring /12/2017

Prof. Feng Liu. Winter /10/2019

Burst Photography! EE367/CS448I: Computational Imaging and Display! stanford.edu/class/ee367! Lecture 7! Gordon Wetzstein! Stanford University!

Digital Image Processing

Computational Illumination Frédo Durand MIT - EECS

High Dynamic Range Imaging

High Dynamic Range Images : Rendering and Image Processing Alexei Efros. The Grandma Problem

Denoising and Effective Contrast Enhancement for Dynamic Range Mapping

More image filtering , , Computational Photography Fall 2017, Lecture 4

Filtering Images in the Spatial Domain Chapter 3b G&W. Ross Whitaker (modified by Guido Gerig) School of Computing University of Utah

Image Deblurring with Blurred/Noisy Image Pairs

Guided Filtering Using Reflected IR Image for Improving Quality of Depth Image

CS448f: Image Processing For Photography and Vision. Fast Filtering Continued

A Gentle Introduction to Bilateral Filtering and its Applications 08/10: Applications: Advanced uses of Bilateral Filters

Computing for Engineers in Python

Last Lecture. photomatix.com

Applications of Flash and No-Flash Image Pairs in Mobile Phone Photography

icam06, HDR, and Image Appearance

A Gentle Introduction to Bilateral Filtering and its Applications 08/10: Applications: Advanced uses of Bilateral Filters

Images and Filters. EE/CSE 576 Linda Shapiro

Image Processing. Adam Finkelstein Princeton University COS 426, Spring 2019

Computational Photography

Firas Hassan and Joan Carletta The University of Akron

Tone mapping. Tone mapping The ultimate goal is a visual match. Eye is not a photometer! How should we map scene luminances (up to

Contrast Image Correction Method

Correcting Over-Exposure in Photographs

Filtering. Image Enhancement Spatial and Frequency Based

Agenda. Fusion and Reconstruction. Image Fusion & Reconstruction. Image Fusion & Reconstruction. Dr. Yossi Rubner.

Image Filtering in Spatial domain. Computer Vision Jia-Bin Huang, Virginia Tech

Image Processing by Bilateral Filtering Method

High-Quality Reverse Tone Mapping for a Wide Range of Exposures

High dynamic range and tone mapping Advanced Graphics

Computational Photography and Video. Prof. Marc Pollefeys

Cvision 2. António J. R. Neves João Paulo Silva Cunha. Bernardo Cunha. IEETA / Universidade de Aveiro

Why learn about photography in this course?

lecture 24 image capture - photography: model of image formation - image blur - camera settings (f-number, shutter speed) - exposure - camera response

Multispectral Image Dense Matching

25/02/2017. C = L max L min. L max C 10. = log 10. = log 2 C 2. Cornell Box: need for tone-mapping in graphics. Dynamic range

CS534 Introduction to Computer Vision. Linear Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

Guided Image Filtering for Image Enhancement

Last Lecture. photomatix.com

Coded Computational Photography!

Digital Image Processing

A Study on Image Enhancement and Resolution through fused approach of Guided Filter and high-resolution Filter

>>> from numpy import random as r >>> I = r.rand(256,256);

Continuous Flash. October 1, Technical Report MSR-TR Microsoft Research Microsoft Corporation One Microsoft Way Redmond, WA 98052

NEW HIERARCHICAL NOISE REDUCTION 1

Image Visibility Restoration Using Fast-Weighted Guided Image Filter

Digital Image Processing

Computer Graphics Fundamentals

Coding and Modulation in Cameras

Image Enhancement of Low-light Scenes with Near-infrared Flash Images

Color , , Computational Photography Fall 2017, Lecture 11

Image Enhancement of Low-light Scenes with Near-infrared Flash Images

Achim J. Lilienthal Mobile Robotics and Olfaction Lab, AASS, Örebro University

Image Processing COS 426

Image preprocessing in spatial domain

Image Processing for feature extraction

Color , , Computational Photography Fall 2018, Lecture 7

Admin Deblurring & Deconvolution Different types of blur

Recent Advances in Image Deblurring. Seungyong Lee (Collaboration w/ Sunghyun Cho)

Overview. Neighborhood Filters. Dithering

Flash Photography Enhancement via Intrinsic Relighting

MODIFICATION OF ADAPTIVE LOGARITHMIC METHOD FOR DISPLAYING HIGH CONTRAST SCENES BY AUTOMATING THE BIAS VALUE PARAMETER

Image processing for gesture recognition: from theory to practice. Michela Goffredo University Roma TRE

Fourier Transform. Any signal can be expressed as a linear combination of a bunch of sine gratings of different frequency Amplitude Phase

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

AUTOMATIC FACE COLOR ENHANCEMENT

International Journal of Innovative Research in Engineering Science and Technology APRIL 2018 ISSN X

icam06: A refined image appearance model for HDR image rendering

Deblurring. Basics, Problem definition and variants

Gray Point (A Plea to Forget About White Point)

Digital Radiography using High Dynamic Range Technique

What is an image? Images and Displays. Representative display technologies. An image is:

Flash Photography Enhancement via Intrinsic Relighting

Pixel Classification Algorithms for Noise Removal and Signal Preservation in Low-Pass Filtering for Contrast Enhancement

The Unique Role of Lucis Differential Hysteresis Processing (DHP) in Digital Image Enhancement

Lecture Notes 11 Introduction to Color Imaging

Spatial Domain Processing and Image Enhancement

CSE 332/564: Visualization. Fundamentals of Color. Perception of Light Intensity. Computer Science Department Stony Brook University

High Dynamic Range image capturing by Spatial Varying Exposed Color Filter Array with specific Demosaicking Algorithm

Image Enhancement in spatial domain. Digital Image Processing GW Chapter 3 from Section (pag 110) Part 2: Filtering in spatial domain

Research Article Anisotropic Diffusion for Details Enhancement in Multiexposure Image Fusion

Limitations of the Medium, compensation or accentuation

Limitations of the medium

The ultimate camera. Computational Photography. Creating the ultimate camera. The ultimate camera. What does it do?

Color Transformations

Transcription:

Fixing the Gaussian Blur : the Bilateral Filter Lecturer: Jianbing Shen Email : shenjianbing@bit.edu.cnedu Office room : 841 http://cs.bit.edu.cn/shenjianbing cn/shenjianbing Note: contents copied from siggraph course notes <A Gentle Introduction to Bilateral Filtering and its Applications >

Blur Comes from Averaging g across Edges input * output * * Same Gaussian kernel everywhere. 2

Bilateral Filter [Aurich 95, Smith 97, Tomasi 98] No Averaging g across Edges input * output * * The kernel shape depends d on the image content. t 3

Bilateral Filter Definition: an Additional Edge Term Same idea: weighted average of pixels. BF new 1 W not new new [ I ] G G I I p s p q p q [ r p q S I q normalization factor space weight range weight I 4

Illustration a 1D Image 1D image = line of pixels Better visualized as a plot pixel intensity pixel position 5

Gaussian Blur and Bilateral Filter Gaussian blur p q GB I] G p q space Bilateral filter [Aurich 95, Smith 97, Tomasi 98] [ p q S space I q q p space ra ange 1 BF [ I ] p G W s r p q p q S space range normalization p q G I I I q

Bilateral Filter on a Height Field BF 1 [ I ] p G W s r p q G I I p q q Wp q S I output input reproduced from [Durand 02]

Space and Range Parameters 1 BF [ r W [ I ] G G I I p s p q p q p q S I q space s : spatial extent of the kernel, size of the considered neighborhood. range r : minimum amplitude of an edge 8

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

Exploring the Parameter Space r = 0.1 r = 0.25 r = r (Gaussian blur) input s = 2 s = 6 s = 18 10

Varying the Range Parameter r = 0.1 r = 0.25 r = r (Gaussian blur) input s = 2 s = 6 s = 18

input 12

r = 0.1 13

r = 0.25 14

r = (Gaussian blur) 15

Varying the Space Parameter r = 0.1 r = 0.25 r = r (Gaussian blur) input s = 2 s = 6 s = 18

input 17

s = 2 18

s = 6 19

s = 18 20

How to Set the Parameters Depends on the application. For instance: space parameter: proportional to image size eg e.g., 2% of image diagonal range parameter: proportional p to edge amplitude e.g., mean or median of image gradients independent of resolution and exposure 21

A Few More Advanced Remarks 22

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

Iterating the Bilateral Filter I BF [ I ] [ ( n 1) ( n ) Generate more piecewise-flat images Often not needed in computational photo. 24

input 25

1 iteration 26

2 iterations 27

4 iterations 28

Bilateral Filtering Color Images For gray-level images 1 BF [ I ] p G r W s p q S S intensity difference p q G I I p q I q scalar input For color images 1 BF [ I ] p G r W s Wp q S S color difference p q G C C p q C q 3D vector (RGB, Lab) output The bilateral filter is extremely easy to adapt to your need.

Hard to Compute 1 Nonlinear BF [ I ] p G s p q G I p I q r Complex, spatially varying kernels W p q S S Cannot be precomputed, no FFT I q Brute-force implementation is slow > 10min 30

Questions? 31

Applications

Overview Denoising Tone mapping Relighting & texture editing 33

Overview Not most powerful application Not best denoising, but good & simple Denoising Tone mapping Relighting & texture editing

Basic denoising Noisy input Bilateral filter 7x7 window

Basic denoising Bilateral filter Median 3x3 36

Basic denoising Bilateral filter Median 5x5 37

Basic denoising Bilateral filter Bilateral filter lower sigma 38

Basic denoising Bilateral filter Bilateral filter higher sigma 39

Denoising Small spatial sigma (e.g. 7x7 window) Adapt range sigma to noise level l Maybe not best denoising method, but best simplicity/quality tradeoff No need for acceleration (small kernel) But the denoising feature in e.g. Photoshop is better

Overview Denoising Tone mapping Relighting & texture editing 41

Real world dynamic range Eye can adapt from ~ 10-6 to 10 6 cd/m 2 Often 1 : 10,000 in a scene 10-6 10 6 Real world High dynamic range 42

Picture dynamic range Typically 1: 20 or 1:50 Real world Black is ~ 50x darker than white 10-6 10 6 Picture 10-6 10 6 Low contrast 43

Multiple exposure photography Real world 10-6 High dynamic range 10 6 Merge HDR Merge multiple l exposure to cover full range We obtain one single image with floats per pixel But we still can t display it

The future: HDR Cameras HDR sensors using CMOS Use a log response curve e.g. SMaL, Assorted pixels Fuji Nayar et al. Per-pixel exposure Filter Integration time Fuji SuperCCD Multiple cameras using beam splitters Other computational photography tricks

Problem: Contrast reduction Match limited contrast of the medium Preserve details 10-6 High dynamic range 10 6 Real world Picture 10-6 10 6 Low contrast 46

Tone mapping Input: high-dynamic-range image (floating point per pixel)

Naïve technique Scene has 1:10,000 contrast, display has 1:100 Simplest contrast reduction?

Naïve: Gamma compression X X (where =0.5 in our case) But colors are washed-out. Why? Input Gamma 49

Gamma compression on intensity Colors are OK, but details (intensity high-frequency) are blurred Gamma on intensity Intensity Color

Oppenheim 1968, Chiu et al. 1993 Reduce contrast of low-frequencies (log domain) Keep high frequencies Low-freq freq. Reduce low frequency High-freq. Color

The halo nightmare For strong edges Because they contain high frequency Low-freq freq. Reduce low frequency High-freq. Color

Bilateral filtering to the rescue Large scale = bilateral (log intensity) Detail = residual [Durand & Dorsey 2002] Large-scale Output Detail Color

Contrast reduction Input HDR image Contrast too high! 54

Input HDR image Contrast reduction Intensity Color 55

Input HDR image Contrast reduction Intensity Large scale Color Bilateral Filter (in log domain!) Spatial sigma: 2% image size Range sigma: 0.4 (in log 10) 56

Input HDR image Contrast reduction Intensity Large scale Bilateral Filter Detail Color Detail = log intensity large scale (residual) 57

Input HDR image Contrast reduction Intensity Large scale Reduce contrast Large scale Bilateral Filter Detail Color 58

Input HDR image Contrast reduction Intensity Large scale Reduce contrast Large scale Bilateral Filter Detail Preserve! Detail Color 59

Input HDR image Contrast Output reduction Intensity Large scale Reduce contrast Large scale Bilateral Filter Detail Preserve! Detail Color Color 60

Contrast reduction in log domain Set target large-scale contrast (e.g. log 10 10) In linear output, we want 1:10 contrast for large scale Compute range of input large scale layer: largerange = max(inloglarge) min (inloglarge) Scale factor k= log 10 (10) / largerange Normalize so that the biggest value is 0 in log outlog= inlogdetail + inloglarge * k max(inloglarge)

Alternative explanation Explanation 1 (previous slides): outlog =k inloglarge + inlogdetail (ignoring offset) Explanation 2 outlog = k inlogintensity + (1-k) detail Reduce contrast of full intensity layer Add back some detail Same final effect since inlogdetail+inloglarge scale = inlogintensity But different philosophy: decomposition vs. add back detail

Demo Don t try at home without FAST bilateral filtering 63

Denoising vs. tone mapping Denoising: decompose into noise+signal si n Throw away noise, keep signal Small kernel Tone mapping Decompose into large scale + detail Preserve detail, reduce large scale Large kernel because detail=high+medium frequency computation challenge 64

Crossing lines The bilateral filter is influenced by pixels across thin line Good for tone mapping

What matters Spatial sigma: not very important Range sigma: quite important Use of the log domain for range: critical Because HDR and because perception sensitive to multiplicative contrast CIELab might be better for other applications Luminance computation Not critical, i but has influence see our Flash/no-flash paper [Eisemann 2004] for smarter r functionn 66

Tone mapping evaluation Recent user experiments to evaluate competing tone mapping Ledda et al. 2005 http://www.cs.bris.ac.uk/publications/ Papers/2000255.pdf Interestingly, the former concludes bilateral is the worst, the latter that it is the best! They choose to test a different criterion: fidelity vs. preference More importantly, they focus on algorithm and ignore parameters From Kuang et al. Adapted from Ledda et al. 67

Dirty vision for cool graphics Three wrongs make one right Analyze image Intrinsic image: albedo & illumination Simple bilateral filter Modify In our case, reduce contrast of large-scale (illumination) Recombine Get final image

Overview Denoising Tone mapping Relighting & texture editing 69

HDR hallucination [Lvdi Wang, Liyi Wei, Kun Zhou, Baining Guo, Heung-Yeung Shum, EGSR 2007] Low-dynamic-range images have under- and over-exposed exposed parts Information missing Underexposed Over- exposed 70

HDR hallucination Separate illumination and texture (Bilateral!) Fit smooth function to illumination Use texture t synthesis

HDR hallucination input output 72

HDR hallucination input output 73

Recap Decompose into Large scale (with bilateral l filter) Detail (residual: medium+high frequencies) Use big kernels Use appropriate domain (log for HDR) Manipulate/process independently Tone mapping Relighting, HDR hallucination HDR hallucination 74

Input Denoising with the BF output Images courtesy of Ce Liu 75

Noise level adaptation [Liu et al. 06] The noise of digital cameras varies with intensity Adapt sigma range to noise level Main topic of the paper: noise level inference Red Green Blue noise Intensity

Adaptive bilateral filter Adapt sigma range to intensity Input Bilateral Adaptive bilateral 77

Joint bilateral upsampling p (JBU) First publication on bilateral filters for upsampling at SIGGRAPH 2007 J. Kopf, Univ. of Konstantz (Germany) provided reference sw. [Kopf2007] solution: High resolution image in range term Low resolution input high resolution output high resolution result low resolution result (input) high resolution image (input)