Re: How to find closest point(s) around a specific point in point cloud?
- From: alex <alex@xxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 16:25:28 -0400
Ed Prochak wrote:
On Mar 31, 8:22 am, alex <a...@xxxxxxxxxxx> wrote:Robert Karlsson wrote:I can't find any site with information about the simplest way toIn general, if you have an array and do not know about distribution
locate the n number of closest points adjacent to a point in a 3d
point cloud with scattered data.
Basically, I've got an array, call it V, with a couple of hundred
positions [x,y,z] and a value (eg [0-100).
Let's say I wanted to pick the 5 closest points around a specific
point, call it P, with a value like [x,y,z] = [10,20,30]
of points, you cannot do better than linear time: even if you look
for one closest point to P you have to look at all points at least
once or the one you miss just might be the closest. If you need
k closest, just keep k closest points found so far as you scan
through the array.
If you need to do this multiple times for different P's there are
algorithms to significantly speed things up by preprocessing the
arrays. Search geometric computational algorithms for details.
I am curious, why/if you care about performance for ~200 point data
sets (unless this is a homework problem).
Wait. Why suggest a linear search of the entire array?
what's wrong with this pseudocode algorithm?
Given point (P,Q,R)
number of points found = 0
current distance = 0
while number of points found < 10
{
searcharray=find all points in shell between current distance and
current distance + 1
for each in searcharray
if conditition met,
then
add to result array
increment number of points found
exit for loop if number of points found >= 10
endif
}
I do not understand the "find all points between D and D+1" part.
I am just saying that to find even one closest point you have to
examine *all* points of V, unless V is organized in some special
way, which was not indicated by the OP.
--
Alex
.
- References:
- Prev by Date: Re: How to find closest point(s) around a specific point in point cloud?
- Next by Date: Re: How to find closest point(s) around a specific point in point cloud?
- Previous by thread: Re: How to find closest point(s) around a specific point in point cloud?
- Next by thread: Re: How to find closest point(s) around a specific point in point cloud?
- Index(es):
Relevant Pages
|