def test_sun_rgbd():
from pybot.vision.image_utils import to_color
from pybot.vision.imshow_utils import imshow_cv
from pybot.utils.io_utils import write_video
from pybot.vision.color_utils import colormap
directory = '/media/HD1/data/SUNRGBD/'
dataset = SUNRGBDDataset(directory)
colors = cv2.imread('data/sun3d/sun.png').astype(np.uint8)
for (rgb, depth, label) in dataset.segmentationdb(None):
cout = np.dstack([label, label, label])
colored = cv2.LUT(cout, colors)
cdepth = colormap(depth / 64000.0)
for j in range(5):
write_video('xtion.avi', np.hstack([rgb, cdepth, colored]))
# for f in dataset.iteritems(every_k_frames=5):
# # vis = rgbd_data_uw.annotate(f)
# imshow_cv('frame', f.img, text='Image')
# imshow_cv('depth', (f.depth / 16).astype(np.uint8), text='Depth')
# imshow_cv('instance', (f.instance).astype(np.uint8), text='Instance')
# imshow_cv('label', (f.label).astype(np.uint8), text='Label')
# cv2.waitKey(100)
return dataset
评论列表
文章目录