resonanz Posted July 19, 2011 Share Posted July 19, 2011 Hi! I have a problem that is really stumping me. I have a large point cloud that comes from a 3D-scanner and I want to copy small boxes onto the points. But for this I need point-normals and i can´t figure out how to calculate the normals without primitives. If someone have an idea I would be deeply grateful. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
eetu Posted July 19, 2011 Share Posted July 19, 2011 Try converting the point cloud into a volume (with large enough contribution from each particle), and then taking a volume gradient sample from the volume. Quote Link to comment Share on other sites More sharing options...
ehsan parizi Posted July 19, 2011 Share Posted July 19, 2011 I guess you've already tried this, but doesn't the point sop work in this case? add normal should do it, right? Quote Link to comment Share on other sites More sharing options...
symek Posted July 19, 2011 Share Posted July 19, 2011 (edited) I guess you've already tried this, but doesn't the point sop work in this case? add normal should do it, right? The question I guess is not to add normals (you can always do that), but how this normals should look like. Volume Gradient will compute local density change at the point cloud border, so normals could point "outside" the point cloud. edit: wouldn't be natural to just skin them, and transfer normals from skinned version back? Volume from a thin layer of point cloud might goes wrong... Edited July 19, 2011 by SYmek Quote Link to comment Share on other sites More sharing options...
ikarus Posted July 19, 2011 Share Posted July 19, 2011 you you want to make sure your mesh is consistent use particle fluid surface instead of iso-offset/pointcloud Quote Link to comment Share on other sites More sharing options...
papicrunch Posted July 20, 2011 Share Posted July 20, 2011 hi, Base of what Icarus said, here a hip file with a point cloud (from brekel kinect) where I transfer normal from a particle fluid object node to the points. have fun Thomas NormalTransfert_v1.rar Quote Link to comment Share on other sites More sharing options...
petz Posted July 20, 2011 Share Posted July 20, 2011 (edited) you could do this by estimating tangent planes to your pointset. just calculate a covariance matrix and search for the eigenvectors with the lowest eigenvalue. its fast and robust. the only drawback is that there is no way to define if the normals are pointing inside or outside for a general set of points. you could dot product the normals to the vector(camera - P) or use the centroid of your pointcloud to find the wrong oriented normals but this doesn´t work for all cases. and if it does not you´ll have to check normals of neighbouring points and reorient them. hth. petz EDIT: increase max_points to something around 100 in the example file! normals1.hip Edited July 20, 2011 by petz 5 Quote Link to comment Share on other sites More sharing options...
symek Posted July 20, 2011 Share Posted July 20, 2011 thanks petz! I've never thought you can actually compute covariance in VEX... arrays make a difference! skk. Quote Link to comment Share on other sites More sharing options...
papicrunch Posted July 20, 2011 Share Posted July 20, 2011 wow petz, far away to my mathematical skill !! thk it opens my mind ! Thomas Quote Link to comment Share on other sites More sharing options...
anim Posted July 21, 2011 Share Posted July 21, 2011 very nice example petz I've just added visualization node for normals, to see the effect normals1_vis.hip 1 Quote Link to comment Share on other sites More sharing options...
papicrunch Posted July 21, 2011 Share Posted July 21, 2011 (edited) hey it's me, what handsome guy, even though a little spotty when we compare the lighting visualization with your scene Anim, between "transfert normal from particle fluid" and the "covariance matrix", the covariance's method gives much better results ! have fun, Thomas Edited July 21, 2011 by papicrunch Quote Link to comment Share on other sites More sharing options...
resonanz Posted July 21, 2011 Author Share Posted July 21, 2011 (edited) WOW! Thank´s to everyone who has responded. This thread is the answer to all my questions I was going to ask. Thank´s to Papicrunch for the file. I was on the way to do it like you did but could not get it to work. And thank you Anim for the idea to preview the points as particles. And a big THANK´S to you Petz! You provided me again a solution that does exactly what I was looking for and again I don´t understand not a bit of it. The best thing is that your example solves two problems for me. First off, it gives me the normals. And second: all these small steps and irregularities in my pointcloud are smoothed out if I use the "project_point" toggle. Thank you very much! Edited July 21, 2011 by resonanz Quote Link to comment Share on other sites More sharing options...
petz Posted July 21, 2011 Share Posted July 21, 2011 WOW! Thank´s to everyone who has responded. This thread is the answer to all my questions I was going to ask. Thank´s to Papicrunch for the file. I was on the way to do it like you did but could not get it to work. And thank you Anim for the idea to preview the points as particles. And a big THANK´S to you Petz! You provided me again a solution that does exactly what I was looking for and again I don´t understand not a bit of it. The best thing is that your example solves two problems for me. First off, it gives me the normals. And second: all these small steps and irregularities in my pointcloud are smoothed out if I use the "project_point" toggle. Thank you very much! you´re welcome! petz Quote Link to comment Share on other sites More sharing options...
ikarus Posted July 21, 2011 Share Posted July 21, 2011 thats some wizardry math right there, pure wizardry Quote Link to comment Share on other sites More sharing options...
pclaes Posted October 25, 2012 Share Posted October 25, 2012 I had a need for this recently and fixed some tiny vex issues in Petz file so it works with H12 in case anyone wants it. normals2.hip 3 Quote Link to comment Share on other sites More sharing options...
resonanz Posted February 3, 2014 Author Share Posted February 3, 2014 Sorry for raking up this old topic but I am again in a situation where I need to calculate point normals for a huge 3D-scan dataset. This time it is very important to have the normals ALL pointing outward, what is not possible to achieve with this method (AFAIK). What would be the best way to get normals with consistent orientation?Thank´s in advance! Quote Link to comment Share on other sites More sharing options...
petz Posted February 5, 2014 Share Posted February 5, 2014 well, it depends on the data. assuming you have a rather smooth pointcloud you could recursively check normals of neighbouring points and reorient them if necessary. it´s easy to implement and quite fast (hdk) but not always usable for more complex datasets. another option would be to mesh the pointset using a surface reconstruction algorithm (most probably power crust) this would be alot more work to implement, though...however, since you need to code it in the hdk anyway you might want to take a look at pcl (point cloud library). it does everything you need, and if i remember correctly, it is available even precompiled on their website. petz Quote Link to comment Share on other sites More sharing options...
quat Posted February 17, 2021 Share Posted February 17, 2021 Hi all, just want to point anyone looking to solve this problem to this blog post by Jake Rice: https://jakerice.design/2018/09/19/Covariance-and-Principal-Component-Analysis/, which uses the covariance approach and some other fancy stuff to compute accurate (or close to accurate... how do we determine accuracy again?) normals. 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.