jmccormac / pySceneNetRGBD

Scripts showing how to work with the SceneNetRGBD dataset
GNU General Public License v3.0
178 stars 46 forks source link

RGBD to 3D #6

Closed lynetcha closed 7 years ago

lynetcha commented 7 years ago

Do you have a code sample for how to transform a frame to 3D Points? And maybe visualize it?

jmccormac commented 7 years ago

I do have code for transforming points from a frame to 3D world points. This has already been done in the calculate_optical_flow.py script. On line 245, the points_in_world variable is a numpy array of the 3D world points for an arbitrary frame, it is of shape 320x240x3 (with the last dimension being the xyz coordinates).

I'm afraid I have no code snippet for nice visualisation of this, and that's not the aim of this repo. But with those 3D points, you could for example write out a .ply and visualise it in another software suite. I haven't done it, but I just searched and found a few tools that might help you with this:

For ply exporting: https://github.com/dranjan/python-plyfile

A ply viewer: http://potree.org/wp/ply-viewer/

Hope it helps.

lynetcha commented 7 years ago

This is very helpful. Thank you!