[vtkusers] Output of ICP in VTK

Li, Shuning li33 at iupui.edu
Fri Jan 19 09:58:05 EST 2007


Hello World,

I have some quesitons about the output of
'vtkIterativeClosestPointTransform'. I have two .stl models, and I
try to use 'vtkIterativeClosestPointTransform' to align them. After
the alignment, I want to output the transformation matrix of the
source model during the whole processes and distance of the two
models at their final positions. Following is a part of my code:

  vtkIterativeClosestPointTransform *icp =
vtkIterativeClosestPointTransform::New();
  icp->SetSource(selection2);
  icp->SetTarget(selection1);
  icp->SetCheckMeanDistance(1);
  icp->SetMaximumMeanDistance (0.0000001);
  icp->SetMaximumNumberOfIterations (20);
  icp->SetMaximumNumberOfLandmarks (600);
  icp->GetLandmarkTransform()->SetModeToRigidBody();
  icp->StartByMatchingCentroidsOn();

  cylinderTransformMatrix = vtkMatrix4x4::New();
  cylinderTransformMatrix = icp->GetLandmarkTransform()->GetMatrix();
  ... ...
  cout<<"\n\nMean Distance : "<<icp->GetMeanDistance();

The questions are:
1 The transform matrix I got from this code is the incremental matrix
between the last two iterations, and it is not the transformation
matrix during the whole processes. If I can get the incremental
matrix between any two iterations, then I can multiply them together.
But now I can only get the matrix between the last two iterations.

2 The 'mean distance' I output here is the distance between the last
two iterations, and it is not the distance between the two models
after the alignment.

Now I don't know how can I obtain the matrix and distance I want, I
didn't find any function of 'vtkIterativeClosestPointTransform' can
give these outputs. Does anybody have some ideas or experiences about
this problem? Welcome to any suggestion! Thanks.

Regards,

Shuning


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070119/9e6c0b27/attachment.htm>


More information about the vtkusers mailing list