630 likes | 988 Views
Fast and High Quality Overlap Repair for Patch-Based Texture Synthesis Andrew Nealen Marc Alexa Discrete Geometric Modeling Group (DGM) Technische Universität Darmstadt. n x m Input Texture. N x M Output Texture. Our Setting: 2D Texture Synthesis.
E N D
Fast and High Quality Overlap Repair for Patch-Based Texture SynthesisAndrew NealenMarc AlexaDiscrete Geometric Modeling Group (DGM)Technische Universität Darmstadt
nxm Input Texture NxM Output Texture Our Setting: 2D Texture Synthesis • The goal: Synthesize an output texture which isperceptually similarto the input texture. Also ensure that the result contains sufficient variation.
Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B 2 _ Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B 2 _ = overlap error Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B 2 _ = overlap error Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B 2 _ = overlap error Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
A B 2 _ = overlap error Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
Patch-Based Texture SynthesisSome Existing Methods • A Very Popular 2D Texture Synthesis Method • Image Quilting [Efros and Freeman 2001] • Graphcut Texures [Kwatra et. al 2003] • Wang Tiles [Cohen et. al 2003]
Patch-Based Texture SynthesisHybrid Texture Synthesis (HTS) • Introduced at EGSR 2003 [Nealen and Alexa] • Adaptive Patch Sampling, like Hierarchical Pattern Mapping [Soler et. al 2002] • Per-Pixel Overlap Re-synthesis
Input (n x m) Intermediate Result Goal: From nxm, synthesize NxM similar, but not identical Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod
Input (n x m) Intermediate Result Hybrid Texture SynthesisMethod Goal: From nxm, synthesize NxM similar, but not identical Result (N x M) Result (N x M)
Patch-Search in the Input + Copy to Result + Mark Invalid Pixels Input (n x m) Intermediate Result Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod Goal: From nxm, synthesize NxM similar, but not identical
Patch-Search in the Input + Copy to Result + Mark Invalid Pixels Input (n x m) Intermediate Result Per-Pixel Re-synthesis Steps (for each Patch) Goal: From nxm, synthesize NxM similar, but not identical Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod
Patch-Search in the Input + Copy to Result + Mark Invalid Pixels Input (n x m) Intermediate Result Per-Pixel Re-synthesis Steps (for each Patch) Goal: From nxm, synthesize NxM similar, but not identical Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod
Patch-Search in the Input + Copy to Result + Mark Invalid Pixels Input (n x m) Intermediate Result Per-Pixel Re-synthesis Steps (for each Patch) Goal: From nxm, synthesize NxM similar, but not identical Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod
Patch-Search in the Input + Copy to Result + Mark Invalid Pixels Input (n x m) Intermediate Result Per-Pixel Re-synthesis Steps (for each Patch) Goal: From nxm, synthesize NxM similar, but not identical Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod
Patch-Search in the Input + Copy to Result + Mark Invalid Pixels Input (n x m) Intermediate Result Per-Pixel Re-synthesis Steps (for each Patch) Result (N x M) Result (N x M) Hybrid Texture SynthesisMethod Goal: From nxm, synthesize NxM similar, but not identical
Hybrid Texture SynthesisGeneralization: Pro and Con • Pro: General Method for Overlap Repair • Complementary to other Methods, such as Minimum-Error-Boundary-Cut (MEBC) or Feathering, yet oftentimes produces better results • Generalizes to arbitrary patch shapes, i.e. is applicable to Graphcut Textures, Wang Tiles, etc. • Con: Computationally Expensive • Exhaustive search for each invalid pixel in the overlap, based on mostly irregular valid neighborhood • Has O(rN log N) complexity -> Doesn‘t scale well.
Hybrid Texture SynthesisGeneralization: Pro and Con • Pro: General Method for Overlap Repair • Complementary to other Methods, such as Minimum-Error-Boundary-Cut (MEBC) or Feathering, yet oftentimes produces better results • Generalizes to arbitrary patch shapes, i.e. is applicable to Graphcut Textures, Wang Tiles, etc. • Con: Computationally Expensive • Exhaustive search for each invalid pixel in the overlap, based on mostly irregular valid neighborhood • Has O(rN log N) complexity -> Doesn‘t scale well.
Hybrid Texture SynthesisGeneralization: Pro and Con • Pro: General Method for Overlap Repair • Complementary to other Methods, such as Minimum-Error-Boundary-Cut (MEBC) or Feathering, yet oftentimes produces better results • Generalizes to arbitrary patch shapes, i.e. is applicable to Graphcut Textures, Wang Tiles, etc. • Con: Computationally Expensive • Exhaustive search for each invalid pixel in the overlap, based on mostly irregular valid neighborhood • Has O(rN log N) complexity -> Doesn‘t scale well.
Fast Overlap RepairBasic Idea • Inspiration • Ashikhmin: Synthesizing Natural Textures [2001] termed Coherence Search • Tong et. al‘s extension: k-Coherence Search [2002] • Basic Idea: Intelligently Reduce Search Space • Only search within a set of coherent pixels • Introduce Trade-off between quality and speed
Input Texture Intermediate Result + Source Map Fast Overlap Repair Coherence Search • Applying Coherence Search • For each pixel in the output, store its location in the input in a source map (same size as the output texture)
Source Map Lookup Input Texture Intermediate Result + Source Map Fast Overlap Repair Coherence Search • Applying Coherence Search • When searching for a new pixel, only consider input pixels which are coherent with neighboring output pixels
Source Map Lookup Input Texture Intermediate Result + Source Map Consequence in this example: Only two possible candidates Fast Overlap Repair Coherence Search • Applying Coherence Search • When searching for a new pixel, only consider input pixels which are coherent with neighboring output pixels
Example: 64x64 Texture Synthesized from four 32x32 Patches Coherence Exhaustive Fast Overlap Repair Coherence Search • Applying Coherence Search • Simply comparing to the coherent pixels results in seams similar to Image Quilting (MEBC)
Example: 64x64 Texture Synthesized from four 32x32 Patches Coherence Exhaustive Fast Overlap Repair Coherence Search • Applying Coherence Search • Simply comparing to the coherent pixels results in seams similar to Image Quilting (MEBC)
Example: 64x64 Texture Synthesized from four 32x32 Patches Coherence Exhaustive Fast Overlap Repair Coherence Search • Applying Coherence Search • Simply comparing to the coherent pixels results in seams similar to Image Quilting (MEBC)
Source Map Lookup Input Texture Intermediate Result + Source Map Fast Overlap Repair k-Coherence Search • Better: Applying k-Coherence Search
Source Map Lookup Input Texture Intermediate Result + Source Map Fast Overlap Repair k-Coherence Search • Better: Applying k-Coherence Search • Extend the set by the k-nearest neighbors (knn) of each coherent pixel (in feature space) and remove duplicates
Fast Overlap Repair k-Coherence Search • Precomputation of knn Data Structure • Performed once for each nxm input texture and stored for repeated use • User defines size of box-shaped neighborhood np • For each of the nxm input pixels • Construct feature vector by ordered concatenation of the npx npRGB-triples in the box-shaped neighborhood • Dimension reduction (75-90%) by applying PCA • Compute indices of k-nearest neighbors to each pixel
Fast Overlap Repair k-Coherence Search • Source Map Maintenance • Each valid pixel in the overlap region is a linear blend (feathering) of at least two original pixel values, i.e. from at least two different sources • To avoid the maintenance of multiple source maps, simply store the source of the pixel with greatest contribution in a singlesource map Blue: invalid overlap pixels
k = 1 k = 4 k = 11 Exhaustive Results varying k
k = 1 k = 4 k = 11 Exhaustive Results varying k
k = 1 k = 4 k = 11 Exhaustive Results varying k
k = 1 k = 4 k = 11 Exhaustive Results varying k
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.
Results timings Exhaustive n = 7x7 k-Coherence n = 3x3 | k = 5 k-Coherence n = 5x5 | k = 11 Input scales 64×64 δmax = 0.02 Δmax = 0.05 Pre: 0 sec. Synth: 283 sec. Pre: 6+3 sec. Synth: 226 sec. Pre: 6+4 sec. Synth: 427 sec. rock 128×128 δmax = 0.02 Δmax = 0.05 Pre: 45+62 sec. Synth: 226 sec. Pre: 45+74 sec. Synth: 415 sec. Pre: 0 sec. Synth: 533 sec. stonewall 200×200 δmax = 0.02 Δmax = 0.03 Pre: 0 sec. Synth: 985 sec. Pre: 247+28 s Synth: 178 sec. Pre: 247+37 s Synth: 350 sec.