Title: Example-Based Texture Synthesis
1Example-Based Texture Synthesis
- Li-Yi Wei
- Microsoft Research Asia
2Acknowledgements(sorted alphabetically by last
name)
- People who allow me to use their materials
- Alyosha Efros
- Aaron Hertzmann
- Sylvain Lefebvre
- Yanxi Liu
- Jianye Lu
- Emil Praun
- Ravi Ramamoorthi
- Eero Simoncelli
- Xin Tong
- My co-organizers and co-presenters
- Vivek Kwatra
- Sylvain Lefebvre
- Greg Turk
3Preliminaries
- Some basic stuff to
- warm/wake you up
4Texturing
- Apply texture images to surfaces to represent
- Surface color, geometry, material property, etc
- Smaller data size, faster computation
not textured
textured
5Texturing Example
- Quake game
- Material
- Light/shadow
- Logo/sign
6Texturing Example
7Steps of Texturing(from Greg Turk)
texture acquisition
texture mapping
texture access filter
Image courtesy of Emil Praun
8How to Acquire Textures
- Manual art
- ? Flexible control
- Not for everyone, tedious
- Procedural code
- ? Efficiency, flexibility, control
- Not general
- Photographs
- ? General
- Control
- Too small due to curvature limited surface
area - Too large due to global variation
9Example-based Texture Synthesis
- For (photographic) textures that are too small
- Produce an arbitrarily large output with similar
look - General Input needs to satisfy certain
assumptions
Synthesis Algorithm
input
output
10What is Texture?
- For texture mapping
- (General definition)
- Arbitrary images
- For (example-based) texture synthesis
- (Narrow definition)
- Images with repetitive patterns
- Synthesis of arbitrary images (general
definition) is called Rendering!
11Methods/Models for Texture Synthesis
- Many algorithms exist through out the history
- Will briefly mention them later
- They are all great but impossible to cover all
- We will begin with a simple but very useful one
- Most recent SIGGRAPH papers are based on this
12Our Texture Model
- Local and stationary (Markov Random Field)
texture
non-texture
13Basic Formulation for Texture Synthesis
Ensure local neighborhood similarity
Search
Z input
X output
14Basic Algorithms
- Solvers for the aforementioned basic formulation
15Pixel-based Algorithms
- Many previous MRF algorithms
- Mostly complex heavy weight
- Efros Leung 1999
- One of the simplest (and most elegant) algorithms
- Works surprisingly well
16Pixel-based AlgorithmEfros Leung 1999
- Grow an output texture pixel-by-pixel in an onion
skin order - Partial neighborhood search
p
input
output (zoom in)
17Pixel-based AlgorithmEfros Leung 1999
- Starting from the initial configuration, we
grow the texture one pixel at a time - The size of the neighbourhood window is a
parameter that specifies how stochastic the user
believes this texture to be - To grow from scratch, we use a random 3x3 patch
from input image as seed
18Pixel-based AlgorithmEfros Leung 1999
- Window size the only crucial parameter
input
output
Increasing window size
19Pixel-based AlgorithmWei Levoy 2000
- Derived from Popat Picard 1993
- Similar to Efros Leung 1999, but uses a
fixed neighborhood as in Popat Picard 1993 - This is actually important (to be detailed later)
20Pixel-based AlgorithmWei Levoy 2000
- Basic Idea - notice the use of fixed
neighborhoods
copy
search
input
output
21Pixel-based AlgorithmWei Levoy 2000
noise
noise
input
output
22Pixel-based AlgorithmWei Levoy 2000
- Multi-resolution allows the use of smaller
neighborhoods
1 level 5?5
3 levels 5?5
1 level 11?11
23Pixel-based AlgorithmResults
Oriented
Random
Regular
Semi-regular
24Pixel-based AlgorithmResults
25Pixel-based AlgorithmAcceleration
- Q why is the advantage of a fixed neighborhood?
- A easy for acceleration!
26Pixel-based AlgorithmAcceleration
- A major issue with pixel-based algorithms
introduced so far they are very slow - For input with N pixels and output with M pixels
- O(MN) time complexity
- Make it O(cMN) for neighborhood size c
- A fixed neighborhood allows us to do it faster
- O( c log(N) M ) TSVQ
- O(cM) k-coherence (also gives you better
quality)
27Acceleration - TSVQ
- Tree-structured Vector Quantization Gersho
Gray 1991 - Accelerate the search process
copy
search
input
output
28Acceleration - TSVQ
tree
Full search O(N)
TSVQ O(log N)
29Acceleration - TSVQ
- Can degrade quality (blur)
original
Full search
TSVQ
30Acceleration k-coherence
- Tong et al 2002
- Also similar to Ashikhmin 2001 Zelinka
Garland 2004 - O(c) search time per output pixel
- c ? neighborhood size
- Better quality than even exhaustive search!
- IMO most useful acceleration data structure
31Acceleration k-coherencePreprocess
- For each input pixel, find k others with similar
neighborhoods
2
2B
1A
k 2
2A
1
1B
input
32Acceleration k-coherenceRuntime Synthesis
1
1A
1B
2
2A
2B
2
2B
1A
2A
1
1B
input
output
33Acceleration k-coherenceResults
input
full search
k-coherence
34Lefebvre Hoppe 2006Gather neighborhood
information into pixels
Acceleration Appearance Space
Exemplar
Appearance space
Texture being synthesized
35Acceleration Appearance SpaceNeighborhood ?
Pixel Information
PCA
4D/8D
Color exemplar 5x5
Appearance-space exemplar
Transformed exemplar
Appearance Vector 75D (5x5xRGB)
? Possibly, non linear dimensionality reduction
36RGB versus 3D appearance space
RGB
3D appearance space
37Acceleration Appearance Space Appearance Vectors
- Feature distance 5x5x4D (? 100D)
Feature mask
Zhang et al 2003, Wu and Yu 2004
Feature distance
4D
38Acceleration Appearance Space Feature
preservation
- Add feature distance to appearance vector
- (100D ? 4D)
With
Without
39Patch-based Algorithm
- Synthesis in unit of patches instead of pixels
- Chaos mosaic Liang et al 2000
input
idea
result
40Patch-based AlgorithmLiang et al 2000
- Problematic for structured textures
input
result
41Patch-based AlgorithmEfros Freeman 2001
- Replacing pixels in Efros Leung 1999 with
patches
non-parametric sampling
B
Input image
Synthesizing a block
Input image
42block
Input texture
B1
B2
Random placement of blocks
43Minimal error boundary
overlapping blocks
vertical boundary
44Patch-based AlgorithmGraph cut Kwatra et al
2004
- Use graph cut rather than dynamic programming for
finding path
45Portilla Simoncelli
Xu, Guo Shum
input image
Wei Levoy
Image Quilting
46Portilla Simoncelli
Xu, Guo Shum
input image
Wei Levoy
Image Quilting
47Remember Our Goal?
- Pixel/patch-based algorithms are heuristics
Search
Z input
X output
48Texture OptimizationKwatra et al 2005
- Really try to solve this energy function!
- Vivek will talk about this in detail later
Search
Z input
X output
49Other Methods
- A lot of interesting methodologies other than the
ones I just described - I will mention a few here, as it is impossible to
provide an exhaustive coverage
50Pyramid StatisticsHeeger Bergen 1995
Portilla Simoncelli 2000
- Global statistics based on filter responses
- Quality not yet enough
- But interesting fundamental human perception
issue
input
optimization
PortillaSimoncelli
51Lower Resolution Pyramid StatisticsDe Bonet
1997
- Correlations at the same pyramid level not
considered
input
De Bonet
pixel-based
52Wang TilesCohen et al 2003
3
4
1
2
Input tiles
adjacent tiles share identical edge color
continuous pattern across identical edge color
53Near-Regular TexturesLiu et al 2004
- Classification of textures
54Near-Regular TexturesLiu et al 2004
55Black Magic
- Parameter tuning is important
- Texture synthesis cannot guarantee success for
every input - But more often than not, people get bad results
because of bad parameters, not bad algorithms - Most important ones
- Neighborhood size, pyramid resolutions,
iterations - Like everything else, this requires some
experience - Texture synthesis is not alone here
56Texture Replacement
- A huge important literature
- but I can only briefly touch it here
57Image Editing
58Artifact Removal
59Detail Hallucination
60Globally Variant Textures
61Globally Variant Texture
- So far we discuss only homogeneous textures
- Limited practical applications, lack variation
control - Most natural textures are globally variant
62Definition of Globally-Variant Texture
- Local, but not stationary
- Control map
- Moisture, curvature, exposure, temperature, age,
etc
homogeneous local stationary
globally-variant local only
globally-variant control map
63Globally-Variant Texture Synthesis
- Control serves as constraint
user control
input control
result
input
64Globally-Variant Synthesis Algorithm
- Treat control and color together
- Do not change output control
- Applicable to pixel/patch copy or optimization
Xp
Zp
65Control Map
- Heuristics
- Ashikhmin 2001 Efros Freeman 2001 Hertzmann
et al. 2001 Wang et al. 2006 - Captured
- Gu et al. 2006 Lu et al. 2007
66Image analogies Hertzmann et al 2001 Control
Map from Input Images
A Control map
A
B Control map
B
67Image analogies
?
B Control map
B
A Control map
A
68Image analogies
- Goal Match conditional image statistics
A
A
B
B
69Synthesis
A
A
B
B
70Texture-by-numbers
A control map
A
71Texture-by-numbers
B Control map
72Efros Freeman 2001Control Map from Target Color
parmesan
rice
73 74 75Source texture
Target image
76 77Gu et al. 2006Space-time Surface Appearance
- Capturing from real data!
78Database of TSV-BRDF
Corrosion
Burning
Drying (Smooth Surface)
Waffle Toasting
Charred Wood 2
Decaying
Drying (Rough Surface)
79Space-Time Factorization
- With factorization, we can easily do
- Control
- Synthesis
- Transfer
Spatial Variation
Time-Varying Appearance
Temporal Variation
80Key Assumption
- All points have one common overall temporal
variation. - Different points evolve at different rates and
offsets.
?
A
C
B
- Two problems
- What is the overall temporal variation?
- How to define and calculate the rates and offsets?
81STAF Model
- For texture synthesis, assign A/D/R/O per (x,y)
- A/D spatial variation
- R/O temporal variation
p(x,y,t) A(x,y) f(t) D(x,y)
t R(x,y) t - O(x,y)
82STAF Model Estimation Result
83STAF Synthesis Result
84Context-Aware Texture Lu et al. 2007Control
Map from Measurement
control
color
85Context-Aware Texture Synthesis
- The color contains multiple frames
output
input
86Globally-Variant Texture Synthesis ResultLu et
al 2007
iron rust
paint crack
dust accumulation
cheese mold
87Context-Aware Texture Synthesis Result
iron rust
88Context-Aware Texture Synthesis Result
paint crack
89Context-Aware Texture Synthesis Result
dust accumulation
90Context-Aware Texture Synthesis Result
cheese mold
91Issues with Globally-Variant Textures
- Often very large
- To cover sufficient variation and detail
- Traditional image compression little help
92Inverse Texture Synthesis
- For inputs that are too big
- Much more difficult problem than forward synthesis
Inverse Synthesis
output
input
93To Be Continued
94(No Transcript)