I need to register two point clouds; however my point sets have too many points, so it is quite slow to run.
I have followed the example from the IterativeClosestPoint.
A solution I can think of is to randomly sample my point clouds at each iteration, though I don’t think the registration method allows it…
Any workaround for first randomly sampling my PointSets before registering? I looked around but couldn’t find any. Should I write my own filter? Are there any guidelines/best practices for that?
Yes, random sampling the points is one good approach.
The points in a
PointSet have an integer index. In Python , you could quickly generate integer indices with
In C++, you could reuse the
RandomPermutation code used by
In either case, create a new point set and populated with points from the complete set using the first N indices.
A bonus challenge is to create a class that encapsulates this operation, and contribute it to the community!
Excited to try and contribute that once I get a bit of a break from school stuff!
Thank you for your post regarding the random sampling on a pointset. Could you please advise how would one uniformly sample the pointsets?
I think that two options are full sampling and random sampling. Every n-th point does not make much sense for point sets as it does for images.
Thank you for your response. Another quick question, would you know how to write a pointset to a file? I could not find an example to do so.
ITK has no specialized classes for reading and writing point sets.
For 3D points sets, it is possible to save point sets in mesh file formats like .OBJ. In C++,
itk::MeshFileWriter can be used. In Python, these are exposed with the more Pythonic
itk.meshwrite functions in ITK 5.1.