[vtkusers] ICP with Point Cloud

Emmanouil Moschidis moshman65 at yahoo.com
Fri May 25 12:15:17 EDT 2007


hi i have posted in the past this  piece of code that should work...


     vtkPoints *cloudPoints=new vtkPoints;
     vtkCellArray *cloudCells=new vtkCellArray;
     vtkPolyData *cloudPData=new vtkPolyData;


     cloudPoints->SetDataTypeToDouble();
     cloudPoints->SetNumberOfPoints(numberOfVTKPoints);


     for(int i=0; i<(numberOfVTKCells*3); i++)
     {         
cloudPoints->SetPoint(i,vtkStoredPointsBuffer[i].getX(),vtkStoredPointsBuffer[i].getY(),vtkStoredPointsBuffer[i].getZ());

     }

     cloudCells->InsertNextCell(numberOfVTKPoints);


     for (int i=0; i<numberOfVTKPoints; i++)
     {
         cloudCells->InsertCellPoint(i);
     }


     cloudPData->SetPoints(cloudPoints);
     cloudPData->SetLines(cloudCells);


the only weird thing you may see is these getX(), getY(), getZ() 
methods.The reason why i use these methods is that i store my points in 
std::vector<Point3D>where Point3D is a custom class for 3D points (in your case you use 
vtkPoints).
In general it works. Try if it works for your application too 

good luck 


samo <sandra.moritz at gmx.de> wrote: 

Hello together

I try to match a point cloud with a surface with the help of
vtkIterativeClosestPointAlgorithm. What I would like to know is, whether and
how I can use a point cloud in vtk. At the moment, I am using the vtkPoints
array to store all the points in. But when I want to use the icp, I need a
vtkDataSet. But, as I understood, the vtkDataSet always needs the cell
information. Is that right? I tried to use vtkUnstructuredGrid with only
setting points and no cells. But the icp calculated no transformation. Is
there a possiblility to use the icp without the cell information? As, in my
point cloud, I don't know how the points are organized. I just would like to
calculate a transformation from the point cloud to the surface. The icp
which I know from maths, is able to do that. 

Has anybody an idea?
-- 
View this message in context: http://www.nabble.com/ICP-with-Point-Cloud-tf3816487.html#a10804257
Sent from the VTK - Users mailing list archive at Nabble.com.

_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


       
---------------------------------
Pinpoint customers who are looking for what you sell. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070525/257148fb/attachment.htm>


More information about the vtkusers mailing list