Two Patch-based Algorithms for By-example Texture Synthesis

Slides:



Advertisements
Similar presentations
Filling Algorithms Pixelwise MRFsChaos Mosaics Patch segments are pasted, overlapping, across the image. Then either: Ambiguities are removed by smoothing.
Advertisements

Image Quilting and Apples
Andrew Nealen and Marc Alexa, Discrete Geometric Modeling Group, TU Darmstadt, 2004 Fast and High Quality Overlap Repair for Patch-Based Texture Synthesis.
CSCE 643 Computer Vision: Template Matching, Image Pyramids and Denoising Jinxiang Chai.
Principal Component Analysis Based on L1-Norm Maximization Nojun Kwak IEEE Transactions on Pattern Analysis and Machine Intelligence, 2008.
Texture. Limitation of pixel based processing Edge detection with different threshold.
Data-driven methods: Texture (Sz 10.5) Cs129 Computational Photography James Hays, Brown, Spring 2011 Many slides from Alexei Efros.
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Texture Synthesis on [Arbitrary Manifold] Surfaces Presented by: Sam Z. Glassenberg* * Several slides borrowed from Wei/Levoy presentation.
Mixed-Resolution Patch- Matching (MRPM) Harshit Sureka and P.J. Narayanan (ECCV 2012) Presentation by Yaniv Romano 1.
Procedural Content Tiling
Texture. Edge detectors find differences in overall intensity. Average intensity is only simplest difference. many slides from David Jacobs.
More details on presentations Aim to speak for ~50 min (after 15 min review, leaving 10 min for discussions) Try to plan discussion topics It’s fine to.
December 5, 2013Computer Vision Lecture 20: Hidden Markov Models/Depth 1 Stereo Vision Due to the limited resolution of images, increasing the baseline.
Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.
1 Image Completion using Global Optimization Presented by Tingfan Wu.
Lapped Textures Emil Praun Adam Finkelstein Hugues Hoppe Emil Praun Adam Finkelstein Hugues Hoppe Princeton University Microsoft Research Princeton University.
Announcements Project 4 questions? Guest lectures Thursday: Richard Ladner “tactile graphics” Next Tuesday: Jenny Yuen and Jeff Bigham.
Image Quilting for Texture Synthesis & Transfer Alexei Efros (UC Berkeley) Bill Freeman (MERL) +=
Texture Synthesis by Non-parametric Sampling / Image Quilting for Texture Synthesis & Transfer by Efros and Leung / Efros and Freeman ICCV ’99 / SIGGRAPH.
Overview of Texture Synthesis Ganesh Ramanarayanan Cornell Graphics Seminar.
Image Quilting for Texture Synthesis and Transfer Alexei A. Efros1,2 William T. Freeman2.
Texture Synthesis on Surfaces Paper by Greg Turk Presentation by Jon Super.
Announcements For future problems sets: matlab code by 11am, due date (same as deadline to hand in hardcopy). Today’s reading: Chapter 9, except.
Texture Reading: Chapter 9 (skip 9.4) Key issue: How do we represent texture? Topics: –Texture segmentation –Texture-based matching –Texture synthesis.
Region Filling and Object Removal by Exemplar-Based Image Inpainting
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
Near-Regular Texture Analysis and Manipulation Written by: Yanxi Liu Yanxi Liu Wen-Chieh Lin Wen-Chieh Lin James Hays James Hays Presented by: Alex Hadas.
Graphcut Texture: Image and Video Synthesis Using Graph Cuts
Texture Synthesis by Non-parametric Sampling Alexei Efros and Thomas Leung UC Berkeley.
Shape Matching for Model Alignment 3D Scan Matching and Registration, Part I ICCV 2005 Short Course Michael Kazhdan Johns Hopkins University.
Light Using Texture Synthesis for Non-Photorealistic Shading from Paint Samples. Christopher D. Kulla, James D. Tucek, Reynold J. Bailey, Cindy M. Grimm.
Texture Optimization for Example-based Synthesis Vivek Kwatra Irfan Essa Aaron Bobick Nipun Kwatra.
Image Quilting for Texture Synthesis and Transfer Alexei A. Efros (UC Berkeley) William T. Freeman (MERL) Siggraph01 ’
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 26 Texture Synthesis Ravi Ramamoorthi Slides, lecture.
Synthesis of Compact Textures for real-time Terrain Rendering Nader Salman 22 juin 2007 Encadrant : Sylvain Lefebvre.
Synthesizing Natural Textures Michael Ashikhmin University of Utah.
Towards Real-Time Texture Synthesis With the Jump Map Steve Zelinka Michael Garland University of Illinois at Urbana-Champaign Thirteenth Eurographics.
2D Texture Synthesis Instructor: Yizhou Yu. Texture synthesis Goal: increase texture resolution yet keep local texture variation.
Graphcut Textures Image and Video Synthesis Using Graph Cuts
Two Patch-based Algorithms for By-example Texture Synthesis Bruno Galerne MAP5, Université Paris Descartes 1 Master 2 Traitement.
CS 691B Computational Photography
Geometry Synthesis Ares Lagae Olivier Dumont Philip Dutré Department of Computer Science Katholieke Universiteit Leuven 10 August, 2004.
Partial Shape Matching. Outline: Motivation Sum of Squared Distances.
Texture Synthesis by Image Quilting CS766 Class Project Fall 2004 Eric Robinson.
Hebrew University Image Processing Exercise Class 8 Panoramas – Stitching and Blending Min-Cut Stitching Many slides from Alexei Efros.
Spectral Methods for Dimensionality
Image Representation and Description – Representation Schemes
Graphcut Textures:Image and Video Synthesis Using Graph Cuts
an introduction to: Deep Learning
Photorealistic Rendering vs. Interactive 3D Graphics
Announcements Project 4 out today help session at the end of class.
Detail Preserving Shape Deformation in Image Editing
Computational Photography Derek Hoiem, University of Illinois
Image gradients and edges
Texture Synthesis by Non-parametric Sampling
What have we learned so far?
Announcements Final Project 3 artifacts Evals
By: Kevin Yu Ph.D. in Computer Engineering
Advanced Artificial Intelligence
Texture Quality Extensions to Image Quilting
Fast Pattern Simulation Using Multi‐Scale Search
Texture.
Image Quilting for Texture Synthesis & Transfer
Seam Carving Project 1a due at midnight tonight.
Segmentation (continued)
Announcements Guest lecture next Tuesday
Fourier Transform of Boundaries
An introduction to: Deep Learning aka or related to Deep Neural Networks Deep Structural Learning Deep Belief Networks etc,
Presentation transcript:

Two Patch-based Algorithms for By-example Texture Synthesis Bruno Galerne bruno.galerne@parisdescartes.fr MAP5, Université Paris Descartes Master 2 Traitement d’Images Cours “Champs aléatoires, modélisation de textures” Slide credits: Alyosha Efros, Bill Freeman (SIGGRAPH presentation) Rob Fergus NYU course

Textures Texture depicts spatially repeating patterns Many natural phenomena are textures radishes rocks yogurt

The Goal of Texture Synthesis input image SYNTHESIS True (infinite) texture generated image Given a finite sample of some texture, the goal is to synthesize other samples from that same texture

Challenge Need to model the whole spectrum: from repeated to stochastic texture Micro-textures and macro-textures repeated stochastic Both?

Outline The “Alexei Efros course” TP Texture Synthesis by Non-parametric Sampling [Efros & Leung, ICCV’99] Image Quilting for Texture Synthesis & Transfer [Efros & Freeman, SIGGRAPH 2001] TP Test Efros-Leung with IPOL demo Implement Image Quilting in Scilab! (with some help)

Improvements… Of course many more contributions and improvements since 1999 Multi-scale approach [Wei & Levoy, 2000] … with global optimization instead of sequential synthesis [Kwatra et al. 2003, Kwatra et al. 2005] … with parallel evaluation [Lefebvre & Hoppe, 2005]

Importance of [Efros & Leung ’99] First paper with patch-based algorithm Concept of redundancy of patches Strong influence for many applications Inpainting Image editing (Image analogies, PatchMatch) Denoising (Non-Local Means algorithm)

Texture Synthesis by Non-parametric Sampling [Efros & Leung, ICCV’99] IPOL demo [Aguerrebere, Gousseau, Tartavel, 2013]

Shannon Shannon’s approach for text synthesis Markov model Draw an N-gram with marginal distribution Add characters sequentially using the conditional distribution of N-gram given the first N-1 characters Using 4-grams: THE GENERATED JOB PROVIDUAL BETTER TRAND THE DISPLAYED COVE ABOVERY

Shannon for Texture Synthesis? Differences between textures and texts for applying Shannon’s approach No natural order in a 2D pixel grid Pixel similarity: two close pixel values can be changed without altering the texture while it is not possible for udys (= text +/- 1) Compute the conditional probability is not feasible Still Markov model is OK!

General Idea Assuming Markov property, compute P(p|N(p)) Instead, we search the input image for all similar neighborhoods — that’s the pdf for p To sample from this pdf, just pick one match at random p non-parametric sampling Input image Synthesizing a pixel

Algorithmic Details Start from a 3x3 seed from the input The new pixel p to fill is randomly picked among all the ones that have the larger number of neighbors -> synthesis by layer

Neighborhood Comparison Given a partial patch N(p) in the ouput B at pixel p, we compute the (squared) distance to all partial patches p’ in input image A Squared difference with Gaussian weights since the center of the patch has more importance

Similar Neighborhood The set of “similar neighborhoods” are defined as all patches N(p’) such that is a global parameter

Pseudo-code of the Efros-Leung Algorithm Input arguments: Input image A, output size Parameters : neighborhood size, Initialize with 3x3 random seed of A While output B not filled Pick a pixel p in B with maximal neighbor pixels Compute the distance of N(p) to all patches of input A Pick randomly one the similar neighborhood p’ Set B(p) = A(p’) (= Fill p with central value)

Neighborhood Size input

Varying Neighborhood Size

Synthesis Results

Synthesis Results

Homage to Shannon

Not only for texture synthesis Other applications Texture inpainting (or hole filing) Texture/Image extrapolation

Application: Texture Inpainting

Application: Image Extrapolation

Back to Texture Synthesis Surprisingly good results for structured textures! Failure cases Verbatim copy Growing garbage

Failure Cases Growing garbage Verbatim copying

Pros & Cons Advantages Disadvantages Conceptually simple Satisfying for a wide range of real-world textures Naturally does hole-filling Disadvantages Slow Parameters are hard to set: thin space (if any) between verbatim copy and growing garbage No ensured quality: trial and error

Verbatim Copy To get a better understanding, one can plot the pixel coordinate map Although pixels are generated one pixel at a time, whole pieces of input are reproduced

Verbatim Copy The problem comes from the fact that when reproducing the input is generally the only possibility

Innovation Capacity Innovation capacity increases with

Growing Garbage Happens when the algorithm is stuck in some local loop

Avoid Failure For some textures it is hard to find a balance between verbatim copy and growing garbage

Acceleration The computational cost comes from the comparison to all patches of the input textures at each step The neighborhoods have different shapes so it is hard to use some data structure to accelerate the computation of the distance Squared sum computation Partial sum of distance: discard as soon as larger than current estimate of Works even better with PCA coordinates (more variance for first coordinates) (of half-patches)

Questions?

Image Quilting for Texture Synthesis & Transfer [Efros & Freeman, SIGGRAPH 2001] IPOL demo: [Raad, Galerne, 201?] (accepted)

Efros & Leung ’99 extended p non-parametric sampling B Input image Synthesizing a block Observation: neighbor pixels are highly correlated and copied one pixel at a time Idea: unit of synthesis = block Exactly the same but now we want P(B|N(B)) Much faster: synthesize all pixels in a block at once

constrained by overlap Quilting: Main Idea block Input texture B1 B2 Neighboring blocks constrained by overlap B1 B2 Minimal error boundary cut B1 B2 Random placement of blocks

Minimal Error Boundary overlapping blocks vertical boundary _ = 2 overlap error DETAILS LATER min. error boundary

Philosophy Texture blocks are by definition correct samples of texture The problem is connecting them together

Algorithm Parameters: size of block, size of overlap (25%) Synthesize blocks in raster order Search input texture for block that satisfies overlap constraints (above and left) Paste new block into resulting texture use dynamic programming to compute minimal error boundary cut

Three overlap cases There are 3 overlap cases Vertical overlap (first row) Horizontal overlap (first column) L-shaped overlap (everywhere else)

Overlap Constraint We need to search to all blocks that have a similar L-shape Can be computed using Fast Fourier transform Then cost is only proportional to input size in O(MNlog(MN)), independent of block size Again, pick block at random with error tolerance

Boundary Error Computation 2 _ For vertical boundary Search the pixel path that minimizes e = (A-B)² Dynamic programming Starting from bottom compute minimal cumulative error E Starting point is minimal value on top Retrace back the minimal path DETAILS … =

Boundary Error Computation What about L-shape overlap?

Results

Results

Results

Results

Results

Results

Results

Failures

Texture Transfer Take the texture from one object and “paint” it onto another object This requires separating texture and shape Assume we can capture shape by boundary and rough shading Then, just add another constraint when sampling: similarity to underlying image at that spot

Texture Transfer + = parmesan + = rice

Several Paths with Different Sizes + =

Pros & Cons Advantages Disadvantages Fast and very simple Good results Size parameter hard to set Scanning order: Quality tends to be better in top left corner for large images (TP) In fact we get garbage growing, but at the block size (often nice results for small size images only…)

Questions?