Spaces:
Starting
Starting
Update app.py
Browse files
app.py
CHANGED
@@ -282,23 +282,24 @@ def get_mesh(image, depth, blur_data, loadall):
|
|
282 |
gdepth = cv2.cvtColor(depthc, cv2.COLOR_RGB2GRAY) #rgb2gray(depthc)
|
283 |
|
284 |
print('depth to gray - ok')
|
285 |
-
points = pano_depth_to_world_points(gdepth)
|
286 |
-
pts3d = points[0]
|
287 |
#uv = points[1]
|
|
|
288 |
print('radius from depth - ok')
|
289 |
|
290 |
# Create a trimesh mesh from the points
|
291 |
# Each pixel is connected to its 4 neighbors
|
292 |
# colors are the RGB values of the image
|
293 |
#uvs = uv.reshape(-1, 2)
|
294 |
-
verts = pts3d.reshape(-1, 3)
|
295 |
-
rgba = cv2.cvtColor(blur_img, cv2.COLOR_RGB2RGBA)
|
296 |
-
colors = rgba.reshape(-1, 4)
|
297 |
clrs = [[128,128,128,0]]
|
298 |
|
299 |
-
for i in range(0,1): #(0,4)
|
300 |
-
clrs = np.concatenate((clrs, colors), axis=0)
|
301 |
-
i = i+1
|
302 |
|
303 |
#triangles = create_triangles(rgba.shape[0], rgba.shape[1])
|
304 |
#mesh.append(trimesh.Trimesh(vertices=verts, faces=triangles))
|
@@ -330,7 +331,7 @@ def get_mesh(image, depth, blur_data, loadall):
|
|
330 |
#print(len(ln))
|
331 |
#print(len(cr))
|
332 |
#mesh.append(trimesh.path.path.Path3D(entities=ln, vertices=verts, colors=cr))
|
333 |
-
mesh.append(trimesh.PointCloud(
|
334 |
mesh[len(mesh)-1].merge_vertices()
|
335 |
mesh_n.append(str(fnum))
|
336 |
#binary = DracoPy.encode(verts, colors=clrs.astype(np.uint8))
|
|
|
282 |
gdepth = cv2.cvtColor(depthc, cv2.COLOR_RGB2GRAY) #rgb2gray(depthc)
|
283 |
|
284 |
print('depth to gray - ok')
|
285 |
+
#points = pano_depth_to_world_points(gdepth)
|
286 |
+
#pts3d = points[0]
|
287 |
#uv = points[1]
|
288 |
+
pts3d = [[0,0,0]]
|
289 |
print('radius from depth - ok')
|
290 |
|
291 |
# Create a trimesh mesh from the points
|
292 |
# Each pixel is connected to its 4 neighbors
|
293 |
# colors are the RGB values of the image
|
294 |
#uvs = uv.reshape(-1, 2)
|
295 |
+
#verts = pts3d.reshape(-1, 3)
|
296 |
+
#rgba = cv2.cvtColor(blur_img, cv2.COLOR_RGB2RGBA)
|
297 |
+
#colors = rgba.reshape(-1, 4)
|
298 |
clrs = [[128,128,128,0]]
|
299 |
|
300 |
+
#for i in range(0,1): #(0,4)
|
301 |
+
#clrs = np.concatenate((clrs, colors), axis=0)
|
302 |
+
#i = i+1
|
303 |
|
304 |
#triangles = create_triangles(rgba.shape[0], rgba.shape[1])
|
305 |
#mesh.append(trimesh.Trimesh(vertices=verts, faces=triangles))
|
|
|
331 |
#print(len(ln))
|
332 |
#print(len(cr))
|
333 |
#mesh.append(trimesh.path.path.Path3D(entities=ln, vertices=verts, colors=cr))
|
334 |
+
mesh.append(trimesh.PointCloud(pts3d, colors=clrs))
|
335 |
mesh[len(mesh)-1].merge_vertices()
|
336 |
mesh_n.append(str(fnum))
|
337 |
#binary = DracoPy.encode(verts, colors=clrs.astype(np.uint8))
|