Nuno,<div><br></div><div>For ICP, the issue is that every point you choose for the source point set will feed into the calculation of the metric. If the clouds represent different sections of the same part, and you choose points outside of the overlap region, then the alignment will tend to increase the area of overlap. Since you seem to have a good initial set for the alignment, I would use this initial guess to estimate the area of overlap and then only choose points from the source set that lie within that region.</div>
<div><br></div><div>- Wes</div><div><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 10:45 AM, nuno.jf <span dir="ltr"><<a href="mailto:nunofernandes7@gmail.com">nunofernandes7@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Timm,<br>
<br>
Thank you very much for you message!<br>
Well, I know that each point cloud is rotated about 6.25 degrees in relation<br>
to the previous point cloud. So,<br>
I did this:<br>
<br>
vtkTransformPolyDataFilter *TF = vtkTransformPolyDataFilter::New();<br>
vtkTransform *ActualPosition = vtkTransform::New();<br>
<br>
ActualPosition -> Identity();<br>
ActualPosition -> PostMultiply();<br>
ActualPosition -> Translate( 0, 0, -875); // bings the point cloud to<br>
the origin<br>
ActualPosition -> RotateY( 5 * 1.25 ); // rotates the point cloud<br>
ActualPosition -> Translate( 0, 0, 875); // places the point cloud back<br>
to where it was<br>
<br>
TF -> SetInput( polyData2 );<br>
TF -> SetTransform( ActualPosition );<br>
TF -> Update();<br>
<br>
I believe the surfaces have sufficient overlapping parts for ICP to work,<br>
considering that each point cloud was obtained from the same equipment<br>
scanning the object and rotating it 6.25 degrees between consecutive scans.<br>
My ICP code is as follows:<br>
<br>
vtkIterativeClosestPointTransform * icp =<br>
vtkIterativeClosestPointTransform::New();<br>
<br>
// Set SOURCE and TARGET points<br>
<br>
icp -> SetTarget( polyData1 ); // I want to align polydata 2 with<br>
polydata1<br>
icp -> SetSource( TF -> GetOutput() ); // get polyData2 transformed as<br>
described above<br>
<br>
<br>
// Configure ICP transform<br>
//---------------------------------------------------------<br>
<br>
icp -> SetMaximumNumberOfIterations( 100 );<br>
icp -> SetMaximumNumberOfLandmarks( 10000 );<br>
icp -> StartByMatchingCentroidsOff();<br>
icp -> GetLandmarkTransform()->SetModeToRigidBody();<br>
icp -> SetMeanDistanceModeToRMS();<br>
icp -> SetMaximumMeanDistance(0.000001);<br>
icp -> Update();<br>
<br>
std::cout << "ICP Mean Distance RMS = " << icp -> GetMeanDistance() <<<br>
std::endl;<br>
<br>
What should I do?<br>
Thank you very much!<br>
Best regards,<br>
<br>
Nuno<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Several-point-clouds-alignment-using-ICP-tp3395391p3409677.html" target="_blank">http://vtk.1045678.n5.nabble.com/Several-point-clouds-alignment-using-ICP-tp3395391p3409677.html</a><br>
</font><div><div></div><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4920<br>
</div>