Two Patch-based Algorithms for By-example Texture Synthesis Bruno Galerne MAP5, Université Paris Descartes 1 Master 2 Traitement.

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.
Wavelets Fast Multiresolution Image Querying Jacobs et.al. SIGGRAPH95.
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.
Evaluating Classifiers
Data-driven methods: Texture (Sz 10.5) Cs129 Computational Photography James Hays, Brown, Spring 2011 Many slides from Alexei Efros.
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.
Maryia Kazakevich “Texture Synthesis by Patch-Based Sampling” Texture Synthesis by Patch-Based Sampling Real-Time Texture Synthesis By Patch-Based Sampling,
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.
Order-Independent Texture Synthesis Li-Yi Wei Marc Levoy Gcafe 1/30/2003.
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.
Andrew Nealen and Marc Alexa, Discrete Geometric Modeling Group, TU Darmstadt, 2003 Hybrid Texture Synthesis Andrew Nealen Marc Alexa Discrete Geometric.
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.
Fast Texture Synthesis Tree-structure Vector Quantization Li-Yi WeiMarc Levoy Stanford University.
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.
Stereo Many slides adapted from Steve Seitz.
Image Quilting for Texture Synthesis and Transfer Alexei A. Efros (UC Berkeley) William T. Freeman (MERL) Siggraph01 ’
TEXTURE SYNTHESIS BY NON-PARAMETRIC SAMPLING VIVA-VITAL Nazia Tabassum 27 July 2015.
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.
Scene Completion Using Millions of Photographs James Hays, Alexei A. Efros Carnegie Mellon University ACM SIGGRAPH 2007.
EE565 Advanced Image Processing Copyright Xin Li Why do we Need Image Model in the first place? Any image processing algorithm has to work on a collection.
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
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.
Nonparametric Modeling of Textures Outline Parametric vs. nonparametric Image patches and similarity distance Efros-Leung’s texture synthesis by non- parametric.
SIGGRAPH 2007 Hui Fang and John C. Hart.  We propose an image editing system ◦ Preserve its detail and orientation by resynthesizing texture from the.
Texture Analysis and Synthesis. Texture Texture: pattern that “looks the same” at all locationsTexture: pattern that “looks the same” at all locations.
EE565 Advanced Image Processing Copyright Xin Li Why do we Need Image Model in the first place? Any image processing algorithm has to work on a collection.
Hebrew University Image Processing Exercise Class 8 Panoramas – Stitching and Blending Min-Cut Stitching Many slides from Alexei Efros.
Two Patch-based Algorithms for By-example Texture Synthesis
Graphcut Textures:Image and Video Synthesis Using Graph Cuts
Announcements Project 4 out today help session at the end of class.
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
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
Presentation transcript:

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

Textures 2 Texture depicts spatially repeating patterns Many natural phenomena are textures radishesrocksyogurt

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

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

Outline The “Alexei Efros course” – 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 Matlab! (with some help) 5

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] 6

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) 7

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

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 9

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 exchanged 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! 10

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 11 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 neighborhood -> synthesis by layer 12

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

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

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

Neighborhood Size 16 input

Varying Neighborhood Size 17

Synthesis Results 18

Synthesis Results 19

Homage to Shannon 20

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

Application: Texture Inpainting 22

Application: Image Extrapolation 23

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

Failure Cases 25 Growing garbageVerbatim copying

Pros & Cons Advantages – 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 26

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 27

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

Innovation Capacity Innovation capacity increases with 29

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

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

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 threshold – Works even better with PCA coordinates (more variance for first coordinates) (of half-patches) 32

Questions? 33

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

Efros & Leung ’99 extended 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 35 p Input image non-parametric sampling Synthesizing a block B

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

Minimal Error Boundary 37 min. error boundary overlapping blocksvertical boundary _ = 2 overlap error DETAILS LATER

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

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 39

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

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 41

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

Boundary Error Computation What about L-shape overlap? 43

Results 44

Results 45

Results 46

Results 47

Results 48

Results 49

Results 50

Failures 51

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 Then, just add another constraint when sampling: similarity to underlying image at that spot 52

Texture Transfer 53 += += parmesan rice

Several Paths with Different Sizes 54 +=

Pros & Cons Advantages – Fast and very simple – Good results Disadvantages – Size parameter hard to set – Scanning order: Quality tends to be better in top left corner for large images (TP) 55

Questions? 56