Top Banner
Texture Synthesis Tiantian Liu
80

Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture SynthesisTiantian Liu

Page 2: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Definition

• Texture– Texture refers to the properties held and

sensations caused by the external surface of objects received through the sense of touch. Texture is sometimes used to describe the feel of non-tactile sensations. Texture can also be termed as a pattern that has been scaled down (especially in case of two dimensional non-tactile textures) where the individual elements that go on to make the pattern not distinguishable.

Texture Synthesis

Page 3: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Definition

• Texture– Local• Each pixel of a texture image is characterized by a small

set of spatially neighboring pixels

– Stationary• characterization is the same for all pixels

Texture Synthesis

Page 4: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

DefinitionTexture Synthesis

• Texture

Page 5: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

DefinitionTexture Synthesis

• Texture

Animal Skin Stone Water

Hair Fabric Bricks

Page 6: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Definition

• Texture Synthesis– Texture synthesis is the process of algorithmically

constructing a large digital image from a small digital sample image by taking advantage of its structural content. It is object of research to computer graphics and is used in many fields, amongst others digital image editing, 3D computer graphics and post-production of films.

Texture Synthesis

Page 7: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Definition

• Texture Synthesis

Texture Synthesis

Input Result

Synthesis Algorithm

Page 8: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Application

• Surface Texture producing

Texture Synthesis

Page 9: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Application

• Image Editing

Texture Synthesis

Page 10: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Application

• Image Editing

Texture Synthesis

Page 11: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Application

• Flow-controlled 2D texture

Texture Synthesis

Page 12: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Papers

• Fast Texture Synthesis using Tree-structured Vector Quantization– Wei, L.-Y., and Levoy, M. 2000.

• Texture Optimization for Example-based Synthesis– Kwatra V, Essa I, Bobick A, Kwatra N. 2005

• Accelerated Parallel Texture Optimization– Huang HD, Tong X, Wang WC. 2007

Texture Synthesis

Page 13: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Papers

• Fast Texture Synthesis using Tree-structured Vector Quantization– Wei, L.-Y., and Levoy, M. 2000.

• Texture Optimization for Example-based Synthesis– Kwatra V, Essa I, Bobick A, Kwatra N. 2005

• Accelerated Parallel Texture Optimization– Huang HD, Tong X, Wang WC. 2007

Texture Synthesis

Page 14: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

Page 15: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

Page 16: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

search

copy

input output

• Basic idea

Page 17: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Basic idea

How large should the neighbor be?

Page 18: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Basic idea

What if the neighbor is too large or too small?

Page 19: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Multiple resolutions

noise

noise

Search

Copy

input output

Page 20: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Multi-resolution allows the use of smaller neighborhoods

1 level55

3 levels55

1 level1111

Page 21: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• 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

Page 22: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Acceleration - TSVQ

Search per input pixel Search tree

Page 23: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Pseudo Code

Page 24: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Results

Random Oriented

Regular Semi-regular

Page 25: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Results

Page 26: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Problems– Possibly get stuck on

details.– Still slow.

Page 27: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Fast Texture SynthesisTexture Synthesis

• Problems– Possibly get stuck on

details.– Still slow.

Page 28: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Papers

• Fast Texture Synthesis using Tree-structured Vector Quantization– Wei, L.-Y., and Levoy, M. 2000.

• Texture Optimization for Example-based Synthesis– Kwatra V, Essa I, Bobick A, Kwatra N. 2005

• Accelerated Parallel Texture Optimization– Huang HD, Tong X, Wang WC. 2007

Texture Synthesis

Page 29: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

Page 30: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

Page 31: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Similarity and Synthesis• Shape, size, orientation of texture elements similar to

source

Texture Synthesis

Page 32: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Texture Energy– Tricky!• Pixel-by-pixel comparison of source and target not

possible

– Compare texture “elements”• Local pixel neighborhoods

– Want each target neighborhood to be similar to some source neighborhood

Page 33: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

X(target frame)

Z(source)

Page 34: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

p (pixel)Z(source)

X(target frame)

Page 35: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

Xp (neighborhood)Z(source)

X(target frame)

Page 36: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

Xp (neighborhood)

X(target frame)

Z(source)

Page 37: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

(nearest neighbor) Zp

Xp (neighborhood)Z(source)

X(target frame)

Page 38: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

X

Z

(nearest neighbor) Zp

Xp (neighborhood)

Texture Energy(single neighborhood)

Page 39: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

X

Z

Page 40: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture Optimization

• Texture Energy

Texture Synthesis

X

Z

= individual neighborhood energy

Page 41: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Flow-guided Texture Animation– Flow consistency• Perceived motion similar to flow

– Texture similarity• Shape, size, orientation of texture elements similar to

source

+ =

Texture Flow Field Output

Page 42: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

Target FlowFlowing Target

Source Texture

TextureSimilarity

FlowConsistency

• Naïve way:• Ignore Texture Similarity• Warp each frame via flow field

X1 Xn

TargetFrames X0

Warp

Page 43: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Warp

WarpXnX0 X1

TargetFrames

Page 44: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Simply Warp– Problem: Texture structure not maintained

Page 45: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Warp + Correct– Problem: Texture structure not maintained

TargetFrames XX–

Warp

W

Correct

WarpedFrame

SynthesizedFrame

Page 46: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Link to original goals

XTargetFrames X–

W

Correct

Source

Flow Consistency

Texture Similarity

Warp

Page 47: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

Energy = Flow Energy + Texture Energy

XTargetFrames X–

W

Correct

Source

Flow Consistency

Texture Similarity

Warp

Page 48: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

Energy = Flow Energy + Texture Energy

Flow Energy

XTargetFrames X–

Warp

W

Page 49: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Optimize Total Energy of target frame:

• Initialize: X W(target frame warped frame)

• Iteratively improve target frame (E-M algorithm!)

Page 50: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Two variables we need to optimize over

Page 51: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Two variables we need to optimize over

Target Frame

Page 52: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Two variables we need to optimize over

Source Neighborhoods

Page 53: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Iterative Algorithm– Step 1 – Minimize E( X ) w.r.t {Zp}

– Find Nearest Source Neighborhoods

Page 54: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Iterative Algorithm– Step 2– Minimize E( X ) w.r.t X

– Set Solve Linear System

Page 55: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Pseudo code

Page 56: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Multi-level synthesis– Random Initialization– Multiple

• Resolution Levels• Neighborhood Sizes

– Progressively refined output

Level 1

Level 2

Level 3

Level 4

Level 5

Level 6

Level 7

0 5 10 15 20 25 30 35 40 45 500

50

100

150

200

250

300

350

400

Number of Iterations

[KEBK05]

Page 57: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Multi-level synthesis– Random Initialization– Multiple

• Resolution Levels• Neighborhood Sizes

– Progressively refined output

[KEBK05]

Page 58: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Results

[KEBK05]

Page 59: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Results

[KEBK05]

Page 60: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Results

[KEBK05]

Page 61: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Results

[KEBK05]

Page 62: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Texture OptimizationTexture Synthesis

• Problems– Linear Solve may cause blurriness• Solution: Discrete Optimization

– Can get stuck in local minima• Several solutions, but not work well

–Very very very slow (especially on surfaces)• Solution: Exploit parallel hardware• Solution: Nearest neighbor queries can be made in

parallel

Page 63: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Papers

• Fast Texture Synthesis using Tree-structured Vector Quantization– Wei, L.-Y., and Levoy, M. 2000.

• Texture Optimization for Example-based Synthesis– Kwatra V, Essa I, Bobick A, Kwatra N. 2005

• Accelerated Parallel Texture Optimization– Huang HD, Tong X, Wang WC. 2007

Texture Synthesis

Page 64: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

Page 65: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• GPU-Based Texture Optimization– K-coherence search– Principal Components Analysis(PCA)

Page 66: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• K-coherence search on GPU

Page 67: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• K-coherence search on GPU

Page 68: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• K-coherence search on GPU (pre-computing)• For each input pixel, find k others with similar

neighborhoods

input

1

1A

1B

2

2A

2B

k = 2

1 1 11 11 1 1

1 1 11 11 1 1

1 1 11 11 1 1

Page 69: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• K-coherence search on GPU (searching)

input output

1 2 34 56 7 81

1A

1B

2

2A

2B

1 1A 1B

2 2A 2B

Page 70: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• PCA – reducing the dimension• mathematically defined as an orthogonal linear

transformation that transforms the data to a new coordinate system such that the greatest variance by any projection of the data comes to lie on the first coordinate (called the first principal component), the second greatest variance on the second coordinate, and so on.

• theoretically the optimum transform for given data in least square terms

Page 71: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• Pseudo Code

Page 72: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• GPU implementation details:• Divide parallel scheme into 3 fragment programs.

– E-step program– M-step program– Up sampling program

Page 73: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• GPU implementation details:• Divide parallel scheme into 3 fragment programs.

– E-step program» Input: neighborhood texture Y(storing {zp}})» Output: pixel texture X(storing x)

– M-step program– Up sampling program

Page 74: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• GPU implementation details:• Divide parallel scheme into 3 fragment programs.

– E-step program– M-step program

» Input: X and related pre-computed data» Output: new neighborhood Y

– Up sampling program

Page 75: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• GPU implementation details:• Divide parallel scheme into 3 fragment programs.

– E-step program– M-step program– Up sampling program

» Needed in multi-level synthesis.

Page 76: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• Results

[HTW 2007]

Page 77: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Accelerated Parallel Texture Optimization

Texture Synthesis

• Comparison

[HTW 2007]

CPU

GPU

Page 78: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Sum upTexture Synthesis

• Texture synthesis has many applications:– Surface texture procedure, texture editing, 2D

flow controlled texture, spatio-temporal textures, lossy compression etc.

• Current CPU implementation methods are mature:– Pixel based, patch based, texturing optimization,

user controlled, flow controlled etc.

Page 79: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Sum up (cont.)Texture Synthesis

• Time consuming is still a problem of texture synthesis.

• Parallel algorithms that can be run on GPUs are few.

Page 80: Texture Synthesis Tiantian Liu. Definition Texture – Texture refers to the properties held and sensations caused by the external surface of objects received.

Thank You …Texture Synthesis