Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -57,14 +57,14 @@ def stitch_rgbd_videos(
|
|
57 |
cmap = matplotlib.colormaps.get_cmap("inferno")
|
58 |
depth_color = (cmap(depth_norm / 255.0)[..., :3] * 255).astype(np.uint8)
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
#depth_vis = np.stack([depth_gray] * 3, axis=-1)
|
65 |
-
|
66 |
-
depth_gray = cv2.cvtColor(depth_color, cv2.COLOR_RGB2GRAY)
|
67 |
depth_vis = np.stack([depth_gray] * 3, axis=-1)
|
|
|
|
|
|
|
68 |
else:
|
69 |
# Directly generate a grayscale image from the normalized depth values.
|
70 |
depth_vis = np.stack([depth_norm] * 3, axis=-1)
|
|
|
57 |
cmap = matplotlib.colormaps.get_cmap("inferno")
|
58 |
depth_color = (cmap(depth_norm / 255.0)[..., :3] * 255).astype(np.uint8)
|
59 |
|
60 |
+
if len(depth_color.shape) == 3 and depth_color.shape[2] in [3, 4]:
|
61 |
+
depth_gray = cv2.cvtColor(depth_color, cv2.COLOR_RGB2GRAY)
|
62 |
+
else:
|
63 |
+
depth_gray = depth_color
|
|
|
|
|
|
|
64 |
depth_vis = np.stack([depth_gray] * 3, axis=-1)
|
65 |
+
|
66 |
+
#depth_gray = cv2.cvtColor(depth_color, cv2.COLOR_RGB2GRAY)
|
67 |
+
#depth_vis = np.stack([depth_gray] * 3, axis=-1)
|
68 |
else:
|
69 |
# Directly generate a grayscale image from the normalized depth values.
|
70 |
depth_vis = np.stack([depth_norm] * 3, axis=-1)
|