[vtkusers] vtkIterativeClosestPointTransform

samo sandra.moritz at gmx.de
Tue May 15 08:08:34 EDT 2007



Hey people

I try to use vtkIterativeClosestPointTransform, and it also seems to
calculate a transformation, but when I apply this transformation on my data,
it is not matched at all. 

Here is my code:
vtkIterativeClosestPointTransform *icp =
vtkIterativeClosestPointTransform::New();
	icp->SetTarget(cData->GetClippedOutput());
	icp->SetSource(clipData->GetClippedOutput());

	icp->SetCheckMeanDistance(true);
	icp->SetMaximumMeanDistance(0.0001);
	icp->SetMaximumNumberOfIterations(1000);
	icp->SetMaximumNumberOfLandmarks(400);
	icp->GetLandmarkTransform()->SetModeToRigidBody();

	icp->StartByMatchingCentroidsOff();
	icp->Update();

	vtkTransformPolyDataFilter* transPoly = vtkTransformPolyDataFilter::New();
	transPoly->SetInput(clipData->GetClippedOutput());
	vtkTransform* trans = vtkTransform::New();
	trans->SetMatrix(icp->GetMatrix());
	transPoly->SetTransform(trans);
	transPoly->Update();

	vtkPolyDataMapper* mapICP = vtkPolyDataMapper::New();
	mapICP->SetInput(transPoly->GetOutput());
	//mapICP->SetInput(clipData->GetClippedOutput());

	vtkActor* actICP = vtkActor::New();
	actICP->SetMapper(mapICP);
	actICP->GetProperty()->SetColor(0,0,1);
	RendererDetail->AddActor(actICP);

	vtkPolyDataMapper* clippedOutput = vtkPolyDataMapper::New();
	clippedOutput->SetInput(clipData->GetClippedOutput());

	vtkActor* clippedAct = vtkActor::New();
	clippedAct->SetMapper(clippedOutput);
	clippedAct->GetProperty()->SetColor(1,0,0);
	RendererDetail->AddActor(clippedAct);

My question now is whether the icp is not working correctly or I don't aply
the icp-transformation in the right way. Does anybody has an idea why, after
applying the icp-transformation, my data is anything else than mapped? 

Any help would be very appreciated.
 
-- 
View this message in context: http://www.nabble.com/vtkIterativeClosestPointTransform-tf3758106.html#a10621563
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list