[vtkusers] 3d reconstruction

celeste gonzalez celgon23 at gmail.com
Fri Jul 23 19:21:04 EDT 2010


Hi everybody,

I want to reconstruct a 3D object via registration of stereo range data. I
am using vtkIterativeClosestPointTransform to align individual point sets
with respect to each other.


The sequence consists of 36 images pairs constituting a full rotation of the
object. I am using two consecutive points cloud with this code and
then I transform
the source points by the matrix solution.

Initially, I took the first pair of point cloud  then I use the point set
that was aligned and a new point cloud that I wish to align

The problem is when the rotation angle it’s over 90 grades, that is, from
the tenth picture the alignment fails.



This is part of the code I am using now.



      //setup ICP transform

      icp = vtkSmartPointer<vtkIterativeClosestPointTransform>::New();

      icp->SetSource(newPolydata);   // newPolydata

      icp->SetTarget(referencePolydata);   //  referencePolydata

      icp->GetLandmarkTransform()->SetModeToRigidBody();

      icp->SetMaximumNumberOfLandmarks((int)ceil(newPolydata->
GetNumberOfPoints()*0.9));



      icp->SetMaximumNumberOfIterations(100);

      icp->SetCheckMeanDistance(1);

      icp->SetMaximumMeanDistance(0.001);

      icp->StartByMatchingCentroidsOn();



      icp->Modified();

      icp->Update();



      vtkSmartPointer<vtkMatrix4x4> M = icp->GetMatrix();

      cout << "The resulting matrix is: " << *M << cout;



      vtkSmartPointer<vtkTransformPolyDataFilter> Transf =

      vtkSmartPointer<vtkTransformPolyDataFilter>::New();

      Transf->SetInput(newPolydata);

      Transf->SetTransform(icp);

      Transf->Update();



Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100723/f68b9910/attachment.htm>


More information about the vtkusers mailing list