Title: Deblurring
1Deblurring Deconvolution
2Admin
- Assignment 3 due
- Last lecture
- Move to Friday?
- Projects
- Come and see me
3Different types of blur
- Camera shake
- User moving hands
- Scene motion
- Objects in the scene moving
- Defocus blur NEXT WEEK
- Depth of field effects
4(No Transcript)
5(No Transcript)
6(No Transcript)
7Overview
- Removing Camera Shake
- Non-blind
- Blind
- Removing Motion Blur
- Non-blind
- Blind
- Focus on software approaches
8Lets take a photo
Blurry result
9Slow-motion replay
10Slow-motion replay
Motion of camera
11Image formation model Convolution
?
Blur kernel
Blurry image
Sharp image
Input to algorithm
Desired output
Convolutionoperator
Model is approximation Assume static scene
12Blind vs Non-blind
?
?
13Camera Shake is it a convolution?
8 different people, handholding camera, using 1
second exposure
14Dots from each corner
Person 1
Person 2
Topright
Topleft
Bot.right
Bot.left
Person 4
Person 3
15What if scene not static?
- Partition the image into regions
16Overview
- Removing Camera Shake
- Non-blind
- Blind
- Removing Motion Blur
- Non-blind
- Blind
17Deconvolution is ill posed
?
Slide from Anat Levin
18Deconvolution is ill posed
Solution 1
?
Solution 2
?
Slide from Anat Levin
19Convolution- frequency domain representation
Sharp Image
1st observed image
Blur kernel
1-D Example
Output spectrum has zeros where filter spectrum
has zeros
Slide from Anat Levin
20Idea 1 Natural images prior
What makes images special?
Natural
Unnatural
Image
gradient
Natural images have sparse gradients
put a penalty on gradients
Slide from Anat Levin
21Deconvolution with prior
Convolution error
Derivatives prior
2
_
?
Low
Equal convolution error
2
_
?
High
22Comparing deconvolution algorithms
(Non blind) deconvolution code available online
http//groups.csail.mit.edu/graphics/CodedAperture
/
Slide from Anat Levin
Input
23Comparing deconvolution algorithms
(Non blind) deconvolution code available online
http//groups.csail.mit.edu/graphics/CodedAperture
/
Slide from Anat Levin
Input
spread gradients
localizes gradients
Richardson-Lucy
Gaussian prior
Sparse prior
24(No Transcript)
25(No Transcript)
26Application Hubble Space Telescope
- Launched with flawed mirror
- Initially used deconvolution to correct images
before corrective optics installed
Image of star
27Non-Blind DeconvolutionMatlab Demo
- http//groups.csail.mit.edu/graphics/CodedAperture
/DeconvolutionCode.html
28Overview
- Removing Camera Shake
- Non-blind
- Blind
- Removing Motion Blur
- Non-blind
- Blind
29Removing Camera Shake from a Single Photograph
Rob Fergus, Barun Singh, Aaron Hertzmann, Sam T.
Roweis and William T. Freeman
Massachusetts Institute of Technology
andUniversity of Toronto
30Overview
Joint work with B. Singh, A. Hertzmann, S.T.
Roweis W.T. Freeman
Original
Our algorithm
31Close-up
Original
Naïve sharpening
Our algorithm
32Image formation process
?
Blur kernel
Blurry image
Sharp image
Input to algorithm
Desired output
Convolutionoperator
Model is approximation Assume static scene
33Existing work on image deblurring
- Old problem
- Trott, T., The Effect of Motion of
Resolution,Photogrammetric Engineering, Vol.
26, pp. 819-827, 1960. - Slepian, D., Restoration of Photographs Blurred
by Image Motion, Bell System Tech., Vol. 46, No.
10, pp. 2353-2362, 1967.
34Existing work on image deblurring
- Software algorithms for natural images
- Many require multiple images
- Mainly Fourier and/or Wavelet based
- Strong assumptions about blur ? not true for
camera shake
- Image constraints are frequency-domain power-laws
35Hardware approaches
Existing work on image deblurring
Coded shutter
Dual cameras
Image stabilizers
Raskar et al. SIGGRAPH 2006
Ben-Ezra Nayar CVPR 2004
Our approach can be combined with these hardware
methods
36Why is this hard?
Simple analogy 11 is the product of two
numbers. What are they?
No unique solution 11 1 x 11 11 2 x
5.5 11 3 x 3.667 etc..
Need more information !!!!
37Multiple possible solutions
Sharp image
Blur kernel
?
Blurry image
38Natural image statistics
Characteristic distribution with heavy tails
Histogram of image gradients
Log pixels
39Blurry images have different statistics
Histogram of image gradients
Log pixels
40Parametric distribution
Histogram of image gradients
Log pixels
Use parametric model of sharp image statistics
41Uses of natural image statistics
- Denoising Portilla et al. 2003, Roth and Black,
CVPR 2005 - Superresolution Tappen et al., ICCV 2003
- Intrinsic images Weiss, ICCV 2001
- Inpainting Levin et al., ICCV 2003
- Reflections Levin and Weiss, ECCV 2004
- Video matting Apostoloff Fitzgibbon, CVPR
2005 - Corruption process assumed known
42Three sources of information
- 1. Reconstruction constraint
2. Image prior
Distribution of gradients
43Three sources of information
y observed image b blur kernel x
sharp image
44Three sources of information
y observed image b blur kernel x
sharp image
Posterior
45Three sources of information
y observed image b blur kernel x
sharp image
Posterior
2. Image prior
1. Likelihood (Reconstruction constraint)
3. Blurprior
461. Likelihood
y observed image b blur x sharp image
- Reconstruction constraint
i - pixel index
472. Image prior
y observed image b blur x sharp image
- Mixture of Gaussians fit to empirical
distribution of image gradients
Log pixels
i - pixel index c - mixture component index f
- derivative filter
483. Blur prior
y observed image b blur x sharp image
- Mixture of Exponentials
- Positive sparse
- No connectivity constraint
Most elements near zero
A few can be large
j - blur kernel element d - mixture component
index
49The obvious thing to do
Posterior
2. Image prior
1. Likelihood (Reconstruction constraint)
3. Blurprior
- Combine 3 terms into an objective function
- Run conjugate gradient descent
- This is Maximum a-Posteriori (MAP)
No success!
50Variational Bayesian approach
- Keeps track of uncertainty in estimates of image
and blur by using a distribution instead of a
single estimate
Optimization surface for a single variable
Maximum a-Posteriori (MAP)
Score
Variational Bayes
Pixel intensity
51Variational Independent Component Analysis
Miskin and Mackay, 2000
- Binary images
- Priors on intensities
- Small, synthetic blurs
- Not applicable to natural images
52Overview of algorithm
Input image
- Pre-processing
- Kernel estimation
- Multi-scale approach
- Image reconstruction
- - Standard non-blind deconvolution routine
53Digital image formation process
Gammacorrection
RAW values
Remapped values
Blur process applied here
P. Debevec J. Malik, Recovering High Dynamic
Range Radiance Maps from Photographs, SIGGRAPH
97
54Preprocessing
Input image
Convert tograyscale
Remove gammacorrection
User selects patch from image
- Bayesian inference too slow to run on whole
image
Infer kernel from this patch
55Initialization
Input image
Convert tograyscale
Remove gammacorrection
User selects patch from image
Initialize 3x3 blur kernel
Initial image estimate
Initial blur kernel
Blurry patch
56Inferring the kernel multiscale method
Input image
Convert tograyscale
Remove gammacorrection
User selects patch from image
Loop over scales
VariationalBayes
Upsampleestimates
Initialize 3x3 blur kernel
Use multi-scale approach to avoid local minima
57Image Reconstruction
Input image
Convert tograyscale
Remove gammacorrection
User selects patch from image
Loop over scales
VariationalBayes
Upsampleestimates
Initialize 3x3 blur kernel
Full resolutionblur estimate
Non-blind deconvolution (Richardson-Lucy)
Deblurred image
58Syntheticexperiments
59Synthetic example
Artificial blur trajectory
Sharp image
60Synthetic blurry image
61Inference initial scale
Image before
Image after
Kernel before
Kernel after
62Inference scale 2
Image before
Image after
Kernel after
Kernel before
63Inference scale 3
Image before
Image after
Kernel after
Kernel before
64Inference scale 4
Image before
Image after
Kernel before
Kernel after
65Inference scale 5
Image before
Image after
Kernel after
Kernel before
66Inference scale 6
Image before
Image after
Kernel after
Kernel before
67Inference Final scale
Image before
Image after
Kernel after
Kernel before
68Comparison of kernels
True kernel
Estimated kernel
69Blurry image
70Matlabs deconvblind
71Blurry image
72Our output
73True sharp image
74What we do and dont model
- DO
- Gamma correction
- Tone response curve (if known)
- DONT
- Saturation
- Jpeg artifacts
- Scene motion
- Color channel correlations
75Realexperiments
76Results on real images
- Submitted by people from their own photo
collections - Type of camera unknown
- Output does contain artifacts
- Increased noise
- Ringing
- Compare with existing methods
77(No Transcript)
78(No Transcript)
79Close-up
80Original photograph
81Blur kernel
Our output
82Matlabs deconvblind
83Close-up
Matlabs deconvblind
Original
Our output
84Original photograph
85Our output
Blur kernel
86Photoshop sharpen more
87Original image
Close-up
Close-up of our output
Blur kernel
Close-up of image
88Original photograph
89Our output
Blur kernel
90Original image
91Our output
Blur kernel
92Close-up
Blur kernel
Our output
Original image
93What about a sharp image?
Original photograph
94Our output
Blur kernel
95Original photograph
96Blur kernel
Our output
97Close-up
Blur kernel
Our output
Original image
98Original photograph
99Blurry image patch
Our output
Blur kernel
100Original photograph
101Our output
Blur kernel
102Close-up of bird
Original
Unsharp mask
Our output
103Original photograph
104Blur kernel
Our output
105Image artifacts estimated kernels
Blur kernels
Image patterns
Note blur kernels were inferred from large image
patches, NOT the image patterns shown
106Code available online
- http//cs.nyu.edu/fergus/research/deblur.html
107Summary
- Method for removing camera shake from real
photographs - First method that can handle complicated blur
kernels - Uses natural image statistics
- Non-blind deconvolution currently simplistic
- Things we have yet to model
- Correlations in colors, scales, kernel continuity
- JPEG noise, saturation, object motion
108Overview
- Removing Camera Shake
- Non-blind
- Blind
- Removing Motion Blur
- Non-blind
- Blind
109(No Transcript)
110(No Transcript)
111(No Transcript)
112Deblurred Result
Input Photo
113Traditional Camera Shutter is OPEN
114Our Camera Flutter Shutter
115Shutter is OPEN and CLOSED
116Comparison of Blurred Images
117Implementation Completely Portable
118Lab Setup
119Blurring Convolution
Sync Function
Traditional Camera Box Filter
120Preserves High Frequencies!!!
Flutter Shutter Coded Filter
121Comparison
122Inverse Filter stable
Inverse Filter Unstable
123Short Exposure
Long Exposure
Coded Exposure
Our result
Ground Truth
Matlab Lucy
124Overview
- Removing Camera Shake
- Non-blind
- Blind
- Removing Motion Blur
- Non-blind
- Blind
125(No Transcript)
126Use statistics to determine blur size
- Assumes direction of blur known
127Input image
128Deblur whole image at once
129Local Evidence
130Proposed boundary
131Result image
132Input image (for comparison)
133(No Transcript)
134Let y 2 s2 0.1
135Gaussian distribution
136(No Transcript)
137Marginal distribution p(by)
138MAP solution
139MAP solution
140Variational Bayes
- True Bayesian approach not tractable
- Approximate posterior with simple distribution
141Fitting posterior with a Gaussian
- Approximating distribution is
Gaussian - Minimize
142KL-Distance vs Gaussian width
143Fitting posterior with a Gaussian
- Approximating distribution is
Gaussian - Minimize
144Variational Approximation of Marginal
Variational
True marginal
MAP
145Try sampling from the model
- Let true b 2
- Repeat
- Sample x N(0,2)
- Sample n N(0,s2)
- y xb n
- Compute pMAP(by), pBayes(by)
pVariational(by) - Multiply with existing density estimates (assume
iid)
146 Setup of Variational Approach
Work in gradient domain
- Approximate posterior
with
Assume
is Gaussian on each pixel
is rectified Gaussian on each blur kernel element
Cost function