Skip to content
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

[Question] Sub-sampling method #86

Open
maximecharriere opened this issue Jan 13, 2021 · 2 comments
Open

[Question] Sub-sampling method #86

maximecharriere opened this issue Jan 13, 2021 · 2 comments

Comments

@maximecharriere
Copy link

maximecharriere commented Jan 13, 2021

Hello,
I was wondering what was the method behind the sub-sampling parameterized with Number of samples (-n).

I have a 3D scan with 50k points and a reference with 500pts.
If I sub-sample the scan with CGAL::Polygon_mesh_processing::isotropic_remeshing() to get 1k points and use :
(Note the large N to avoid subsampling by OpenGr)

./Super4PCS -i input1 input2 -o 1.0 -d 2.50 -n 10000 -x

The result is perfect.

But if I don't sub-sample and directly use:
(Note the N of 1k samples)

./Super4PCS -i input1 input2 -o 1.0 -d 2.50 -n 1000 -x

I'm getting a bad result.

So I was wondering what sub-sampling method OpenGr uses.
Does it takes N points at random or the first N points?

@nmellado
Copy link

Hello @maximecharriere ,

This is very interesting question and experiment that you made. I am suspecting our sampling algorithm to be the cause of many of the wrong results we get with the library. Unfortunately I couldn't find time to investigate on this question.

@sgiraudot shall we update the documentation of the cgal wrapper to encourage users to subsample using cgal instead of OpenGR ?

Sampling is performed by hashing the coordinates of the input point cloud in a 3d grid, and keep only one representative sample per voxel. The resolution of the grid is computed according to the parameter (source code: https://github.com/STORM-IRIT/OpenGR/blob/master/src/gr/utils/sampling.h#L100)

I see a simple way to improve the performances of the sampling algorithm, which is to pre-rotate the input point cloud so it is aligned with the xyz coordinates of the grid (see call to the sampler here: https://github.com/STORM-IRIT/OpenGR/blob/master/src/gr/algorithms/matchBase.hpp#L275).
Getting something like poisson sampling will or equivalent would be of course even better.

@sgiraudot
Copy link

CGAL offers 3 subsampling algorithms for point clouds : grid (pretty much the same as you describe for OpenGR), random (self-explanatory) and hierarchical (which uses recursive subdivisions along PCA and thus is supposed to simplify more on planar regions). This last one might be interesting for registration but I wouldn't recommend it before being sure of this.

The algorithm cited in this issue is a remeshing algorithm which means that users need meshes as input (not raw point clouds). I'm glad it does bring good results with registration, but it seems quite specialized (and unusable for point clouds in general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants