Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -247,14 +247,14 @@ 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(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 =
|
256 |
-
y =
|
257 |
-
z =
|
258 |
|
259 |
pts = np.stack([x, y, z], axis=1)
|
260 |
uvs = np.stack([lon/np.pi/2, lat/np.pi], axis=1)
|
@@ -322,7 +322,7 @@ def get_mesh(image, depth, blur_data, loadall):
|
|
322 |
#cverts[i].append(verts[j])
|
323 |
#j=j+1
|
324 |
mesh.append(trimesh.PointCloud(verts))
|
325 |
-
mesh[len(mesh)-1]
|
326 |
mesh[len(mesh)-1].merge_vertices()
|
327 |
#i=i+1
|
328 |
mesh_n.append(str(fnum))
|
|
|
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
|
256 |
+
y = radius * ny
|
257 |
+
z = radius * nz
|
258 |
|
259 |
pts = np.stack([x, y, z], axis=1)
|
260 |
uvs = np.stack([lon/np.pi/2, lat/np.pi], axis=1)
|
|
|
322 |
#cverts[i].append(verts[j])
|
323 |
#j=j+1
|
324 |
mesh.append(trimesh.PointCloud(verts))
|
325 |
+
print(mesh[len(mesh)-1])
|
326 |
mesh[len(mesh)-1].merge_vertices()
|
327 |
#i=i+1
|
328 |
mesh_n.append(str(fnum))
|