Skip to content

Commit

Permalink
add colors from texture
Browse files Browse the repository at this point in the history
  • Loading branch information
yfeng95 committed May 11, 2018
1 parent 3fa07f2 commit e8402a1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,24 @@ def get_vertices(self, pos):
Returns:
vertices: the vertices(point cloud). shape = (num of points, 3). n is about 40K here.
'''
all_vertices = np.reshape(pos, [self.resolution_op**2, -1]);
all_vertices = np.reshape(pos, [self.resolution_op**2, -1])
vertices = all_vertices[self.face_ind, :]

return vertices

def get_colors_from_texture(self, texture):
'''
Args:
texture: the texture map. shape = (256, 256, 3).
Returns:
colors: the corresponding colors of vertices. shape = (num of points, 3). n is 45128 here.
'''
all_colors = np.reshape(texture, [self.resolution_op**2, -1])
colors = all_colors[self.face_ind, :]

return colors


def get_colors(self, image, vertices):
'''
Args:
Expand Down

0 comments on commit e8402a1

Please sign in to comment.