Lecture 11: Group Assignment 1 Review, Procrustes Intro COMPSCI/MATH 290-04 Chris Tralie, Duke University 2/18/2016 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Table of Contents ◮ Assignment Concepts Review ⊲ PCA New Convention ⊲ Procrustes Distance COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Code Layout: Recursive Scene Graph Traversal f(node, mvMatrix): for c in node.children: if (’mesh’ in node) { //Do some stuff if this isn’t a dummy node } f(c, mat4.mul(mvMatrix, node.transform)); Call this function with “scene” to start the recursion COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Code Layout: Meshes (What Is A Mesh??) var mesh = node.mesh; //Loop through faces for (var f = 0; f < mesh.faces.length; f++) { //"Pointer" to face var face = mesh.faces[f]; //For each face get vertices in CCW order var verts = face.getVerticesPos(); //Do stuff with the vertices... } COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Code Layout: Image Sources scene.imsources = [scene.source]; for (order = 1:k): for s in scene.imsources: if s.order == order-1 { //Reflect (call recursive scene tree function) //Generate a bunch of images snew snew.parent = s snew.genFace = face reflected } COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Reflections / Projections COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Reflections / Projections Plane: ( � q ,� n ) Point: � p Reflection: � p − 2 (( � p − � q ) · n ) � n COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Ray Intersect Plane COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Ray Intersect Plane ( � p 0 + t � v − � q ) · � n = 0 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Ray Intersect Plane ( � p 0 + t � v − � q ) · � n = 0 t = ( � q − � p 0 ) · n � v · � n COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Point Inside Convex Polygon: Area Test 5 6 7 4 1 3 2 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Convex Polygon Area? 5 6 7 4 1 3 2 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Convex Polygon Area: Triangle Fan 5 6 7 4 1 3 2 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Extra Stuff: Binaural Sound COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Extra Stuff: Transmission 1 2 3 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Extra Stuff: Transmission (Raffle Point) Regular expressions 1 2 3 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Extra Stuff: Transmission (Raffle Point) Regular expressions ( r | t ) ∗ 1 2 3 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Extra Stuff: Frequency dependent transmission COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Extra Stuff: Bounding Box Speedup root COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Table of Contents ⊲ Assignment Concepts Review ◮ PCA New Convention ⊲ Procrustes Distance COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention Organize point cloud into d × N matrix, each point along a column | | . . . | . . X = � � � v 1 v 2 . v N | | | . . . Choose a unit column vector direction u ∈ R d × 1 Then d = u T X gives projections onto u COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention Organize point cloud into d × N matrix, each point along a column | | . . . | . . X = � � � v 1 v 2 . v N | | | . . . Choose a unit column vector direction u ∈ R d × 1 Then d = u T X gives projections onto u ⊲ More consistent with what we’ve done; points in columns COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention d = u T X COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention d = u T X ⊲ How to express the sum of the squares of the dot products? COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention d = u T X ⊲ How to express the sum of the squares of the dot products? dd T COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention d = u T X ⊲ How to express the sum of the squares of the dot products? dd T dd T = ( u T X )( u T X ) T = u T XX T u Want to find u that maximizes the above quadratic form COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention Use eigenvectors of A = XX T to find principal directions maximizing u T Au λ 1 = 422 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
PCA New Convention Use eigenvectors of A = XX T to find principal directions maximizing u T Au λ 2 = 21 . 6 COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Table of Contents ⊲ Assignment Concepts Review ⊲ PCA New Convention ◮ Procrustes Distance COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Procrustes Distance http://www.procrustes.nl/gif/illustr.gif COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Procrustes Alignment COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Procrustes Distance x i } N y i } N Given two point clouds { � i = 1 and { � i = 1 where x i and y i are in correspondence Seek to minimize N � x i + � y i || 2 || R ( � t ) − � 2 i = 1 over all orthogonal matrices R and translation vectors t . || . || 2 is squared distance COMPSCI/MATH 290-04 Lecture 11: Group Assignment 1 Review, Procrustes Intro
Recommend
More recommend