[vtkusers] 3D point cloud nearest neighbor search

Benoist Laurent benoist at ibpc.fr
Fri Oct 15 10:15:08 EDT 2010


I tought there was a more optimized solution than duplicate the data.

Thank you for your help.
Benoist


Le 14 oct. 10 à 13:53, David Doria a écrit :

> On Thu, Oct 14, 2010 at 4:43 AM, Benoist Laurent <benoist at ibpc.fr>  
> wrote:
>> Hi,
>>
>> A question related to the first one.
>> I also have a 3D point cloud and I'd like to pick some of these  
>> points.
>> Basically, I used a vtkKdTreePointLocator but the problem is that the
>> distance between the cursor and the point takes into account the Z
>> coordinates.
>> Therefore, the cursor seems nearest from another point than the one  
>> that was
>> picked.
>>
>> Any suggestion to look for the nearest neighbor taking into acount  
>> the X,Y
>> coordinates?
>> I mean what's the proper way to do so?
>>
>> Thanks,
>> Benoist
>
> I think you'd have to make a new object
>
> vtkPoints* points = vtkPoints::New();
> for (all points)
>  points->InsertNextPoint(x,y,0);
>
> and build the tree from that.
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list