80
Applications of Image Motion Estimation I Mosaicing Harpreet S. Sawhney [email protected] Princeton University COS 429 Lecture Feb. 26, 2004

Applications of Image Motion Estimation I Mosaicing

  • Upload
    afram

  • View
    40

  • Download
    1

Embed Size (px)

DESCRIPTION

Applications of Image Motion Estimation I Mosaicing. Princeton University COS 429 Lecture Feb. 26, 2004. Harpreet S. Sawhney [email protected]. Visual Motion Estimation : Recapitulation. Plan. Explain optical flow equations Show inclusion of multiple constraints for solution - PowerPoint PPT Presentation

Citation preview

Page 1: Applications of Image Motion Estimation I Mosaicing

Applications of Image Motion Estimation I

Mosaicing

Harpreet S. [email protected]

Princeton UniversityCOS 429 Lecture

Feb. 26, 2004

Page 2: Applications of Image Motion Estimation I Mosaicing

Visual Motion Estimation : Recapitulation

Page 3: Applications of Image Motion Estimation I Mosaicing

Plan

• Explain optical flow equations

• Show inclusion of multiple constraints for solution

• Another way to solve is to use global parametric models

Page 4: Applications of Image Motion Estimation I Mosaicing

Brightness Constancy Assumption

)p(I1 )p(I2

p)p(up

Model image transformation as :

)p(I))p(up(I)p(I 112 ′== - BrightnessConstancy

ReferenceCoordinate

CorrespondingCoordinate

OpticalFlow

Page 5: Applications of Image Motion Estimation I Mosaicing

How do we solve for the flow ?

)p(I))p(up(I)p(I 112 ′== -

Use Taylor Series Expansion

)2(O)p(uI)p(I)p(I T112 +∇= -

Image Gradient

Convert constraint into an objective function

∑∈

∇Rp

2T1SSD ))p(I)p(uI()u(E δ+=

)p(I)p(I 12 -

Page 6: Applications of Image Motion Estimation I Mosaicing

Optical Flow Constraint Equation

)2(O)p(uI)p(I)p(I T112 +∇= -

0)p(I)p(uIT1 ≈+ δ∇

At a Single Pixel

Leads to

0IuIuI ty

yx

x =++

Normal FlowI

I- t

Page 7: Applications of Image Motion Estimation I Mosaicing

Multiple Constraints in a Region

∑∈

∇Rp

2T1SSD ))p(I)p(uI()u(E δ+=

X

Page 8: Applications of Image Motion Estimation I Mosaicing

Solution

0u

)u(ESSD =∂

∑∈

∇Rp

2T1SSD ))p(I)p(uI()u(E δ+=

∑∈

∇∇Rp

T1 0))p(I)p(uI(I =+ δ

∑ ∑∈ ∈

∇-∇∇Rp Rp

T1 IIu]II[ δ=

bAu =

Page 9: Applications of Image Motion Estimation I Mosaicing

Solution

bAu =

]III

III[A

R

2y

Ryx

Ryx

R

2x

= ∑∑

∑∑

δ

δ= ]

II

II[b

Ry

Rx

-

-

Observations:

• A is a sum of outer products of the gradient vector• A is positive semi-definite• A is non-singular if two or more linearly independent gradients are available• Singular value decomposition of A can be used to compute a solution for u

Page 10: Applications of Image Motion Estimation I Mosaicing

Another way to provide unique solution

Global Parametric Models

∑∈

∇Rp

2T1SSD ))p(I)p(uI()u(E δ+=

• u(p) is described using an affine transformation valid within the whole region R

tp)p(u +Η= ]hh

hh[H

2221

1211

= = ]t

t[t

2

1

T2122211211 ]tthhhh][

10yx00

0100yx[)p(u = βΒ= )p()p(u

∑∈

∇Rp

2T1SSD ))p(I)p(BI()u(E δ+β=

0u

)u(ESSD =∂ ∑ ∑

∈ ∈

∇-∇∇Rp Rp

TT1

T II)p(B)]p(BII)p(B[ δ=β

bA =β

Page 11: Applications of Image Motion Estimation I Mosaicing

Affine Motion

Good approximation for :– Small motions– Small Camera rotations– Narrow field of view camera– When depth variation in the scene is small

compared to the average depth and small motion

– Affine camera images a planar scene

Page 12: Applications of Image Motion Estimation I Mosaicing

Affine Motion

• Affine camera: ]Y

X[sp = ]

Y

X[sp

′′=′ • 3D Motion: TRPP +=′

xy23

13T22

yT2

xT1

TsZ]r

r[spRs]

TPr

TPr[sp ′+′+′=

+

+′=′

• A 3D Plane: η+βα=η+β+α= p][s

1YXZ

xy23

13T22 Tsp][

s

1]

r

r[spRsp ′+η+βα′+′=′

tHpp-p)p(u +=′=

Page 13: Applications of Image Motion Estimation I Mosaicing

Two More Ingredients for Success

• Iterative solution through image warping– Linearization of the BCE is valid only when u(p) is small– Warping brings the second image “closer” to the

reference

• Coarse-to-fine motion estimation for estimating a wider range of image displacements– Coarse levels provide a convex function with unique local

minima– Finer levels track the minima for a globally optimum

solution

Page 14: Applications of Image Motion Estimation I Mosaicing

Image Warping

))p(up(I)p(I 12 -=

• Express u(p) as: )p(u)p(u)p(u )k( δ+=

)p(I))p(up(I w1

)k(1 ≈-

u(p))-p(I)u(p)-)p(up(I)p(I w1

)k(12 δδ= ≈-

Target Image : EmptySource Image : Filled

p)p(up )k(-

Page 15: Applications of Image Motion Estimation I Mosaicing

Coarse-to-fine Image Alignment : A Primer

p

2

ΘΘ))u(p;(pI(p)I( 21min )

{ R, T, d(p) }{ H, e, k(p) }

{ dx(p), dy(p) }

d(p)

Warper -

Page 16: Applications of Image Motion Estimation I Mosaicing

Mosaics In Art

…combine individual chips to create a big picture...

Part of the Byzantine mosaic floor that has been preserved in the Church of Multiplication in Tabkha (near the Sea of Galilee).

www.rtlsoft.com/mmmosaic

Page 17: Applications of Image Motion Estimation I Mosaicing

Image Mosaics

• Chips are images.

• May or may not be captured from known locations of the camera.

Page 18: Applications of Image Motion Estimation I Mosaicing

OUTPUT IS A SEAMLESS MOSAIC

Page 19: Applications of Image Motion Estimation I Mosaicing

VIDEOBRUSH IN ACTION

Page 20: Applications of Image Motion Estimation I Mosaicing

WHAT MAKES MOSAICING POSSIBBLE…the simplest geometry...

Single Center of Projection for all Images

Images

Projection Surfaces

COP

Page 21: Applications of Image Motion Estimation I Mosaicing

Planar Mosaic Construction

• Align Pairwise: 1:2, 2:3, 3:4, ...• Select a Reference Frame• Align all Images to the Reference Frame• Combine into a Single Mosaic

1 2 3 4

Virtual Camera (Pan)Image Surface - PlaneProjection - Perspective

Page 22: Applications of Image Motion Estimation I Mosaicing

Key Problem What Is the Mapping From Image Rays to the Mosaic

Coordinates ?

ImagesCOP

P,P'

Rotations/HomographiesPlane Projective Transformations

RPP' cc Rpp '

RKppK ''

RKpKp 1''

pHp'

Page 23: Applications of Image Motion Estimation I Mosaicing

IMAGE ALIGNMENT IS A BASIC REQUIREMENT

Page 24: Applications of Image Motion Estimation I Mosaicing

PYRAMID BASED COARSE-TO-FINE ALIGNMENT… a core technology ...

• Coarse levels reduce search.

• Models of image motion reduce modeling complexity.

• Image warping allows model estimation without discrete feature extraction.

• Model parameters are estimated using iterative non-linear optimization.

• Coarse level parameters guide optimization at finer levels.

Page 25: Applications of Image Motion Estimation I Mosaicing

Assume that at the kth iteration, kΡ, is available

)p(ΡI)p(I)(pI wkww

model the residual transformation between the coordinate systems, wpand p, as:

D]p[Ipw

I(p)D|D

pI(p;0))(pID))(p;(pI 0D

wwwwww T

0D

w

|D

p

1ydxd

d)yd(1xd1ydxd

dyd)xd(1

p

3231

232221

3231

131211

w

2

2

0D

w

yxy1yx000

xyx0001yx|

D

p

D][IΡΡ (k)1)(k

ITERATIVE SOLUTION OF THE ALIGNMENT MODEL

Page 26: Applications of Image Motion Estimation I Mosaicing

ITERATIVE REWEIGHTED SUM OF SQUARES

• Given a solution )m(Θ at the mth iteration, find Θδ by solving :

k

ii

i

i

l il

l

i

k

i

i

i

θ

rr

r

)r(ρθ

θ

r

θ

r

r

)r(ρ

k

iw

• iw acts as a soft outlier rejecter :

2SS

σ

1

r

)r(ρ

222

2GM

)rσ(

σ2

r

)r(ρ

Page 27: Applications of Image Motion Estimation I Mosaicing

PROGRESSIVE MODEL COMPLEXITY…combining real-time capture with accurate alignment...

• Provide user feedback by coarsely aligning incoming frames with a low order model– robust matching that covers a wide search range– achieve about 6-8 frames a sec. on a Pentium 200

• Use the coarse alignment parameters to seed the fine alignment– increase model complexity from similarity, to affine, to

projective parameters– coarse-to-fine alignment for wide range of motions and

managing computational complexity

Page 28: Applications of Image Motion Estimation I Mosaicing

delay

estimateglobal shift

warp

)(tI

)1(ˆ tI

)(td

)(td

I (t 1)

COARSE-TO-FINE ALIGNMENT

Page 29: Applications of Image Motion Estimation I Mosaicing

VIDEO MOSAIC EXAMPLE

Princeton Chapel Video Sequence54 frames

Page 30: Applications of Image Motion Estimation I Mosaicing

UNBLENDED CHAPEL MOSAIC

Page 31: Applications of Image Motion Estimation I Mosaicing

Image Merging withLaplacian Pyramids

Image 1 Image 2

1 2

Combined Seamless Image

Page 32: Applications of Image Motion Estimation I Mosaicing

VORONOI TESSELATIONS W/ L1 NORM

Page 33: Applications of Image Motion Estimation I Mosaicing

BLENDED CHAPEL MOSAIC

Page 34: Applications of Image Motion Estimation I Mosaicing

1D vs. 2D SCANNING

• 1D : The topology of frames is a ribbon or a string.

Frames overlap only with their temporal neighbors.

• 2D : The topology of frames is a 2D graph Frames overlap with neighbors on many sides

(A 300x332 mosaic captured by mosaicing a 1D sequence of 6 frames)

Page 35: Applications of Image Motion Estimation I Mosaicing

1D vs. 2D SCANNING

The 1D scan scaled by 2 to 600x692 A 2D scanned mosaic of size 600x692

Page 36: Applications of Image Motion Estimation I Mosaicing

CHOICE OF 1D/2D MANIFOLD

Plane Cylinder Cone

Sphere Arbitrary

Page 37: Applications of Image Motion Estimation I Mosaicing
Page 38: Applications of Image Motion Estimation I Mosaicing
Page 39: Applications of Image Motion Estimation I Mosaicing

THE “DESMILEY” ALGORITHM

• Compute 2D rotation and translation between successive frames

• Compute L by intersecting central lines of each frame• Fill each pixel [l y] in the rectified planar mosaic by

mapping it to the appropriate video frame

Page 40: Applications of Image Motion Estimation I Mosaicing
Page 41: Applications of Image Motion Estimation I Mosaicing

2D MOSAICING THROUGH TOPOLOGY INFERENCE&

LOCAL TO GLOBAL ALIGNMENT

… automatic solution to two key problems ...

• Inference of 2D neighborhood relations (topology) between frames

– Input video just provides a temporal 1D ordering of frames

– Need to infer 2D neighborhood relations so that local constraints may be setup between pairs of frames

• Globally consistent alignment and mosaic creation

– Choose appropriate alignment model

– Local constraints incorporated in a global optimization

Page 42: Applications of Image Motion Estimation I Mosaicing

PROBLEM FORMULATION

Given an arbitrary scan of a scene

Create a globally aligned mosaic by minimizing

Gij i

iij EEE mosaic) theofArea (min 2

}{

iP

Like an MDL measure : Create a compact appearance while being geometrically consistent

Page 43: Applications of Image Motion Estimation I Mosaicing

ERROR MEASURE

Gij i

iij EEE mosaic) theofArea (min 2

}{

iP

where

ation transformdistortionleast like criterion prioria

for allow toerror term reference to Frame:

relations odneighborho therepresents that Graph :

and neighbors betweenerror alignment of measureAny :

mapping, image-to- Reference:

i

ij

E

G

jiE

XPuP iii

Page 44: Applications of Image Motion Estimation I Mosaicing

ALGORITHMIC APPROACH

From a 1D ordered collection of framesto

A Globally consistent set of alignment parameters

Iterate through

1. Graph Topology Determination

Given: pose of all framesEstablish neighborhood relations min(Area of Mosaic)

Graph G2. Local Pairwise Alignment

Given: GQuality measure validates hypothesized arcsProvides pairwise constraints

3. Globally Consistent Alignment

Given: pairwise constraintsCompute reference-to-frame pose parameters min ijE

Page 45: Applications of Image Motion Estimation I Mosaicing

GRAPH TOPOLOGY DETERMINATION

• Given: Current estimate of pose*

• Lay out each frame on the 2D manifold (plane, sphere, etc.)

• Hypothesize new neighbors based on– proximity

– predictability of relative pose

– non redundancy w.r.t. current G

• Specifically, try arc (i,j) ifNormalized Euclidean dist dij << Path distance Dij

• Validate hypothesis by local registration

• Add arc to G if good quality registration

* Initialize using low order frame-to-frame mosaic algorithm on a plane

dij

Dij

Page 46: Applications of Image Motion Estimation I Mosaicing

LOCAL COARSE & FINE ALIGNMENT

• Given: a frame pair to be registered

• Coarse alignment– Low order parametric model e.g. shift, or 2D R & T

– Majority consensus among subimage estimates

• Fine alignment [Bergen, ECCV 92]– Coarse to fine over Laplacian pyramid

– Progressive model complexity, up to projective

– Incrementally adjust motion parameters to minimize SSD

• Quality measure– Normalized correlation helps reject invalid registrations

Page 47: Applications of Image Motion Estimation I Mosaicing

GLOBALLY CONSISTENT ALIGNMENT

• Given: arcs ij in graph G of neighbors

• The local alignment parameters, Qij, help establish feature correspondence between i and j

• If uil and ujl are corresponding

points in frames i,j, then

211 |)()(| jljili PP uuEij

• Incrementally adjust poses Pi to minimize

ui uj

Eij

Gij i

iij EEE}{

miniP

Page 48: Applications of Image Motion Estimation I Mosaicing

SPECIFIC EXAMPLES : 1. PLANAR MOSAICS

• Mosaic to frame transformation model:

• Local Registration– Coarse 2D translation & fine 2D projective alignment

• Topology : Neighborhood graph defined over a plane– Initial graph topology computed with the 2D T estimates– Iterative refinement using arcs based on projective alignment

• Global Alignment

k

ijE2|)()(| jkjiki uAuA

2

1

2|)())()((|k

iE kkkjki AA

Pair Wise Alignment Error

Minimum Distortion Error

XPu i

Page 49: Applications of Image Motion Estimation I Mosaicing

PLANAR TOPOLOGY EVOLUTION

Whiteboard Video Sequence75 frames

Page 50: Applications of Image Motion Estimation I Mosaicing

PLANAR TOPOLOGY EVOLUTION

Page 51: Applications of Image Motion Estimation I Mosaicing

FINAL MOSAIC

Page 52: Applications of Image Motion Estimation I Mosaicing

SPECIFIC EXAMPLES : 2. SPHERICAL MOSAICS

• Frame to mosaic transformation model:

• Local Registration– Coarse 2D translation & fine 2D projective alignment

• Parameter Initialization– Compute F and R’s from the 2D projective matrices

• Topology : – Initial graph topology computed with the 2D R & T estimates on a plane– Subsequently the topology defined on a sphere– Iterative refinement using arcs based on alignment with F and R’s

• Global Alignment

k

ijE2|| jk

1jik

1i uFRuFR

XFRu iT

Page 53: Applications of Image Motion Estimation I Mosaicing

SPHERICAL MOSAICS

Sarnoff Library VideoCaptures almost the complete sphere

with 380 frames

Page 54: Applications of Image Motion Estimation I Mosaicing

SPHERICAL TOPOLOGY EVOLUTION

Page 55: Applications of Image Motion Estimation I Mosaicing

SPHERICAL MOSAICSarnoff Library

Page 56: Applications of Image Motion Estimation I Mosaicing

SPHERICAL MOSAICSarnoff Library

Page 57: Applications of Image Motion Estimation I Mosaicing

NEW SYNTHESIZED VIEWS

Page 58: Applications of Image Motion Estimation I Mosaicing

FINAL MOSAICPrinceton University Courtyard

Page 59: Applications of Image Motion Estimation I Mosaicing

Mosaicing from Strips

Mosaicfrom center strips

Image 1 Image 2 Image 3 Image 4 Image 5

Page 60: Applications of Image Motion Estimation I Mosaicing

Problem: Forward Translation

Page 61: Applications of Image Motion Estimation I Mosaicing

General Camera Motion

Parallel Flow: Straight Strip

Radial Flow (FOE): Circular Strip

• Strip Perpendicular to Optical Flow• Cut/Paste Strip (warp to make Optical Flow parallel)

Page 62: Applications of Image Motion Estimation I Mosaicing

Mosaic Construction

Mosaic

Page 63: Applications of Image Motion Estimation I Mosaicing

Simple Cases

0Max

0)(2

22 Myxb

0

a

v

u

by

bx

v

u

Horizontal Translation

Zoom

(M determines displacement)

(M determines radius)

Page 64: Applications of Image Motion Estimation I Mosaicing

Manifold for Forward Motion

• Stationary (but rotating) Camera – Viewing Sphere

• Translating Camera– Sphere carves a “Pipe” in space

Page 65: Applications of Image Motion Estimation I Mosaicing

Pipe Projection

One Image Sequence

Page 66: Applications of Image Motion Estimation I Mosaicing

Concatenation of Pipes

Page 67: Applications of Image Motion Estimation I Mosaicing

Forward Motion Mosaicing

Page 68: Applications of Image Motion Estimation I Mosaicing

Example: Forward Motion

Page 69: Applications of Image Motion Estimation I Mosaicing

Side View of Mosaic

Page 70: Applications of Image Motion Estimation I Mosaicing

Forward Mosaicing II

Page 71: Applications of Image Motion Estimation I Mosaicing

Mosaic Construction

Page 72: Applications of Image Motion Estimation I Mosaicing

OmniStereo: Stereo in Full 360o Two Panoramas: One for Each Eye

Each panorama can be mapped on a cylinder

Page 73: Applications of Image Motion Estimation I Mosaicing

Paradigm: A Rotating Stereo Pair of Slit Cameras

•Rays are tangent to viewing circle (Gives 360o stereo)

•Image planes are

radial

(Makes mosaicing difficult)

Page 74: Applications of Image Motion Estimation I Mosaicing

Panoramic Projections of Slit Cameras

Image Surface

Left Eye panorama (viewing circle)Projection rays tilted right

Right Eye panorama (viewing circle)Projection rays tilted left

Directional Viewpoints

Regular panorama (single viewpoint):Projection rays orthogonal to cylinder

Page 75: Applications of Image Motion Estimation I Mosaicing

Image Plane

PinholeAperture

(a) (b)Center Strip

(c)Side Strip

Vertical Slit

Slit Camera Model

•Center Strip: Rays perpendicular to image plane

•Side Strip: Rays tilted from image plane

Page 76: Applications of Image Motion Estimation I Mosaicing

Stereo Panorama from Strips

Left-eye-Panoramafrom right strips

Right-eye-Panoramafrom left strips

Image 1 Image 2 Image 3 Image 4 Image 5

Page 77: Applications of Image Motion Estimation I Mosaicing

MultiView Panoramas

0

180

360

Regular Panorama

Left-EyePanorama

Right-Eye Panorama

Page 78: Applications of Image Motion Estimation I Mosaicing

Stereo Panorama from VideoStereo Panorama from Video

Stereo viewing with Red/Blue Glasses

Page 79: Applications of Image Motion Estimation I Mosaicing

Viewing Panoramic Stereo Printed Cylindrical Surfaces

• Print panorama on a cylinder

• No computation needed!!!

Page 80: Applications of Image Motion Estimation I Mosaicing