New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix init_2d_grid for TriMesh subclasses + add init_from_depth_image #690

Merged
merged 8 commits into from May 18, 2016

Conversation

Projects
None yet
2 participants
@patricksnape
Contributor

patricksnape commented May 9, 2016

Fixes #688.

Also fixes a horrible default argument bug for ColouredTriMesh.

The default grid texture coordinates are the coordinates you would use to texture an image on a 3D grid.
Also adds a new init_from_depth_image method that uses the init_2d_grid method to create a 2D grid and then concatenates a set of heights/depths in the form of an image and returns a 3D PointCloud or subclass.

E.g

depth_image = Image(np.random.random((100, 100)))
tr = TriMesh.init_from_depth_image(depth_image)

gives a 3D mesh with random heights, in the correct orientation for viewing a mesh 'image'.

patricksnape added some commits May 9, 2016

Fix init_2d_grid for trimesh subclasses
Also expose the extra constructor arguments

patricksnape added some commits May 10, 2016

Add init_from_depth_image method
Creates a 3D mesh from a given depth image. Handy for building
meshes from depth values recovered from images.
Add init_2d_grid and init_from_depth_image to PointGraph
Bit more complicated than the other ones but seems to work.
Also, had to add the stencil_grid method from pyamg - but this
is quite useful in general so I've exposed it at the top level.
Improve masking for pointgraphs
We were converting the adjacency matrix to a dense matrix which
was killing memory. But, the latest scipy supports fancy
indexing of sparse matrices so we can do that for both sparse
and dense matrices.

@patricksnape patricksnape changed the title from Fix `init_2d_grid` for TriMesh subclasses to Fix `init_2d_grid` for TriMesh subclasses + add init_from_depth_image May 10, 2016

@patricksnape patricksnape changed the title from Fix `init_2d_grid` for TriMesh subclasses + add init_from_depth_image to Fix init_2d_grid for TriMesh subclasses + add init_from_depth_image May 10, 2016

@patricksnape patricksnape referenced this pull request May 13, 2016

Closed

0.7.0 Release Requirements #693

11 of 11 tasks complete
@jabooth

This comment has been minimized.

Member

jabooth commented May 18, 2016

@patricksnape looks good to me on quick inspection. +1

@jabooth jabooth merged commit a8a25ce into menpo:master May 18, 2016

3 of 4 checks passed

OS X MenpoBot Jenkins build triggered
Details
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jabooth jabooth removed the in progress label May 18, 2016

@patricksnape patricksnape deleted the patricksnape:init_from_trimesh branch May 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment