Downsampling point clouds to specific number of points while retaining shape
Unfortunately, the answer is no. The number of output points using PCL's VoxelGrid is always going to be a function of the number of occupied voxels. The only way to control the number of occupied voxels is by altering the leaf size, and there is no dynamic way of doing this.
Alternately, you may have luck using Farthest Point Sampling, as it would allow you to select N points and has nice blue noise properties, but to the best of my knowledge this is not available in PCL.
Environment: Python-PCL, WIndows 10, Python 3.6
I need to downsample point clouds to a specific number of points. These point clouds vary in size and hence I am stuck. From going through documentation, I understand there are only 
VoxelGrid, ConditionalOutlierRemoval ,StatisticalOutlierRemoval and RadiusOutlierRemoval   are the options available. 
In VoxelGrid, the leaf size doesnt guarantee the number of points, Radius removal doesnt help in retaining the shape, and statistical outlier mostly helps in removing noise. 
Is there any solution to this? It is possible to use numpy.random.choice()and hoping for a miracle? 
EDIT: numpy.random.choice works but only if you don't care about the geometric shape of your point cloud, which I do. Anyway to use VoxelGrid dynamically?