Subsample point cloud based on the density of another point cloud
See original GitHub issueHi @marcomusy,
I am trying to subsample a point cloud based on the density of another point cloud. For example I have the following two point clouds of different sizes, i.e. with green and red color:
Now I want to do two operations to subsample a point cloud based on 1. a given fixed number of points or 2. based on how the density or the specified fraction of the object size of another point cloud is. The idea is to subsample the smaller point cloud to a given number of points and then the bigger point cloud to a number of points based on the density of the smaller point cloud after the subsampling. So that they have similar density and not one point cloud to be dense and the other sparse and to keep let’s say a similar kind of fraction distance between the points of the two point clouds. For example the output in the image bellow:
vd.show(pcds[0].clone().subsample(0.05), pcds[1].clone().subsample(0.05), axes=1, interactive=True).close()
is not ideal since the smaller part is more dense than the larger part.
I was checking on the subsample()
and density()
operations. The subsample()
method needs a fraction number so you cannot pass a fixed number of points and the density()
function I am not sure whether it is relevant to be used for extracting such a number.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
well it very much depends if you consider “closed” clouds (clouds which may define a surface) or “dense” clouds where points are scattered in the full 3d space… the the concept of “volume” means different things. I don’t see any objective way to define it, or translate it to the subsample() method, you need to do it based on the problem at hand.
Yes the
absolute=True
parameter is fixed now.I agree regarding measuring density/sparsity that it is a bit ambiguous how to measure it. I am also trying to figure out the best way.