Jump to content
resonanz

Point Cloud Normals

Recommended Posts

resonanz    0

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!

Share this post


Link to post
Share on other sites
eetu    496

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.

Share this post


Link to post
Share on other sites
symek    266

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

Share this post


Link to post
Share on other sites
ikarus    64

you you want to make sure your mesh is consistent use particle fluid surface instead of iso-offset/pointcloud

Share this post


Link to post
Share on other sites
petz    306

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 2

Share this post


Link to post
Share on other sites
symek    266

thanks petz! I've never thought you can actually compute covariance in VEX... arrays make a difference!

skk.

Share this post


Link to post
Share on other sites
papicrunch    27

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

Share this post


Link to post
Share on other sites
resonanz    0

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

Share this post


Link to post
Share on other sites
petz    306

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

Share this post


Link to post
Share on other sites
resonanz    0

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!

Share this post


Link to post
Share on other sites
petz    306

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×