Jump to content

Point Cloud Normals


Recommended Posts

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!

Link to comment
Share on other sites

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 by SYmek
Link to comment
Share on other sites

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 by petz
  • Like 5
Link to comment
Share on other sites

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 by papicrunch
Link to comment
Share on other sites

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 by resonanz
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 7 years later...

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.

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...