330 likes | 665 Views
Image Completion using Global Optimization. Presented by Tingfan Wu. The Image Inpainting Problem. Outline. Introduction History of Inpainting Camps – Greedy & Global Opt. Model and Algorithm Markov Random Fields (MRF) & Inpainting Belief Propagation (BP) Priority BP Results
E N D
Image Completion using Global Optimization Presented by Tingfan Wu
Outline • Introduction • History of Inpainting • Camps – Greedy & Global Opt. • Model and Algorithm • Markov Random Fields (MRF) & Inpainting • Belief Propagation (BP) • Priority BP • Results • Structural Propagation
Method Type PriorityTexture Synth. Need User Guidance
Exampled Based Method—Jigsaw Puzzle PatchesNot Available
Method Type PriorityTexture Synth. Need User Guidance
Ooops Greedy v.s Global Optmization Greedy Method Global Optimization Refine Globally Cannot go back
Outline • Introduction • History of Inpainting • Camps – Greedy & Global Opt. • Model and Algorithm • Markov Random Fields (MRF) & Inpainting • Belief Propagation (BP) • Priority BP • Results • Structural Propagation
Random Fields / Belief Network Random Variable(Observation) • RF:Random Variables on Graph • Node : Random Var. (Hidden State) • Belief : from Neighbors, and Observation Good Project Writer?(High Project grade) Smart Student?(High GPA) Good Test Taker?(High test score) Good Employee (No Observation yet) Edge: Dependency
Story about MRF • (Bayesian) Belief Network (DAG) • Markov Random Fields (Undirected, Loopy) • Special Case: • 1D - Hidden Markov Model (HMM) Hidden Markov Model (HMM) Office Helper Wizard
Inpainting as MRF optimization • Node : Grid on target region, overlapped patches • Edge : A node depends only on its neighbors • Optimal labeling (hidden state) that minimizing mismatch energy
MRF Potential Functions Mismatch (Energy) between .. • Vp (Xp ) : Source Image vs. New Label • Vpq(Xp, Xq) : Adjacent Labels • Sum of Square Distances (SSD) in Overlapping Region
Outline • Introduction • History of Inpainting • Camps – Greedy & Global Opt. • Model and Algorithm • Markov Random Fields (MRF) & Inpainting • Belief Propagation (BP) • Priority BP • Results • Structural Propagation
Belief Propagation(1/3) Good Project Writer?(High Project grade) Smart Student?(High GPA) Good Test Taker?(High test score) Good Employee (No Observation yet) • Undirected and Loopy • Propagate forward and backward
X X q p Belief Propagation(2/3) • Message Forwarding • Iterative algorithm until converge O(|Candidate|2) Candidates at Node Q Candidates at Node P Neighbors (P)
Priority BP • BP too slow: • Huge #candidates Timemsg = O(|Candidates|2) • Huge #Pairs Cannot cache pairwise SSDs. • Observations • Non-Informative messages in unfilled regions • Solution to some nodes is obvious (fewer candidates.)
Human Wisdom Candidates Start from non-ambiguous part And Search for Brown feather+green grass Nobody start from here
Priority BP • Observations • needless messages in unfilled regions • Solution to some nodes is obvious (fewer candidates.) • Solution: Enhanced BP: • Easy nodes goes first (priority message scheduling) • Keep only highly possible candidates (maintain a Active Set)
? ? ? ? ? ? ? ? Priority & Pruning Discard Blue Points High Priorityprune a lot Low Priority Candidates sorted by relative belief Pruning may miss correct label
#Candidates after Pruning Active Set (Darker means smaller) Histogram of #candidates Similar candidates
A closer look at Priority BP • Priority Calculation • Priority : 1/(#significant candidate) • Pruning (on the fly ) • Discard Low Confidence Candidates • Similar patches One representative (by clustering) • Result • More Confident More Pruning • Confident node helps increase neighbor’s confidence. • Warning: • PBP and Pruning must be used together
Outline • Introduction • History of Inpainting • Camps – Greedy & Global Opt. • Model and Algorithm • Markov Random Fields (MRF) & Inpainting • Belief Propagation (BP) • Priority BP • Results • Conclusion • Structural Propagation
Results-Inpainting(1/3) Darker pixels higher priority Automatically start from salient parts.
Results-Inpainting(3/3) • Up to 2minutes / image (256x170) on P4-2.4G
More : Texture Synthesis • Interpolation as well as extrapolation
Conclusion • Priority BP • {Confident node first} + {candidate pruning} • Generic – applicable to other MRF problems. • Speed up • MRF for Inpainting • Global optimization • avoid visually inconsistence by greedy • Priority BP for Inpainting • Automatically start from salient point.
Sometimes … • Image contains hard high-level structure • Hard for computers • Interactive completion guided by human.
Potential Func. For Structural Propagation • User input a guideline by human region. • Potential Function respect distance between lines Jian Sun et al, SIGGRAPH 2005
Video • Link:Microsoft Research