<meta http-equiv="content-type" content="text/html; charset=utf-8"><div class="gmail_quote">On Sun, Sep 18, 2011 at 2:57 PM, nuno.jf <span dir="ltr">&lt;<a href="mailto:nunofernandes7@gmail.com">nunofernandes7@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">David, thank you for your help.<br>
I am now using FindClosestNPoints and using the second point.<br>
The purpose of this distance calculation is because I&#39;m trying to remove<br>
noise from one point cloud and I am trying to implement in VTK, this<br>
Statistical Outlier Removal filter that is available in PCL. The link for<br>
this filter can be found bellow:<br>
<a href="http://pointclouds.org/documentation/tutorials/statistical_outlier.php#statistical-outlier-removal" target="_blank">http://pointclouds.org/documentation/tutorials/statistical_outlier.php#statistical-outlier-removal</a><br>

<br>
Basically, what they say regarding this filter is the following:<br>
&quot;For each point, we compute the mean distance from it to all its neighbors.<br>
By assuming that the resulted distribution is Gaussian with a mean and a<br>
standard deviation, all points whose mean distances are outside an interval<br>
defined by the global distances mean and standard deviation can be<br>
considered as outliers and trimmed from the dataset&quot;<br>
<br>
The method I am trying to implement is very exhaustive, as I am calculating<br>
the distances for all the points (I have ~ 80 000 points per cloud). I had<br>
the opportunity to see the code you developed to remove noise but, as I am<br>
still getting used with programming and with c++ I didn&#39;t understand to much<br>
of it.<br>
<br>
Do you have any suggestion for what I am trying to do?<br>
Thank you.<br>
Nuno</blockquote><div><br></div><div>You could use the CleanPolyDataFilter:</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CleanPolyData">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CleanPolyData</a></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">What my PointSetOutlierRemoval filter (<a href="http://www.midasjournal.org/browse/publication/708">http://www.midasjournal.org/browse/publication/708</a>) does is just record the distance from each point to its closest neighbor. It then removes a specified percentage of the points based on the distance that was computed (it sorts the distances and keeps the lowest N percent).</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><div>David</div></div>