New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New scalar field: Normals #5
Comments
Hi, how can I use this functionality, to get normal to a point using k neighbors? Thanks |
Hi @jazzyearrings . This issue is still open because I haven't implemented part of the functionality yet. You can right now obtain the normals with the following code (make sure to re-install or git pull because I just merged a pull request #118 with this): from pyntcloud import PyntCloud
cloud = PyntCloud.from_file("test/data/sphere.ply")
k_neighbors = cloud.get_neighbors(k=10)
cloud.add_scalar_field("normals", k_neighbors=k_neighbors) And you should now have 3 new columns in cloud.points (nx, ny, nz) wich represent the x,y,z coordinates of the normal vector associated to each point: cloud.points.tail()
However please note that this normals are unoriented, meaning that some normals might be flipped and pointing to the opposite direction as they should. This is because when you use PCA to fit the plane to the neighbourhood the orientation of the normal of the plane is ambiguous. A post-processing of the normals is what I haven't implemented yet. |
Are they oriented now or still unoriented? (Great job, anyhow!) |
@felix-tracxpoint they are still unoriented 👼 I have a working implementation of oriented normals but it makes use of some libraries that I don't really want to add as dependencies because I'm trying to keep dependencies to the minimum. Hopefully will find some time to work on this soon |
Are you doing something like this? |
I'm doing exactly that
El 8 dic. 2017 18:37, "felix-tracxpoint" <notifications@github.com>
escribió:
… Are you doing something like this
<http://www.cloudcompare.org/doc/wiki/index.php?title=Normals%5COrient_Normals_With_Minimum_Spanning_Tree>
?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMFyZXfPS6Oo-5lbPDpMZQrZW6ud9iUCks5s-YHVgaJpZM4MbuE->
.
|
I just started with pyntcloud, there is really not much out there to fill that niche. Thanks for your great work so far. I just tried to calculate normals according to your description with a cloud of >100'000 points. It produces a MemoryError in sf_kneighbors.py at 100'000 points doesn't seem that crazy to me, thus maybe worth looking into a method that is not as memory greedy. |
@cosama Holly guacamoli thank you so much for pointing that. That code should not be merged at master and that is my fault. The code for orienting the normals is still in progress and I'm still looking for a efficient way of doing the reimanian graph stuff in Python. |
Your welcome. Thanks for the links. I looked at your last commit of sf_kneighbors.py and reverted it. I do not need any orientation, I just want to know if the normals point more up/down or towards the sides in a certain region. It seems to work fine that way. By the way, normals are by definition a vector, not a scalar field (I know I'm a bit picky here :) ). |
Remove normal orientation code that crashes #5 . Normals is now Unonriented normals
Unoriented normals added in #163 . No orientation code included for now and remove the code that caused the crash. Orientation to viewpoint will be added soon. General orientation is not a very high priority for me but contributions are welcome. |
To be added in scalar_fields/k_neighbors.
Use Hugues Hoppe 92 to compute normals based on eigen values.
Use Scipy sparse matrix and graph routines. for build and transverse Riemannian graph.
The text was updated successfully, but these errors were encountered: