freealise commited on
Commit
8a924ec
1 Parent(s): 2b0d69d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -247,9 +247,9 @@ def pano_depth_to_world_points(depth):
247
  d_lon = lon + i/2 * np.pi*2 / depth.shape[1]
248
  d_lat = lat + j/2 * np.pi / depth.shape[0]
249
 
250
- nx = np.cos(d_lon) * np.sin(np.pi-d_lat)
251
- ny = np.cos(np.pi-d_lat)
252
- nz = np.sin(d_lon) * np.sin(np.pi-d_lat)
253
 
254
  # Convert to cartesian coordinates
255
  x = radius * nx
@@ -329,7 +329,7 @@ def get_mesh(image, depth, blur_data, loadall):
329
 
330
  triangles = create_triangles(rgba.shape[0], rgba.shape[1])
331
  rgba_pil = Image.fromarray(blur_img.astype(np.uint8)).convert('RGB')
332
- material = trimesh.visual.texture.SimpleMaterial(image=rgba_pil) #, ambient=[0,0,0,0], diffuse=[0,0,0,0], specular=[0,0,0,0], glossiness=0)
333
  visuals = trimesh.visual.TextureVisuals(uv=uvs, image=rgba_pil, material=material)
334
  mesh.append(trimesh.Trimesh(vertices=verts, faces=triangles, vertex_normals=normals, visual=visuals, validate=True, process=False))
335
  #print('triangles - ok')
 
247
  d_lon = lon + i/2 * np.pi*2 / depth.shape[1]
248
  d_lat = lat + j/2 * np.pi / depth.shape[0]
249
 
250
+ nx = np.cos(d_lon) * np.sin(d_lat)
251
+ ny = np.cos(d_lat)
252
+ nz = np.sin(d_lon) * np.sin(d_lat)
253
 
254
  # Convert to cartesian coordinates
255
  x = radius * nx
 
329
 
330
  triangles = create_triangles(rgba.shape[0], rgba.shape[1])
331
  rgba_pil = Image.fromarray(blur_img.astype(np.uint8)).convert('RGB')
332
+ material = trimesh.visual.texture.SimpleMaterial(image=rgba_pil, ambient=[255,255,255,255], diffuse=[255,255,255,255], specular=[255,255,255,255], glossiness=255)
333
  visuals = trimesh.visual.TextureVisuals(uv=uvs, image=rgba_pil, material=material)
334
  mesh.append(trimesh.Trimesh(vertices=verts, faces=triangles, vertex_normals=normals, visual=visuals, validate=True, process=False))
335
  #print('triangles - ok')