Skip to content

Commit

Permalink
add front func
Browse files Browse the repository at this point in the history
  • Loading branch information
yfeng95 committed Apr 28, 2018
1 parent 1b45a5d commit 4ab7649
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions utils/rotate_vertices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np

# import scipy.io as
def frontalize(vertices):
canonical_vertices = np.load('Data/uv-data/canonical_vertices.npy')

vertices_homo = np.hstack((vertices, np.ones([vertices.shape[0],1]))) #n x 4
P = np.linalg.lstsq(vertices_homo, canonical_vertices)[0].T # Affine matrix. 3 x 4
front_vertices = vertices_homo.dot(P.T)

return front_vertices

0 comments on commit 4ab7649

Please sign in to comment.