[vtkusers] Several point clouds alignment using ICP

nuno.jf nunofernandes7 at gmail.com
Fri Mar 4 10:45:53 EST 2011


Hi Timm,

Thank you very much for you message!
Well, I know that each point cloud is rotated about 6.25 degrees in relation
to the previous point cloud. So,
I did this:

vtkTransformPolyDataFilter *TF = vtkTransformPolyDataFilter::New(); 
		vtkTransform *ActualPosition = vtkTransform::New(); 

		ActualPosition -> Identity();
		ActualPosition -> PostMultiply();
		ActualPosition -> Translate( 0, 0, -875);			// bings the point cloud to
the origin
		ActualPosition -> RotateY( 5 * 1.25 );			// rotates the point cloud
		ActualPosition -> Translate( 0, 0,  875);			// places the point cloud back
to where  it was

		TF -> SetInput( polyData2 ); 
		TF -> SetTransform( ActualPosition );
		TF -> Update(); 

I believe the surfaces have sufficient overlapping parts for ICP to work,
considering that each point cloud was obtained from the same equipment
scanning the object and rotating it 6.25 degrees between consecutive scans.
My ICP code is as follows:

vtkIterativeClosestPointTransform * icp =
vtkIterativeClosestPointTransform::New();

		// Set SOURCE and TARGET points
	
		icp -> SetTarget( polyData1 );  // I want to align polydata 2 with
polydata1
		icp -> SetSource( TF -> GetOutput() ); // get polyData2 transformed as
described above
		
		
		// Configure ICP transform
		//---------------------------------------------------------		
		
		icp -> SetMaximumNumberOfIterations( 100 );
		icp -> SetMaximumNumberOfLandmarks( 10000 );
		icp -> StartByMatchingCentroidsOff();
		icp -> GetLandmarkTransform()->SetModeToRigidBody();
		icp -> SetMeanDistanceModeToRMS();
		icp -> SetMaximumMeanDistance(0.000001);
		icp -> Update();

		std::cout << "ICP Mean Distance RMS = " << icp -> GetMeanDistance() <<
std::endl;

What should I do?
Thank you very much!
Best regards,

Nuno

--
View this message in context: http://vtk.1045678.n5.nabble.com/Several-point-clouds-alignment-using-ICP-tp3395391p3409677.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list