6. Texture Synthesis
On this page
4.1 Texture Synthesis
Goal
- Create new samples of a given texture
- Simplest: tiling

The Challenge

- Need to model the whole spectrum from repeated to stochastic texture
One idea: Build Probability Distributions
- Compute the stats of the input texture and generate a new texture that keeps the same stats

Another Idea: Sample from the Image
- Assume Markov property
- A given pixel
p is independent of the entire picture given the neighboring pixels around it.

- What are we doing?
- Find patches on the input image that are similar to the neighboring pixels around
p
- Sample intensities around these patches P(p∣Neighbor(p))
Note
Idea from Shannon
- Generate English-sounding sentences by modeling the probability of each word given the previous words (n-grams)
- Large “n” will give more structured sentences
How to match patches?

SSD(src,template,mask)=i,j∑x,y∑∣template(x,y)⊙mask(x,y)−src(i+x,j+y)⊙mask(x,y)∣2=i,j∑x,y∑[template(x,y)⊙mask(x,y)]2−2i,j∑x,y∑[template(x,y)⊙mask(x,y)⊙src(i+x,j+y)]+i,j∑x,y∑[src(i+x,j+y)⊙mask(x,y)]2=i,j∑[x,y∑[template(x,y)⊙mask(x,y)]2]−2i,j∑x,y∑[template(x,y)⊙mask(x,y)⊙src(i+x,j+y)]+i,j∑x,y∑[src(i+x,j+y)]2⊙mask(x,y)=∣template⊙mask∣2⊙Nij−2[(template⊙mask)⋆src]+[src2⋆mask]
- The pixels with most neighbors are synthesized first (propagate outwards from the center of an image)
- To synthesize from scratch, start with a randomly selected small patch from the source texture
Size of Neighborhood Window

Algorithm
- Get unfilled pixels with filled neighbors, sorted by the number of filled neighbors
- For each pixel, get top N matches based on visible neighbors
- SSD can be used for patch match
- Randomly select one of the matches and copy pixel from it