Jump to content

nearest neighbor assignment - harder than just a pclookup


Recommended Posts

So I've often run into the issue in Houdini where I have two sets of points - let's say green and orange -- and I want one set to be assigned to its closest neighbor in the other set. I'd like to start with this (maybe 1k to 10k orange points):

start.jpg

And assign like so:

ideal.jpg

The problem is that I'll often have a couple of green points doing a pclookup into a huge set of orange points. The green end up sharing, naively, the orange points they are nearest to as I cannot write into the point cloud that an orange is already nearer and paired to another green. So basically the fracked up result looks like:

pclookup.jpg

Only #1 should be paired with the orange point in the lower right, but 0 and 2 also returned with the same orange paired to them as they had no knowledge that 1 was closer.

Does anyone have any creative of ways of getting around this problem? There are many algorithms, like goals, where you want to do a fast pclookup and then pair away points in a specific manner.

Thanks for reading!

-shawn

Edited by yourdaftpunk
Link to comment
Share on other sites

Nothing in some cases, but for example I'm playing with implementing this algo: http://algorithmicbotany.org/papers/colonization.egwnp2007.html At the beginning, we start with one or a few green points (the tree nodes) and many attractors which the tree nodes grow towards and consume (the orange). I may start with several thousand orange and one green so doing the lookup from the orange POV seems like it might be to slow (though I haven't tried yet! I may do so tonight).

In my other use case, a flocking sim, I always had less "green" points and many, many orange points (the landing goals), so I kept trying to come up with a green's POV solution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...