def load_depth(self, idx):
"""
Load depth map and preprocess:
- resize
- cast to float
- subtract mean
"""
idx = self.indices_depth[idx]
idx=idx.split()[0]
im = io.imread('{}/depth/{}'.format(self.data_dir, idx))
im = Image.fromarray(im)
im = im.resize((self.width, self.height), Image.ANTIALIAS) # resize
im = np.array(im, dtype=np.float32) # cast to float
d = im
d -= self.mean_depth # mean subtraction
d = d[np.newaxis, ...]
return d
评论列表
文章目录