Date post: | 17-Jan-2016 |
Category: |
Documents |
Upload: | mitchell-barber |
View: | 213 times |
Download: | 0 times |
CSE554 Fairing Slide 1
CSE 554
Lecture 6: Fairing
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
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
CSE554 Fairing Slide 4
Fairing a 1D SignalFairing a 1D Signal
β’ Taking out βhigh frequencyβ content
(slides materials courtesy of Andy van Dam)
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)
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
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)
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:
π [π₯]
π
π€ [π₯ ]
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
π
π [π₯]
π€ [π₯βπ ]
π [π₯]β π€ [π₯βπ ]
( π βπ€ ) [π ]=β«ββ
β
π [π₯ ] β π€ [π₯βπ ]π π₯
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
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
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:
Γ
β
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 :
Γ
β
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 :
Γ
β
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π π
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
(
(
CSE554 Fairing Slide 17
Curve FairingCurve Fairing
β’ Reducing βbumpinessβ by changing the vertex locations
CSE554 Fairing Slide 18
Curve FairingCurve Fairing
β’ Curve as a signal
β The βsignalβ at each vertex is its location
{x,y}
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
CSE554 Fairing Slide 20
Curve FairingCurve Fairing
β’ Drawback
β The initial shape is shrunk!
100 iterations 200 iterations 400 iterations
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
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
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
π ππ
π
CSE554 Fairing Slide 24
Surface FairingSurface Fairing
β’ Example: fairing iso-surface of a binary volume
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.