Title: Dynamic Texture Synthesis
1Dynamic Texture Synthesis
Google Inc.
2Acknowledgements
- For slides
- Arno Schödl
- For making this course happen
- Li-Yi Wei
- Sylvain Lefebvre
- Greg Turk
- Other contributors
- Antonio Criminisi
- Alexei A. Efros
- Aaron Hertzmann
- Yanxi Liu
3Still photos
4Video Clips
5Video Textures
6Spatio-temporal Textures
7Spatio-Temporal Textures
8Controllable Texture Animation
93D Flow and Texture
10This Talk
- Focus on the presented examples
- Video Textures
- Graphcut Textures
- Texture Optimization for Flow Guided Synthesis
- Fluid Texturing
- Relate to 2D texture synthesis along the way
11Video Textures
- Schödl et al.00
- Synthesize infinitely long videos
- Find transitions by matching frames
time
time
12Finding good transitions
- Compute L2 distance Di, j between all frames
frame i
frame j
Similar frames make good transitions
13Transition costs
- Transition from i to j if successor of i is
similar to j - Cost function Ci?j Di1, j
-
14Probabilistic Transitions
- Probability for transition Pi?j inversely related
to cost - Pi?j exp ( Ci?j / s2 )
high ?
low ?
15Preserving dynamics
16Preserving dynamics
17Preserving dynamics
- Cost for transition i?j
- Ci?j wk Dik1, jk
18Preserving dynamics effect
- Cost for transition i?j
- Ci?j wk Dik1, jk
19Region-based analysis
- Divide video up into regions
- Generate a video texture for each region
20Limitation
- Problematic (blurry) for chaotic motions
21Graphcut Textures
- Seamless transitions for spatio-temporal
extension - (Kwatra et al. 2003)
22Related work
- Image Quilting (Efros Freeman01)
- Seamless texture synthesis in 2D
- Find seams between image patches
- Dynamic Programming
23Graph cuts for Video
- Find seams in video
-
- Seam is a surface in 3D space-time
- Dynamic programming intractable in 3D
24Approach (Image case)
- Treat the whole input as a single patch
- Perceptual matching at two scales
- Patch Placement (coarse scale)
- Seam Optimization (fine scale)
25Approach (Video case)
- Spatio-temporal offset for a video patch
- More flexibility in copying pixels
- Allows spatial extension of video
time
space
26Seam Optimization
- Based on
- Energy Minimization via Graph Cuts(Boykov et
al.99) - Originally developed for stereo
27Seam Optimization
B
Construct graph such thatGraph Mincut ? Best
Seam
1
4
7
1
4
7
2
5
8
2
5
8
3
6
9
3
6
9
A
28Seam Optimization
B
Construct graph such thatGraph Mincut ? Best
Seam
A
29Seam Optimization
B
Potential Seam Cost
Constraint
20
100
8
8
1
4
7
30
8
8
40
10
A
B
2
5
8
35
8
8
15
85
3
6
9
30Seam Optimization
B
1
4
7
2
5
8
3
6
9
Seam
A
20
1
4
7
30
10
A
B
2
5
8
15
3
6
9
31Results Image Textures
32Results Natural images
33Results Perspective
34Video Results
35Spatio-Temporal Extension
36Spatio-Temporal Extension
37Spatio-Temporal Extension
38Results Interactive Merging
39Results Interactive Merging
40Results Interactive Merging
41Back to Dynamic Textures
- Graph cuts preserve natural appearance
- BUT how do we control behavior ?
42Fluid Texturing
- Combine
- Motion from Simulation
- Appearance from Texture
43Fluid Texturing
44Related Problem in 2D
- Flow-guided texture animation
- 2D Planar flow fields
Texture
Flow Field
Output
45Flow-guided Texture Animation
- Flow consistency
- Perceived motion similar to flow
- Texture similarity
- Shape, size, orientation of texture elements
similar to source
Source Texture
Texture Similarity
FlowConsistency
Flowing Target
Target Flow
46Naive Approach
- Ignore Texture Similarity
- Warp each frame via flow field
Source Texture
Warp
TargetFrames
X1
Xn
X0
Texture Similarity
FlowConsistency
Flowing Target
Target Flow
47Naive Approach
- Texture structure not maintained
Source Texture
Texture Similarity
FlowConsistency
Flowing Target
Target Flow
48Instead of
TargetFrames
49Instead of
TargetFrames
50Our Approach
TargetFrames
51Correct Operation
TargetFrames
X
X
Correct
Warp
W
52Correct Operation
TargetFrames
X
X
Correct
Flow Consistency
Warp
W
53Correct Operation
Source
Texture Similarity
TargetFrames
X
X
Correct
Flow Consistency
Warp
W
54Optimization of Energy / Cost
- Energy Flow Energy Texture Energy
Source
Texture Similarity
TargetFrames
X
X
Correct
Flow Consistency
Warp
W
55Flow Energy
TargetFrames
X
X
Flow Energy
Warp
W
56Texture Energy
- Tricky!
- Pixel-by-pixel comparison of source and target
not possible - Compare texture elements
- Local pixel neighborhoods
- Want each target neighborhood to be similar to
some source neighborhood
57Texture Energy
Z(source)
X(target frame)
58Energy for Single Neighborhood
Z(source)
p (pixel)
X(target frame)
59Energy for Single Neighborhood
Z(source)
Xp (neighborhood)
X(target frame)
60Energy for Single Neighborhood
Z(source)
Xp (neighborhood)
X(target frame)
61Energy for Single Neighborhood
(nearest neighbor) Zp
Z(source)
Xp (neighborhood)
X(target frame)
62Energy for Single Neighborhood
(nearest neighbor) Zp
Z
Xp (neighborhood)
Texture Energy(single neighborhood)
X
63Texture Energy for Entire Image
Z
X
64Texture Energy for Entire Image
Z
X
? individual neighborhood energy
65Optimization
- Optimize Total Energy of target frame
-
-
- Initialize X ? W(target frame ? warped frame)
- Iteratively improve target frame
66Optimization
- Two variables we need to optimize over
-
67Optimization
- Two variables we need to optimize over
-
Target Frame
68Optimization
- Two variables we need to optimize over
-
Source Neighborhoods
69Optimization
- Alternate between the two
-
70Iterative Algorithm
- Step 1
- Minimize E( X ) w.r.t Zp
- Find Nearest Source Neighborhoods
71Iterative Algorithm
- Step 2
- Minimize E( X ) w.r.t X
- Set ? Solve Linear System
72Iterative Algorithm
- Step 2
- Minimize E( X ) w.r.t X
- Set ? Diagonal Matrix in this
case
73Texture Energy Alone
Source
Texture Similarity
X
X
Correct
Flow Consistency
W
74Texture Energy Graph
- Random Initialization
- Multiple
- Resolution Levels
- Neighborhood Sizes
- Progressively refined output
75Texture Energy Graph
- Random Initialization
- Multiple
- Resolution Levels
- Neighborhood Sizes
- Progressively refined output
76Results Flow-guided Synthesis
773D Fluid Texturing
- Combine
- Motion from Simulation
- Appearance from Texture
783D Fluid Texturing
- Texture synthesis over dynamic fluid surface
- Governed by simulated velocity field
time
793D Fluid Texturing
- Texture information stored on mesh vertices
- Color
- Local texture orientation
time
80Texture Representation
- Orientation vector field
- 2D coordinate system at each sample point
81Recall Texture Energy
Nearest Neighbor
Xp
Zp
Texture Energy(single neighborhood)
82Fluid Simulation
- Navier-Stokes Equations (incompressible)
Momentum Conservation
Mass Conservation
83Fluid Simulation
- Navier-Stokes Equations (incompressible)
Momentum Conservation
Transport / Advection
84Fluid Simulation
- Navier-Stokes Equations (incompressible)
Transport / Advection
Advection of Passive Scalar Quantities
85Dynamic Fluid Surface
- Level Set of Advected Implicit function
Advection of Passive Scalar Quantities
86Dynamic Fluid Surface
- Level Set of Advected Implicit function
No Correspondence between Surfaces!
Advection of Passive Scalar Quantities
87Texture Transport
- Texture Information
- Color
- Orientation
- No correspondence between surfaces
88Color Transport
- Back-track source of each vertex
Surfacen1
Surfacen
2D Illustration
89Color Transport
- Back-track source of each vertex
Surfacen1
Surfacen
2D Illustration
90Color Transport
- Back-tracking source
- Scalar advection of vertex coordinates
-
- ? Spatial coordinate u Velocity vector
91Texture Transport
- Texture Information
- Color
- Orientation (needs special handling)
92Orientation Vector Transport
- Orientation is a vector
- Scalar advection only translates the vector
Scalar Advection of Components
Original Orientation
Velocity Field
93Orientation Vector Transport
- Orientation is a vector
- Need to take rotation into account
Vector Advection
Scalar Advection of Components
Original Orientation
Velocity Field
94Orientation Vector Transport
- Novel Formulation
- d Orientation vectoru Velocity
95Orientation Vector Transport
Scalar advection term
d Orientation vectoru Velocity
96Orientation Vector Transport
Distortion term
d Orientation vectoru Velocity
97Orientation Vector Transport
Distortion term
u2
2
d
u1
1
d Orientation vectoru Velocity
98Orientation Vector Transport
Distortion term
u2
2
d (u2-u1)?t
d
u1
1
d Orientation vectoru Velocity
99Orientation Vector Transport
Projection term(keeps d a unit vector)
d Orientation vectoru Velocity
100Results
101Feature-guided Texturing
- Correlate texture with fluid features
- Curl, divergence, curvature
102Results
103Results
104Results
105Results
106Limitations
- Linear Solve may cause blurriness
- Solution Discrete Optimization Han06
- Can get stuck in local minima
- Very slow (especially on surfaces)\
- Exploit parallel hardware
- Nearest neighbor queries can be made in parallel
107Questions?