[vtkusers] ICP with Point Cloud
samo
sandra.moritz at gmx.de
Tue May 29 11:27:45 EDT 2007
Hi guys
Thanks very much for your ideas, but unfortunately they both don't work.
Everytime I check the NumberOfIterations the icp needed, I get 0. My points
are completly random, sometimes I also have some points twice or more. What
could be the error? I understood both ideas, and in my opinion they should
work perfectly, but they don't
Has anybody an idea?
Emmanouil Moschidis wrote:
>
> 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.
> _______________________________________________
> 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
>
>
--
View this message in context: http://www.nabble.com/ICP-with-Point-Cloud-tf3816487.html#a10856362
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list