hzxie/GRNet

How do you visualize the point cloud in your paper?

Closed this issue · 1 comments

Which library you use to visualize the point cloud in your paper? Could you please release the code?

hzxie commented

Please refer to the code below

GRNet/utils/helpers.py

Lines 40 to 58 in 8ccac42

def get_ptcloud_img(ptcloud):
fig = plt.figure(figsize=(8, 8))
x, z, y = ptcloud.transpose(1, 0)
ax = fig.gca(projection=Axes3D.name, adjustable='box')
ax.axis('off')
ax.axis('scaled')
ax.view_init(30, 45)
max, min = np.max(ptcloud), np.min(ptcloud)
ax.set_xbound(min, max)
ax.set_ybound(min, max)
ax.set_zbound(min, max)
ax.scatter(x, y, z, zdir='z', c=x, cmap='jet')
fig.canvas.draw()
img = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
img = img.reshape(fig.canvas.get_width_height()[::-1] + (3, ))
return img