Skip to content

Instantly share code, notes, and snippets.

@planetceres
Last active September 2, 2021 15:15
Show Gist options
  • Save planetceres/be1e99b90f4a8bb1388062e8dec13eb8 to your computer and use it in GitHub Desktop.
Save planetceres/be1e99b90f4a8bb1388062e8dec13eb8 to your computer and use it in GitHub Desktop.
Simple depth image viewer

Simple depth image viewer

pip3 install open3d

To run:

python3 depth_view.py <path_to_depth_png>
#!/usr/bin/env python
import open3d as o3d
import matplotlib.pyplot as plt
import os
import sys
if len(sys.argv) > 1:
file_path = sys.argv[1]
else:
print("Usage: python3 depth_view.py <path_to_depth_png>")
sys.exit(1)
depth_raw = o3d.io.read_image(file_path)
plt.imshow(depth_raw)
plt.show()
#!/usr/bin/env python
import os
import sys
import open3d as o3d
if len(sys.argv) > 1:
file_path = sys.argv[1]
pc = o3d.io.read_point_cloud(file_path)
o3d.visualization.draw_geometries([pc])
else:
print("Usage: python3 point_view.py <path_to_points>")
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment