+ All Categories
Home > Documents > CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

Date post: 17-Jan-2016
Category:
Upload: mitchell-barber
View: 213 times
Download: 0 times
Share this document with a friend
Popular Tags:
25
CSE554 Fairing Slide 1 CSE 554 Lecture 6: Fairing Fall 2015
Transcript
Page 1: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 1

CSE 554

Lecture 6: Fairing

CSE 554

Lecture 6: Fairing

Fall 2015

Page 2: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 2

ReviewReview

β€’ Iso-contours in grayscale images and volumes

– Piece-wise linear representations

β€’ Polylines (2D) and meshes (3D)

– Primal and dual methods

β€’ Marching Squares (2D) and Cubes (3D)

β€’ Dual Contouring (2D,3D)

– Acceleration using trees

β€’ Quadtree (2D), Octree (3D)

β€’ Interval trees

Page 3: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 3

Geometry ProcessingGeometry Processing

β€’ Fairing (smoothing)

– Relocating vertices to achieve a smoother appearance

β€’ Simplification

– Reducing vertex count

β€’ Deformation

– Relocating vertices guided by user interaction or to fit onto a target

Page 4: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 4

Fairing a 1D SignalFairing a 1D Signal

β€’ Taking out β€œhigh frequency” content

(slides materials courtesy of Andy van Dam)

Page 5: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 5

Waveform AnalysisWaveform Analysis

β€’ A signal is the sum of phase-shifted sine curves at various scales (frequencies)

(slides materials courtesy of Andy van Dam)

Page 6: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 6

Frequency DomainFrequency Domain

β€’ Plotting the amplitude of sine curves at each frequency

(slides materials courtesy of Andy van Dam)

Real domain Frequency domain

Page 7: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 7

Signal FilteringSignal Filtering

β€’ Low-pass filtering: A β€œbox” filter in the frequency domain

– Equivalent to convolution in the real domain

(slides materials courtesy of Andy van Dam)

Page 8: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 8

2 1 0 1 2

0 .5

1 .0

1 .5

2 .0

0 1 2 3 40 .0

0 .5

1 .0

1 .5

2 .0

ConvolutionConvolution

β€’ Given two functions, (signal) and (filter)

– is symmetric:

β€’ is:

𝑓 [π‘₯]

π‘Ž

𝑀 [π‘₯ ]

Page 9: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 9

0 1 2 3 40 .0

0 .5

1 .0

1 .5

2 .0

0 1 2 3 40 .0

0 .5

1 .0

1 .5

2 .0

ConvolutionConvolution

β€’ Given two functions, (signal) and (filter)

– is symmetric:

β€’ is:

– Shift so that it’s centered at

– Multiply with (shifted)

– Find the area under the multiplied curve

wx0 1 2 3 4

0 .0

0 .5

1 .0

1 .5

2 .0

π‘Ž

𝑓 [π‘₯]

𝑀 [π‘₯βˆ’π‘Ž ]

𝑓 [π‘₯]⋅𝑀 [π‘₯βˆ’π‘Ž ]

( 𝑓 βˆ—π‘€ ) [π‘Ž ]=βˆ«βˆ’βˆž

∞

𝑓 [π‘₯ ] ⋅𝑀 [π‘₯βˆ’π‘Ž ]𝕕 π‘₯

Page 10: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 10

ConvolutionConvolution

β€’ Low-pass (Box) filtering: convolution with

– Removes all frequencies greater than B/2

-4 -2 2 4

0.1

0.2

0.3

0.4

-4 -2 2 4

-0.2

0.2

0.4

0.6

0.8

1

𝐡=1

Page 11: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 11

ConvolutionConvolution

β€’ Gaussian filtering: convolution with Gaussian function

– Kernel size (standard deviation) controls the amount of smoothing

– Repeated filtering using a small kernel is equivalent to a single filtering with a large kernel

-4 -2 2 4

0.1

0.2

0.3

0.4

-4 -2 2 4

-0.2

0.2

0.4

0.6

0.8

1ΒΏ 𝛿=1

Page 12: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 12

Discrete ConvolutionDiscrete Convolution

β€’ , as two arrays

– : data samples

– : weights

β€’ Convolution yields another array

( 𝑓 βˆ—π‘€ )𝑖= βˆ‘π‘—=βˆ’βˆž

∞

𝑓 𝑗×𝑀 π‘—βˆ’ 𝑖

π‘€βˆ’ 1

𝑀0

𝑀1

𝑓 1Γ—π‘€βˆ’1

𝑓 2×𝑀0𝑓 3×𝑀1

𝑓 1𝑓 2𝑓 3𝑓 4

𝑓 5

( 𝑓 βˆ—π‘€)2

𝑖=2:

Γ—

βˆ‘

Page 13: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 13

Discrete ConvolutionDiscrete Convolution

β€’ , as two arrays

– : data samples

– : weights

β€’ Convolution yields another array

( 𝑓 βˆ—π‘€ )𝑖= βˆ‘π‘—=βˆ’βˆž

∞

𝑓 𝑗×𝑀 π‘—βˆ’ 𝑖

𝑓 4𝑓 2𝑓 3

π‘€βˆ’ 1

𝑀0

𝑀1

𝑓 2Γ—π‘€βˆ’ 1

𝑓 3×𝑀0

𝑓 4×𝑀1

𝑓 1 𝑓 5

( 𝑓 βˆ—π‘€)3

𝑖=3 :

Γ—

βˆ‘

Page 14: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 14

Discrete ConvolutionDiscrete Convolution

β€’ , as two arrays

– : data samples

– : weights

β€’ Convolution yields another array

( 𝑓 βˆ—π‘€ )𝑖= βˆ‘π‘—=βˆ’βˆž

∞

𝑓 𝑗×𝑀 π‘—βˆ’ 𝑖

𝑓 4𝑓 2𝑓 3

π‘€βˆ’ 1

𝑀0

𝑀1

𝑓 3Γ—π‘€βˆ’ 1

𝑓 4×𝑀0

𝑓 5×𝑀1

𝑓 1 𝑓 5

( 𝑓 βˆ—π‘€)4

𝑖=4 :

Γ—

βˆ‘

Page 15: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 15

Discrete ConvolutionDiscrete Convolution

β€’ Example: convolution with a simple Gaussian kernel

– Weights are {1/4,1/2,1/4}

i-1 i i+1

𝑓 π‘–βˆ’ 1

𝑓 𝑖

𝑓 𝑖+1

( 𝑓 βˆ—π‘€ )𝑖=14𝑓 𝑖 βˆ’1+

14𝑓 𝑖+1+

12𝑓 𝑖

Page 16: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 16

Discrete ConvolutionDiscrete Convolution

β€’ Example: convolution with a simple Gaussian kernel

– Weights are {1/4,1/2,1/4}

– Intuitively: the signal at a point is moved to half-way between the signal and the average signals of the two neighboring points.

i-1 i i+1

𝑓 π‘–βˆ’ 1

𝑓 𝑖

𝑓 𝑖+1

(

(

Page 17: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 17

Curve FairingCurve Fairing

β€’ Reducing β€œbumpiness” by changing the vertex locations

Page 18: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 18

Curve FairingCurve Fairing

β€’ Curve as a signal

– The β€œsignal” at each vertex is its location

{x,y}

Page 19: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 19

Curve FairingCurve Fairing

β€’ Fairing by mid-point averaging

– Moving each vertex towards the mid-point of its two neighbors (like discrete Gaussian filtering)

β€’ : some value between 0 and 1

– Iterative fairing

β€’ At each iteration, update all vertices using locations in the previous iteration

β€’ A close to 1 will create oscillation

– Typically

πœ†

1βˆ’πœ†π‘ β€²=(1βˆ’ πœ† )𝑝+πœ†(

𝑝1+𝑝22

)

𝑝1+𝑝22

𝑝 β€²

𝑝

𝑝1𝑝2

Page 20: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 20

Curve FairingCurve Fairing

β€’ Drawback

– The initial shape is shrunk!

100 iterations 200 iterations 400 iterations

Page 21: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 21

Curve FairingCurve Fairing

β€’ Non-shrinking mid-point averaging [Taubin 1995]

– Alternate between two kinds of iterations with different

β€’ Odd iterations: (positive)

– Shrinking the shape

β€’ Even iterations: (negative)

– : typically 0.1

– Expanding the shape

Page 22: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 22

Curve FairingCurve Fairing

β€’ The initial shape is no longer shrunk

– The result converges with increasing iterations

100 iterations 200 iterations 400 iterations

Page 23: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 23

Surface FairingSurface Fairing

β€’ Fairing by centroid averaging

– Moving each vertex towards the centroid of its edge-adjacent neighbors (called the 1-ring neighbors)

– Iterative, non-shrinking fairing

β€’ Alternate between shrinking and expanding

– Same choices of as in 2D

β€’ Each iteration updates all vertices using locations in the previous iteration

p

p1

p2

p3

p4

p5

centroid𝑝 β€²=(1βˆ’ πœ† )𝑝+πœ†βˆ‘

𝑖=1

π‘š 𝑝𝑖

π‘š

Page 24: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 24

Surface FairingSurface Fairing

β€’ Example: fairing iso-surface of a binary volume

Page 25: CSE554FairingSlide 1 CSE 554 Lecture 6: Fairing Fall 2015.

CSE554 Fairing Slide 25

FairingFairing

β€’ Implementation Tips

– At each iteration, keep two copies of locations of all vertices

β€’ Store the smoothed location of each vertex in another list separate from the current locations

– Building an adjacency table storing the neighbors of each vertex would be helpful, but not necessary

β€’ Initialize a temporary centroid as {0,0,0} at each vertex, and its neighbor count as 0.

β€’ For each triangle, add the coordinates of each vertex to the temporary centroids stored at the other two vertices and increment their neighbor count.

– The neighbor count is twice the actual # of edge neighbors

β€’ For each vertex, divide the centroid by its neighbor count.


Recommended