Segmentation of objects in a point cloud (Python)

@jball, something isn’t right with the format of that PLY file… the vertices are not being properly defined. To mitigate this, simply load and cast:

import vtki
import numpy as np

filename = '/Users/bane/Downloads/Test_point_cloud.ply'
# Read the improperly formatted PLY file
foo = vtki.read(filename)
# Grab points from bad data structure and use those point to construct PolyData correctly
pc = vtki.PolyData(foo.points)
# Elevation filter
evgf = pc.elevation() # defaults are min/max Z bounds
# And render it
evgf.plot()

Note that you can use sphere rendering with the render_points_as_spheres=True argument to the plot() call:

evgf.plot(render_points_as_spheres=True)

Now that the vertice cells are properly defined, there’s no need for a glyph filter. However, if you like glyphing, vtki has code for that! Check out this example.