pyglet_pointcloud_viewer.py example an filtering
I looked at this script: pyglet_pointcloud_viewer.py I have created a box, now I only want to display the points within this vertices. I would like to continue working with these points and output a defined number of points with the smallest depth, i.e. the closest to the camera. It would be nice if jamnd could help me here, at which point does filtering make the most sense, are there opengl functions that make filtering easier?
-
ok, I tried the following:
I think this is the tight place to do the filtering:
verts = np.asarray(points.get_vertices(2)).reshape(h, w, 3)texcoords = np.asarray(points.get_texture_coordinates(2))here's my problem, the pointcloud is a 2 dimensionale array, with a xyz array, how can I address this?mask_x_1 = verts[:,2,0] > -0.5mask_x_2 = verts[:,2,0] < 0.5
# Y Axismask_y_1 = verts[:,2,1] > 0mask_y_2 = verts[:,2,1] < 1mask_x = np.logical_and(mask_x_1, mask_x_2)mask_y = np.logical_and(mask_y_1, mask_y_2)#mask_z = np.logical_and(mask_z_1, mask_z_2)#mask = np.logical_and(mask_x, mask_y, mask_z)mask = np.logical_and(mask_x, mask_y)inbox = verts[mask]
Please sign in to leave a comment.
Comments
1 comment