NVlabs / dex-ycb-toolkit

A Python package that provides evaluation and visualization tools for the DexYCB dataset
https://dex-ycb.github.io
GNU General Public License v3.0
145 stars 24 forks source link

How to obtain point cloud of object? #27

Open f-q23 opened 1 year ago

f-q23 commented 1 year ago

I have seen that you provided the 6D pose of the object, but I need the complete point cloud of the object. Where should I go to get it?

ychao-nvidia commented 1 year ago

If you want the vertices of the object mesh, you can retrieve it once you load the mesh with trimesh (e.g., here):

mesh = trimesh.load(obj_file)
print(mesh.vertices)

You can transform the vertices to another frame with apply_transform(). For example, to transform the vertices to the camera frame here, you can do:

mesh = trimesh.load(obj_file[0])
mesh.apply_transform(np.vstack((pose_y[0], [0.0, 0.0, 0.0, 1.0])))
print(mesh.vertices)