stray_visualize_3.py 363 B

12345678910
  1. def load_depth(path, confidence=None, filter_level=0):
  2. if path[-4:] == '.npy':
  3. depth_mm = np.load(path)
  4. elif path[-4:] == '.png':
  5. depth_mm = np.array(Image.open(path))
  6. depth_m = depth_mm.astype(np.float32) / 1000.0
  7. if confidence is not None:
  8. depth_m[confidence < filter_level] = 0.0
  9. return o3d.geometry.Image(depth_m)