mois23 Posted January 20 Share Posted January 20 (edited) Hey everyone I'm stuck on a really simple problem that I can't seem to figure out how to solve. I have a group of points, each of which has a float speed and a direction: f@speed and v@dir. I would like Houdini to identify i@clusters based on the direction orientation and the speed value. Basically I want to iterate the code over all the points: if the angle formed by the dir vectors is less than a certain threshold, the code also checks the speed value. If the speed difference is also less than a certain threshold then those points are part of the same cluster (see attached image). I tried a code, where at each iteration I identify the neighboring points and if they are found then it removes them from the iteration queue to avoid infinite loops. But the clustering does not work, when I change the value of speed threshold and angle threshold I get no change. This only happens if I change search radius. Am I missing something? clusterbyattribute.hip Edited January 20 by mois23 Quote Link to comment Share on other sites More sharing options...
mois23 Posted January 20 Author Share Posted January 20 I reviewed the code and I think I made some mistakes. The second condition, the speed difference check, I put it after the angle difference condition is verified. It works better now. What do you think? clusterbyattribute2_fix.hip 2 Quote Link to comment Share on other sites More sharing options...
Librarian Posted January 20 Share Posted January 20 @mois23 Try this maybe you can get some idea's. https://scikit-learn.org/dev/modules/generated/sklearn.cluster.AgglomerativeClustering.html + files https://github.com/Fe-Elf/FeELib-for-Houdini Quote Link to comment Share on other sites More sharing options...
mois23 Posted January 22 Author Share Posted January 22 Any chance this procedure can be "converted" in OpenCL? Looks quite expensive in VEX Quote Link to comment Share on other sites More sharing options...
hannes603 Posted January 22 Share Posted January 22 7 hours ago, mois23 said: Any chance this procedure can be "converted" in OpenCL? Looks quite expensive in VEX put your wrangle to detail will speed up a bit . no need to run points parallel here Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.