[vtkusers] How to resample VtkPolyData to make sure two VtkPolyData have same number of points?

David Doria daviddoria at gmail.com
Fri Aug 24 07:29:56 EDT 2012


On Fri, Aug 24, 2012 at 5:25 AM,  <huangcheng1987928 at gmail.com> wrote:
> Sorry I didn't state the question clearly enough. These two polydata do not
> have the same geometry construction. So they are not exactly correspondence
> spatially. First I want to resample the polydata to make sure they have same
> number of polydata so I can do the correspondence alignement next. Anyway to
> do that?

One way to go is to determine the approximate correspondence (the
first step in an ICP-like algorithm). I would take the cloud with the
larger number of points and build a KDTree on it. Then for each point
in the smaller cloud, lookup the closest point in the tree and use
that as the correspondence. At the end of this process, you will have
a downsampled larger cloud (to match the number of points in the
smaller cloud) where each point is as close to a point in the smaller
cloud as possible.

David



More information about the vtkusers mailing list