Texture Synthesis
Presenter: Kaijian Chen Course Advisor: Prof. Hui Huang
2020-05-25
Visual Computing 2020 Texture
• Definition of Texture - Images containing repeating patterns
Texture example Texture mapping
可视计算研究中心 Visual Computing Research Center 2 Texture acquisition Can we acquire texture in another way? 1. Hand-drawn texture - hard to make them photo-realistic; 2. Scanned texture image • Restricted to fixed resolution; • non-uniform lighting, shadows, etc., lead to visible seams or repetition;
Not photo-realistic Visible seams and repetitions
可视计算研究中心 Visual Computing Research Center 3 Outline
• Example-based Texture Synthesis • MRF – pixel-based, patch-based, optimization-based • Auxiliary algorithm – Nearest Neighbor Search: K-coherence, PatchMatch
• Deep-based Texture Synthesis • Decoupling content and style • Texture synthesis with Generative Adversarial Network
• Procedural Texture Synthesis • Perlin noise & Turing patterns • Inverse Procedural Texture Synthesis
可视计算研究中心 Visual Computing Research Center 4 Example-based Texture Synthesis
• Goal • Given a texture sample, synthesize a new texture that, when perceived by a human observer, appears to be generated by the same underlying process.
input output
可视计算研究中心 Visual Computing Research Center 5 Example-based Texture Synthesis
• Analysis - Markov random field (MRF) • model a texture as a realization of a local and stationary random process.
�(��|��, ��, ��, … , �� �)
Local
Non-stationary Stationary
可视计算研究中心 Visual Computing Research Center 6 Example-based Texture Synthesis
• More specific • For each output pixel in generated texture, its spatial neighborhood is similar to at least one neighborhood at the input.
input output
可视计算研究中心 Visual Computing Research Center 7 Example-based | Pixel-based method
• Main idea - Given input texture and output size, Generate target texture pixel-by-pixel in raster-scan order.
Input � Output � Treating input image as datasets Synthesis pixel based of pixel with neighborhood N; on pixel’s neighborhood;
可视计算研究中心 Visual Computing Research Center [Wei L. Y., et al.: Fast texture synthesis using tree-structured vector quantization] 8 Example-based | Pixel-based method
• Method illustration
Inappropriate White noise with neighborhood size histogram matching
可视计算研究中心 Visual Computing Research Center [Wei L. Y., et al.: Fast texture synthesis using tree-structured vector quantization] 9 Example-based | Pixel-based method
• An efficient way to represent large-scale structure • Gaussian pyramid - represent large scale structures more compactly by a few pixels in a certain lower resolution pyramid level;
Gaussian pyramid
可视计算研究中心 Visual Computing Research Center [Wei L. Y., et al.: Fast texture synthesis using tree-structured vector quantization] 10 Example-based | Pixel-based method
• Coarse-to-fine synthesis • Constructing pyramid for Z & X, synthesis X from low resolution to high resolution; • Large-scale structure constrain - When searching for a match for pixel X, the neighborhood vector is constructed that includes the O’s, Q’s, and Y, in scanline order.
Coarsest generation (like before) Gaussian Pyramid Z & X Results - 1 layer, 2 layers, 3 layers Extended Neighborhood
可视计算研究中心 Visual Computing Research Center [Wei L. Y., et al.: Fast texture synthesis using tree-structured vector quantization] 11 Example-based | Pixel-based method
Results
可视计算研究中心 Visual Computing Research Center [Wei L. Y., et al.: Fast texture synthesis using tree-structured vector quantization] 12 Example-based | Pixel-based method
Texture replacement Extrapolation
Applications
Disadvantage - Slow synthesis
可视计算研究中心 Visual Computing Research Center [Wei L. Y., et al.: Fast texture synthesis using tree-structured vector quantization] 13 Example-based | Patch-based method
• Main idea – like pixel-based method, but unit of synthesis = block. • Much faster: synthesis all pixels in a block at once.
Input Output
可视计算研究中心 Visual Computing Research Center [Alexei Efros, Bill Freeman: Image Quilting for Texture Synthesis & Transfer] 14 block Example-based | Patch-based method
• Overlapping region - combining patches with minimal error boundary cut (dynamic programing);
B1 B2 B1 B2
Neighboring blocks Minimal error constrained by overlap boundary cut
Input texture
Min. error boundary
可视计算研究中心 Visual Computing Research Center [Alexei Efros, Bill Freeman: Image Quilting for Texture Synthesis & Transfer] 15 Example-based | Patch-based method
Generation process Texture Transfer Results
可视计算研究中心 Visual Computing Research Center [Alexei Efros, Bill Freeman: Image Quilting for Texture Synthesis & Transfer] 16 Example-based | Optimization-based method
• Main idea • rather than greedy generation, optimization method tends to directly optimize the error of each patch in output X with its nearest neighbor in input Z.
• Energy function
• Xp – patch of pixel p in X • Zp – nearest patch of Xp in Z
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 17 Example-based | Optimization-based method
• Iterative optimization - For i in range(n_iters):
• Expectation – fixed {� }, modify output X according to {� };
• Maximization – fixed {� }, finding their nearest neighborhood {� };
� � � � �
Source Z � Source Z
Target Frame X Target Frame X Expectation Maximization
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 18 Example-based | Optimization-based method
• Flow-guided Texture Animation
+ =
Input Input Output Warp only With OT Texture Flow Field Sequence
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 19 Example-based | Optimization-based method
• Flow-guided Texture Animation • Texture similarity – Shape, size, orientation of texture elements similar to source; • Flow consistency – Perceived motion similar to flow;
Flow Consistency
Texture Similarity
Source Texture Flowing Target
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 20 Example-based | Optimization-based method
• Flow-guided Texture Animation • E – Find X by solving linear equation: Minimize |�� − � | + �|�� − � | ;
� Blend � Source Z
Target Frame X
w
Warped Frame W 可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 21 Example-based | Optimization-based method
• Flow-guided Texture Animation • M – Find � by searching nearest neighborhood: Minimize |�� − � | + �|�� − � | ;
� � Source Z
Target Frame X
w
Warped Frame W 可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 22 Example-based | Optimization-based method
• Flow-guided Texture Animation • E – Minimize |�� − � | + �|�� − � | ; • M – Minimize |�� − � | + �|�� − � | ; • Initialize – W -> X; • Multiple 1. Resolution Levels; 2. Neighborhood Sizes;
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 23 Example-based | Optimization-based method
Results
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 24 Example-based | Optimization-based method
Input Wei-Levoy Image Texture [Wei’00] Quilting Optimization [Efros’01] [Kwatra’05] Results
可视计算研究中心 Visual Computing Research Center [Vivek Kwatra, et al.: Texture Optimization for Example-based Synthesis] 25 Example-based | Optimization-based method
• K-Coherence • Observation – Pixels that are together in the input ought to have a tendency to be also together in the output. • Main idea – Propagate the neighbors’ correspondence vector to target pixel;
可视计算研究中心 Visual Computing Research Center [X. Tong, et al.: Synthesis of bidirectional texture functions on arbitrary surfaces] 26 Example-based | Neighborhood search
• Main components of K-Coherence