(filename: str)
| 79 | |
| 80 | |
| 81 | def depth_read_kitti(filename: str): |
| 82 | # loads depth map D from png file |
| 83 | # and returns it as a numpy array, |
| 84 | # for details see readme.txt |
| 85 | img_pil = Image.open(filename) |
| 86 | depth_png = np.array(img_pil, dtype=int) |
| 87 | # make sure we have a proper 16bit depth map here.. not 8bit! |
| 88 | assert np.max(depth_png) > 255 |
| 89 | |
| 90 | depth = depth_png.astype(float) / 256.0 |
| 91 | depth[depth_png == 0] = -1.0 |
| 92 | return depth |
| 93 | |
| 94 | def depth_read_nyu(filename: str): |
| 95 | return np.load(filename) |