I have been trying to follow your suggestions, but I am somewhat hung up on the data set;<br>When you say <br> locator->SetDataSet(data); // data represents the surface<br>what is the representation of the surface? Is it the surface itself, or the maskpoints vertices data? I had originally imagined using the vertices to represent the surface in the locator, and measure the distance to this surface representation from a different point cloud, but your description takes the vertices, distorts them with noise and displaces the noisy vertices representation in space. I have been having trouble using locators (my application tends to crash at the implimentation of the "findclosestpoint" method), and I wonder if it is because I am using the wrong data set, be it from the filter producing my surface, or the maskpoints vertices data.<br>
<br>Jason<br><br><div class="gmail_quote">On Thu, Feb 21, 2008 at 4:57 AM, Steffen Oeltze <<a href="mailto:stoeltze@isg.cs.uni-magdeburg.de">stoeltze@isg.cs.uni-magdeburg.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, it works. Instead of creating the surface, I import a surface.<br>
Then, I'm using vtkMaskPoints as well to randomly select surface<br>
vertices. Next, I apply some noise to these vertices, a little bit of<br>
translation and rotation. Finally, I use the ICP to bring the points<br>
back to the surface.<br>
<br>
Then, I measured the Euclidean distance between the transformed points<br>
(before and after ICP) and the surface. For that purpose, I use:<br>
<br>
<br>
vtkCellLocator *locator = vtkCellLocator::New();<br>
locator->SetDataSet(data); // data represents the surface<br>
locator->SetNumberOfCellsPerBucket(1);<br>
locator->BuildLocator();<br>
locator->Update();<br>
<br>
in a loop:<br>
<br>
locator->FindClosestPoint(inPoint, closestPointOnSurface, cell_id,<br>
sub_id, dist2);<br>
<br>
Cheers,<br>
Steffen<br>
<br>
<br>
<br>
<br>
Jason Taclas schrieb:<br>
<div class="Ih2E3d">> have you gotten this to work? I'm having trouble on a similar project;<br>
> I am also using vtkIterativeClosestPoint to register a point cloud to a<br>
> surface, and I also need to make distance measurements. If it matters<br>
> at all, my surface was created with vtkMarchingCubes. I used<br>
> vtkMaskPoints with GenerateVerticesOn to get to vertices, is this what<br>
> you did?<br>
><br>
> On Feb 15, 2008 9:21 AM, Steffen Oeltze<br>
> <<a href="mailto:stoeltze@isg.cs.uni-magdeburg.de">stoeltze@isg.cs.uni-magdeburg.de</a><br>
</div><div class="Ih2E3d">> <mailto:<a href="mailto:stoeltze@isg.cs.uni-magdeburg.de">stoeltze@isg.cs.uni-magdeburg.de</a>>> wrote:<br>
><br>
> Thanks a lot for the hint! I'm using vtkCellLocator now to determine the<br>
> closest point on a surface for a given position in 3D.<br>
><br>
> Steffen<br>
><br>
> <a href="mailto:cedric.schwartz@enst-bretagne.fr">cedric.schwartz@enst-bretagne.fr</a><br>
</div>> <mailto:<a href="mailto:cedric.schwartz@enst-bretagne.fr">cedric.schwartz@enst-bretagne.fr</a>> schrieb:<br>
<div class="Ih2E3d">> > Hi,<br>
> > As far as I know you can't have the distance information with the ICP<br>
> > transform. Maybe you should try vtkPointLocator or vtkKdTree in<br>
> order to<br>
> > obtain the distance measure.<br>
> > Cedric<br>
> ><br>
> > _______________________________________________<br>
> > This is the private VTK discussion list.Please keep messages<br>
> on-topic.<br>
> > Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
> ><br>
> ><br>
><br>
><br>
> _______________________________________________<br>
> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
><br>
><br>
><br>
</div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="Wj3C7c">><br>
> _______________________________________________<br>
> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
<br>
<br>
<br>
</div></div></blockquote></div><br>