Professional Documents
Culture Documents
Admin
Assignment 3 due
Last lecture
Move to Friday?
Lecture 10
Projects
Come and see me
Scene motion
Objects in the scene moving
5/13/2008
Overview
Non-blind
Blind
Slow-motion replay
Slow-motion replay
Motion of camera
Input to algorithm
Model is approximation
Assume static scene
Non-blind
Blind
=
Blurry image
Blind vs Non-blind
Blur
kernel
Sharp image
Desired output
Convolution
operator
5/13/2008
Person 2
Top
left
Top
right
Bot.
left
Bot.
right
Person 4
Person 3
Overview
f x = y
f x = y
Solution 1:
Solution 2:
=
Slide from Anat Levin
5/13/2008
Blur kernel
Frequency
spectrum
spectrum
Sharp Image
spectrum
Natural
Image
Frequency
1-D Example
Spatial convolution
frequency multiplication
?
?
Derivatives prior
Input
Low
| f x y |2 + i (xi )
Convolution error
gradient
x = arg min
Unnatural
Frequency
( x ) = x
( x ) = x
0 .8
spread gradients
localizes gradients
Gaussian prior
Sparse prior
+
High
Richardson-Lucy
Input
Richardson-Lucy
( x ) = x
( x ) = x
0 .8
spread gradients
localizes gradients
Gaussian prior
Sparse prior
5/13/2008
Non-Blind Deconvolution
Matlab Demo
Overview
http://groups.csail.mit.edu/graphics/Code
dAperture/DeconvolutionCode.html
Non-blind
Blind
Overview
Joint work with B. Singh, A. Hertzmann, S.T. Roweis & W.T. Freeman
Original
Our algorithm
5/13/2008
Close-up
Original
Nave sharpening
Our algorithm
=
Blurry image
Input to algorithm
Blur
kernel
Sharp image
Desired output
Model is approximation
Assume static scene
Convolution
operator
Old problem:
Hardware approaches
Simple analogy:
11 is the product of two numbers.
What are they?
Image stabilizers
Dual cameras
Coded shutter
Raskar et al.
SIGGRAPH 2006
No unique solution:
11 = 1 x 11
11 = 2 x 5.5
11 = 3 x 3.667
etc..
Need more information !!!!
5/13/2008
Sharp image
Blur kernel
Log # pixels
Blurry image
Parametric distribution
Histogram of image gradients
Log # pixels
Log # pixels
Inpainting
I
i i [L
[Levin
i et al.,
l ICCV 2003]
Reflections [Levin and Weiss, ECCV 2004]
Video matting [Apostoloff & Fitzgibbon, CVPR 2005]
Corruption process assumed known
Estimated
blur kernel
2. Image prior:
Distribution
of gradients
3. Blur prior:
Positive
&
Sparse
5/13/2008
b = blur kernel
x = sharp image
y = observed image
b = blur kernel
x = sharp image
p( b; xjy)
Posterior
1. Likelihood p( yjb; x )
y = observed image
y = observed image
b = blur kernel
b = blur
x = sharp image
x = sharp image
Reconstruction constraint:
p( b; xjy) = k p( yjb; x) p( x) p( b)
Posterior
1. Likelihood
(Reconstruction
constraint)
2. Image
prior
3. Blur
prior
p( yjb; x ) =
2
i N ( y i jx i - b; )
( x i - b y i ) 2
22
ie
i - pixel index
3. Blur prior p( b)
2. Image prior p( x)
y = observed image
p( x) =
b = blur
x = sharp image
Q PC
2
i c= 1 c N ( f ( x i ) j0; sc )
y = observed image
p( b) =
b = blur
x = sharp image
Q PD
j
d= 1 d E( bj j d)
70
i - pixel index
Mixture of Exponentials
60
p(b)
No connectivity constraint
50
40
30
20
f - derivative filter
10
0
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
5/13/2008
p( b; xjy) = k p( yjb; x) p( x) p( b)
Posterior
2. Image
prior
1. Likelihood
(Reconstruction
constraint)
3. Blur
prior
Optimization surface
f
ffor a
single variable
No success!
Maximum
a-Posteriori (MAP)
Variational
Bayes
Pixel intensity
Overview of algorithm
Binary images
Input image
Priors on intensities
1. Pre-processing
Small,, synthetic
y
blurs
2. Kernel estimation
Not applicable to
natural images
Multi-scale approach
3. Image reconstruction
-
RAW
values
Remapped
values
Preprocessing
Input image
Convert to
grayscale
Remove gamma
correction
User selects patch
from image
Bayesian inference
too slow to run on
whole image
Infer kernel
from this patch
P. Debevec & J. Malik, Recovering High Dynamic Range Radiance Maps from Photographs, SIGGRAPH 97
5/13/2008
Initialization
Input image
Input image
Convert to
grayscale
Convert to
grayscale
Remove gamma
correction
Remove gamma
correction
Initialize 3x3
blur kernel
Upsample
estimates
Variational
Bayes
Initialize 3x3
blur kernel
Blurry patch
Image Reconstruction
Input image
Convert to
grayscale
Remove gamma
correction
User selects patch
from image
L
Loop
over scales
l
Full resolution
blur estimate
Upsample
estimates
Non-blind deconvolution
(Richardson-Lucy)
Variational
Bayes
Initialize 3x3
blur kernel
Deblurred
image
Synthetic example
Sharp image
Synthetic
experiments
i
t
10
5/13/2008
Image before
Kernel before
Image before
Inference scale 3
Kernel before
Image before
Kernel before
Inference scale 5
Image after
Image before
Kernel after
Kernel before
Image after
Image before
Kernel after
Kernel before
Image after
Image before
Kernel after
Kernel before
Inference scale 2
Image after
Kernel after
Inference scale 4
Image after
Kernel after
Inference scale 6
Image after
Kernel after
11
5/13/2008
Image before
Image after
Comparison of kernels
True kernel
Estimated kernel
Kernel after
Kernel before
Blurry image
Blurry image
Matlabs deconvblind
Our output
12
5/13/2008
Gamma correction
Tone response curve (if known)
DONT
Saturation
Jpeg artifacts
Scene motion
Color channel correlations
Real
experiments
i
t
13
5/13/2008
Original photograph
Close-up
Original
Output
Our output
Blur kernel
Original photograph
Close-up
Original
Matlabs deconvblind
Our output
Matlabs
deconvblind
14
5/13/2008
Our output
Blur kernel
Original image
Original photograph
Close-up
Close-up of image
Blur kernel
Original image
Our output
Blur kernel
15
5/13/2008
Close-up
Our output
Blur kernel
Original image
Our output
Blur kernel
Blur kernel
Our output
Blur kernel
Original photograph
Our output
16
5/13/2008
Close-up
Original image
Our output
Blur kernel
Original photograph
Original photograph
Our output
Blur kernel
Our output
Close-up of bird
Blur kernel
Original
Unsharp mask
Our output
17
5/13/2008
Blur kernel
Original photograph
Our output
Image patterns
Note: blur kernels were inferred from large image patches,
NOT the image patterns shown
Summary
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
Overview
Removing Camera Shake
Non-blind
Blind
18
5/13/2008
Input Photo
Deblurred Result
Traditional Camera
Our Camera
Shutter is OPEN
Flutter Shutter
19
5/13/2008
Lab Setup
Implementation
Completely Portable
S
Sync
Function
F
ti
Blurring
g
==
Convolution
Preserves High
Frequencies!!!
20
5/13/2008
Comparison
Short Exposure
Long Exposure
Coded Exposure
Overview
Removing Camera Shake
Non-blind
Our result
Blind
Ground Truth
Blind
21
5/13/2008
Input image
Local Evidence
Proposed boundary
Result image
22
5/13/2008
p( b; xjy) = k p( yjb; x) p( x ) p( b)
Let y = 2
2 = 0.1
N ( yjbx ; 2 )
p( b; xjy) = k p( yjb; x) p( x ) p( b)
p( b; xjy) = k p( yjb; x) p( x ) p( b)
Gaussian distribution:
N ( xj0;
j0 2)
MAP solution
p( b; xjy) dx = k
p( yjb; x) p( x) dx
0.16
0.16
0.14
0.14
0.12
0.12
0.1
Bayes p(b|y)
Bayes p(b|y)
p( bjy) =
0.08
0.06
0.04
0.06
0.04
0.02
0.1
0.08
0.02
10
10
23
5/13/2008
MAP solution
Highest point on surface: ar gm ax b;x p( x; bjy)
Variational Bayes
True Bayesian
approach not
tractable
Approximate
posterior
with simple
distribution
KL-Distance vs Gaussian
width
11
10
Minimize K L ( q( x; b) jj p( x; bjy) )
KL(q||p)
4
0
0.1
0.2
0.3
0.4
Gaussian width
0.5
0.6
0.7
Minimize K L ( q( x; b) jj p( x; bjy) )
Variational
True
marginal
i l
p(b|y)
1.5
MAP
0.5
10
24
5/13/2008
0.9
Let true b = 2
0.8
x - b= y !
Repeat:
p(b|y)
0.7
r x - b= r y
0.6
Approximate posterior
with q( r x; b)
0.5
0.4
Sample x ~ N(0,2)
Sample n ~ N(0,2)
y = xb + n
0.3
0.2
Assume
0.1
0
10
p( r x ; bjr y)
q( r x ; b) = q( r x ) q( b)
K L ( q( r x) q( b) jj p( r x; bjr y) )
25