Graph Cuts, MRFs and Graphcut Textures
CS448V — Computational Video Manipulation April 2019
Graph Cuts, MRFs and Graphcut Textures CS448V Computational Video - - PowerPoint PPT Presentation
Graph Cuts, MRFs and Graphcut Textures CS448V Computational Video Manipulation April 2019 What makes this a texture? What makes this a texture? stationary What makes this a texture? Local What makes this a
CS448V — Computational Video Manipulation April 2019
What makes this a “texture”?
What makes this a “texture”?
What makes this a “texture”?
stationary
What makes this a “texture”?
Local
Stochastic Regular
Stochastic Regular Texture?
[Kwatra et al. 2003]
[Wexler et al. 2004]
[Wexler et al. 2004]
[Wexler et al. 2004]
[Wexler et al. 2004]
Kwatra et al. 2003
Kwatra et al. 2003
s t
s t
Partition (S, T) ∣ s ∈ S, t ∈ T
s t
Partition (S, T) ∣ s ∈ S, t ∈ T 5 4 2 11 Capacity(S, T) = sum of edge weights (leaving) S
s t
5 4 2 11 12 1 3 20 3 1 4 7 3
s t
5 4 2 11 12 1 3 20 3 1 4 7 3 What is a flow?…
s t
5 4 2 11 12 1 3 3 1 Capacity of min-cut: 6 4 7 3 20
s t
5 4 2 11 12 1 3 3 3 1 Capacity of min-cut: 6 4 7 6 4 2 4 3 3 3 20 Max-flow from s to t: 6
Many variants:
Many variants:
Many many applications!
1 2 3 4 A B C D
1 2 3 4 A B C D s t
1 2 3 4 A B C D s t
1 2 3 4 A B C D s t
we will use a similar trick…
Back to Graphcut Textures…
“Chernobyl harvest”
Where to place next patch? Which pixels to use?
Graph cuts to the rescue
Graph cuts to the rescue
Graph cuts to the rescue
s t M(s, t)
Graph cuts to the rescue
M(s, t) = ∥A(s) − B(s)∥ + ∥A(t) − B(t)∥
s t M(s, t)
1 4 S1 New Patch B
1 4 S1 New Patch B
Old seam cost
1 4 S1 New Patch B
Old seam cost 1 from old 4 from new
1 4 S1 New Patch B
Old seam cost 1 from old 4 from new 4 from old 1 from new
1 4 S1 New Patch B
Old seam cost 1 from old 4 from new 4 from old 1 from new Cut at most one edge!
1 4 S1 New Patch B
Old seam cost 1 from old 4 from new 4 from old 1 from new Cut at most one edge! M should be a metric
Kept old seam
Updated seam
Removed seam
What might happen if we only connect a few pixels to B?
Minor detour: MRFs
Reminder: Markov property
Reminder: Markov property “memoryless”
Reminder: Markov property “memoryless” For a discrete process: P(Xn = xn|Xn−1 = xn−1, …, X0 = x0) = P(Xn = xn|Xn−1 = xn−1)
Reminder: Markov property “memoryless” For a discrete process: P(Xn = xn|Xn−1 = xn−1, …, X0 = x0) = P(Xn = xn|Xn−1 = xn−1) What about fields?
Reminder: Markov property “memoryless” For a discrete process: P(Xn = xn|Xn−1 = xn−1, …, X0 = x0) = P(Xn = xn|Xn−1 = xn−1) What about fields? two non-adjacent variables are conditionally independent given all other variables
Reminder: Markov property “memoryless” For a discrete process: P(Xn = xn|Xn−1 = xn−1, …, X0 = x0) = P(Xn = xn|Xn−1 = xn−1) What about fields? A variable is conditionally independent
given its neighbors
Reminder: Markov property “memoryless” For a discrete process: P(Xn = xn|Xn−1 = xn−1, …, X0 = x0) = P(Xn = xn|Xn−1 = xn−1) What about fields? two subsets are conditionally independent given a separating subset
What does it mean in our setting?
Where to place next patch? Which pixels to use?
What would be the “right” thing to do, assuming no runtime constraints?
Temporally stationary Spatio-temporally stationary
Temporally stationary Spatio-temporally stationary
How should this affect patch search strategy?
Temporally stationary
+
Per-pixel transition timing
Temporally stationary Spatio-temporally stationary
Spatio-temporally stationary
Can search patches in time and space!
Spatio-temporally stationary
Can search patches in time and space!
Robust results even for short sequences
Spatio-temporally stationary
Can search patches in time and space!
Robust results even for short sequences Can make videos larger
Harder to create loops. Why?
Harder to create loops. Why?
time
Harder to create loops. Why?
time
Solution: explicitly force beginning and end to match
Harder to create loops. Why?
time time
Solution: explicitly force beginning and end to match
representations of an image
representations of an image
representations of an image
applications later in the course (using more recent methods)