Jump to content
  • Advertisement
Sign in to follow this  
coltdaniel

Understanding procedure to create normals from a cloud point.

This topic is 1050 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am doing some experiment with point cloud visualization, and found a procedure to generate normals from these
point clouds. The idea is to use the points to generate the normal. The problem is that I may be misunderstanding what should be done. For instance, if I have two points with coordinates (0,0,5) and (0,0,10), so I expected the normal to be (0,0,1), in that way the point can be "reached" by taking the normal and multiplying it by a constant, but what I am getting it is a (1,0,0) or a (0,1,0) normal that can never "reach" neither of these points, so that's why I think I am doing something wrong.
I attached an screenshot of the procedure, and here I will simulate my calculations done with these two points, so hopefully someone will be able to see a mistake.

 

Here is the screenshot:

 

[attachment=29452:Screenshot.png]
Here is the simulation: H = [ || (0,0,5) - (0,0,5) || / 2 ] + [ || (0,0,10) - (0,0,5)|| / 2 ]
H = 0 + 2.5 = 2.5
Wp (0,0,5) = e ^ [ (|| (0,0,5) - (0,0,5) ||) / 2.5² ] = e^0 = 1
Wp (0,0,10) = e ^ [ (|| (0,0,10) - (0,0,5) ||) / 2.5² ] = e^(5/6.25) = e^0.8 =~ 2.22
Mp = (Wp (0,0,5) * (0,0,5) + Wp (0,0,10) * (0,0,10)) / Wp (0,0,5) + Wp (0,0,10)
= [1 * (0,0,5) + 3.22 * (0,0,10)] / 1 + 2,22 = (0,0,37.2) / 3.22 = (0,0,11.55)

C = | (0,0,5) - (0,0,11.55) | = (0,0,-6.55) Inverse C = | (0,0) |
| (0,0,10) - (0,0,11.55) | = (0,0,-1.55) | (0,0) |
| (-6.55,-1.55) |

Inverse C * C = |0 0 0 | eigenvalues = 0, 0, 45.307
|0 0 0 |
|0 0 45.3| eigenvectors = (1,0,0) (0,1,0) (0,0,1)

normal = (1,0,0) or (0,1,0)

 

Anyone saw anything wrong ?

Edited by coltdaniel

Share this post


Link to post
Share on other sites
Advertisement

Pardon my laziness, I only read the first few sentences. How can 2 points have a normal? 2 points dictate a line. What would be the normal of a line?  If you want another vector that is 90 degrees perpendicular to this line, that can be achieved, but realized you can spin that vector 360 degrees about the line, and still hold 90 degrees perpendicular. Meaning there are infinite perpendicular vectors to your line.

 

Not sure what your actually using this for, but if this is for actual 3D mesh generation, throw the math book out and just grab local points to build triangles and then build normals off of those.

 

To your original question, sorry I have no idea.

Edited by dpadam450

Share this post


Link to post
Share on other sites

Pardon my laziness, I only read the first few sentences. How can 2 points have a normal? 2 points dictate a line. What would be the normal of a line?  If you want another vector that is 90 degrees perpendicular to this line, that can be achieved, but realized you can spin that vector 360 degrees about the line, and still hold 90 degrees perpendicular. Meaning there are infinite perpendicular vectors to your line.

 

Not sure what your actually using this for, but if this is for actual 3D mesh generation, throw the math book out and just grab local points to build triangles and then build normals off of those.

 

To your original question, sorry I have no idea.

This two points was an example that I choose to show that the result seemed strange to me. It has no practical use, nothing to do with a line, if I showed the real case with 243 points it would be harder to follow the problem. All I want to know is if I am understanding correctly what the procedure says. The idea is that if someone can read the procedure in the screenshot, it can make a quick check in my calculations and see if I did something wrong. In a conceptual way, like dividing by a number in each step of a summatory, instead only in the end, not in a arithmetic way.

 

For every point the in the set, it should create an approach of a normal. So it should be possible to "reach" the point by picking it and multiplying it by a constant. An example it is a point (6,8,0) that with an unitary normal of coordinates (0.6,0.8,0) would need a constant value of ten. But I am getting really weird values that can't be approximation errors, like a point with coordinates (-x,y,-z) and a normal for this point that it is (x,-y,-z), so that if I multiply it by a constant t or -t it can never reach the point

I think it's fairly easy. It isn't for mesh generation, it's for generation normals for planes.

Share this post


Link to post
Share on other sites

This two points was an example that I choose to show that the result seemed strange to me. It has no practical use, nothing to do with a line, if I showed the real case with 243 points it would be harder to follow the problem. All I want to know is if I am understanding correctly what the procedure says. The idea is that if someone can read the procedure in the screenshot, it can make a quick check in my calculations and see if I did something wrong. In a conceptual way, like dividing by a number in each step of a summatory, instead only in the end, not in a arithmetic way.


dpadam450's point still stands, though. While it would be difficult to follow the math with 243 points, it's pointless to even try with just 2 points. You need a minimum of 3 points to define a plane before you could find its normal.
 

For every point the in the set, it should create an approach of a normal. So it should be possible to "reach" the point by picking it and multiplying it by a constant. An example it is a point (6,8,0) that with an unitary normal of coordinates (0.6,0.8,0) would need a constant value of ten. But I am getting really weird values that can't be approximation errors, like a point with coordinates (-x,y,-z) and a normal for this point that it is
I think it's fairly easy. It isn't for mesh generation, it's for generation normals for planes.


That's not what a normal is. What you're describing sounds like a simple unit vector in the direction of a given point. In fact, *any* vector in the proper direction would fit your requirements since you could always scale it by some value to arrive at the original point. You don't need a fancy algorithm to calculate that so I'm assuming that's not what you're really looking for.

A normal on the other hand is a vector (usually a unit vector) that is perpendicular to some surface at a given point. In general, it is NOT possible to multiply the normal by some value and arrive at the original point. That would only hold true in the special case of a perfect sphere, or for some points on the surface but not others.

 

Frankly the math you posted is beyond my abilities, but based on the description it looks like you're trying to find the normal to a surface that is defined by a number of unconnected points, correct? In that case, why not setup some simple test cases where you know the correct answer and try your algorithm? For example, if all the points in your point cloud are in the X-Y plane then the normal MUST be <0, 0, 1> (or <0, 0, -1>). Or you could try a huge number of points that are all exactly 1 unit away from the origin (a perfect sphere). In that case the normal at each point would be the point itself.

Share this post


Link to post
Share on other sites

 

if I have two points with coordinates (0,0,5) and (0,0,10), so I expected the normal to be (0,0,1)

 

This two points was an example that I choose to show that the result seemed strange to me. It has no practical use, nothing to do with a line,

Well your original post you have 2 inputs and you come to the conclusion of 1 output being a normal. This is impossible.

 

 

An example it is a point (6,8,0) that with an unitary normal of coordinates (0.6,0.8,0) would need a constant value of ten

This has nothing to do with a surface normal You can't normalize a point........ you can normalize a vector. And you can create a point by taking a vector times a constant sure. But honestly, I don't think you know what you are trying to do or what is going on.  If you have a point cloud that represents points relative to each other, and you want to calculate a surface normal, then you need a surface. You need to create a triangle from surrounding points.

Share this post


Link to post
Share on other sites

I think you're confusing the idea of "normalising" a vector (which is an operation you can perform on a vector) and the "normal vector", which is a property of surfaces.

 

The first involves multiplying a vector by a calculated constant (1/vector length) to change its length to be 1, but not change its direction. This is also known as a unit vector.

 

Normal vectors point out of a surface such that the angle it makes with the surface is 90 degrees. There are actually two per surface and which one you get depends on the order in which you consider the vertices that define the plane when performing the normal calculation.

Share this post


Link to post
Share on other sites


If you have a point cloud that represents points relative to each other, and you want to calculate a surface normal, then you need a surface. You need to create a triangle from surrounding points.

 

Maybe not. The algorithm the OP posted appears to be a way to estimate the normal of a surface by sampling the nearby points without building triangles first.

Share this post


Link to post
Share on other sites

In that case, why not setup some simple test cases where you know the correct answer and try your algorithm? For example, if all the points in your point cloud are in the X-Y plane then the normal MUST be <0, 0, 1> (or <0, 0, -1>). Or you could try a huge number of points that are all exactly 1 unit away from the origin (a perfect sphere). In that case the normal at each point would be the point itself.

 

Thanks for the suggestion. The XY plane stuff worked as expected (normals always equal to (0,0,1)). But the unity sphere stuff show that there are problems. I took every point and divided by it's length relative to the origin to put them at a distance of 1 to the origin. The normals generated for these points are never equal to the points themselves, so something is wrong.

 

What I am talking about is related to what they are talking here: http://www.pointclouds.org/documentation/tutorials/normal_estimation.php

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!