Lecture 5 Stitching Blending
Lecture 5 Stitching Blending
Kari Pulli
VP Computational Imaging
Light
First project
Problem 1:
Detect the same point independently in both images
no chance to match!
Problem 2:
For each point correctly recognize the corresponding one
⎡u ⎤
E (u, v) ≅ [u, v ] M ⎢ ⎥
⎣ v ⎦
⎡ I x2 I x I y ⎤
M = ∑ w( x, y) ⎢ 2 ⎥
I x = I (x, y) − I (x −1, y)
x, y ⎢⎣ I x I y I y ⎥⎦
Eigenvalues λ1, λ2 of M at different locations
⎡ I x2 I x I y ⎤
Measure of corner response: M = ∑ w( x, y) ⎢ 2 ⎥
x, y ⎢⎣ I x I y I y ⎥⎦
det M = λ1λ2
trace M = λ1 + λ2
2
R = det M − k ( trace M )
λ2 “Edge” “Corner”
• R depends only on R<0
eigenvalues of M
• R is large for a corner R>0
λ1
Harris Detector: Workflow
Harris Detector: Workflow
Compute corner response R
Harris Detector: Workflow
Find points with large corner response: R > threshold
Harris Detector: Workflow
Take only the points of local maxima of R
Harris Detector: Workflow
Not invariant to image scale!
?
Point descriptor should be:
1. Invariant
2. Distinctive
SIFT – Scale Invariant Feature Transform
SIFT – Scale Invariant Feature Transform
Descriptor overview:
Determine scale (by maximizing DoG in scale and in space),
local orientation as the dominant gradient direction
Use this scale and orientation to make all further computations
invariant to scale and rotation
Compute gradient orientation histograms of several small
windows (128 values for each point)
Normalize the descriptor to make it invariant to intensity change
0 2π
characteristic scale
T. Lindeberg (1998). Feature detection with automatic scale selection.
International Journal of Computer Vision 30 (2): pp 77--116.
Blob detection in 2D
2 2
0
1 -4
1 0
1
2 ⎛ ∂ g ∂ g ⎞
2
0 1 0 ∇ norm g = σ ⎜⎜ 2 + 2 ⎟⎟
∂2 g
∂x 2
= g(x −1, y) − 2g(x, y) + g(x +1, y) ⎝ ∂x ∂y ⎠
Difference of Gaussians (DoG)
Laplacian of Gaussian can be approximated by the
difference between two different Gaussians
Create a pack of DoGs
Use FAST-9
use Harris measure to order them
✓P P ◆
Find orientation xI(x, y) yI(x, y)
P , P
calculate weighted new center I(x, y) I(x, y)
reorient image so that gradients vary vertically
BRIEF
Binary Robust Independent Elementary Features
choose pixels to compare, result creates 0 or 1
combine to a binary vector, compare using
Hamming distance (XOR + pop count)
Rotated BRIEF
train a good set of pixels to compare
rBRIEF vs. SIFT
Aligning images: Translation?
common
picture
plane of
mosaic
image
Two samples
and their supports
for line-fitting
Hybrid multi-resolution registration
I.B. Image Based
Initial guess
F.B. Feature Based
I.B.
F.B.
F.B.
F.B.
Registration parameters
K. Pulli, M. Tico, Y. Xiong, X. Wang, C-K. Liang, “Panoramic Imaging System for Camera Phones”, ICCE 2010
Feature-based registration
Previous estimate Update search range
invalid
valid
Apply the previous
registration estimate New estimate
+ +
+ +
Actual
size
Applied
to hi-res
Image blending
Directly averaging the overlapped pixels results in ghosting artifacts
Moving objects, errors in registration, parallax, etc.
+
1 1
0 0
=
Solution for ghosting: Image labeling
Assign one input image to each output pixel
Optimal assignment can be found by graph cut [Agarwala et al. 2004]
Faster solution with block
dynamic programming
Input texture
B1 B2 B1 B2 B1 B2
2
_ =
overlap error min. error boundary
New artifacts
After labeling
Poisson blending
Pyramid Blending
The Laplacian pyramid
Gn expa
Ln = Gn
nd
G2
- = L2
G1 L1
- =
G0 L0
- =
Laplacian Pyramid: Blending
Laplacian
level
2
Laplacian
level
0