Skip to content
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

EstimateNormals not working for flat patches #880

Closed
mike239x opened this issue Mar 26, 2019 · 3 comments
Closed

EstimateNormals not working for flat patches #880

mike239x opened this issue Mar 26, 2019 · 3 comments

Comments

@mike239x
Copy link

It appears the EstimateNormals function does not work properly for completely flat patches, also somehow depending on the orientation.

To reproduce:

import numpy as np
import open3d

X,Y = np.mgrid[0:1:0.1,0:1:0.1]
X = X.flatten()
Y = Y.flatten()

pts = np.zeros((3, X.size))
pts[0] = X
pts[1] = Y

shape  = open3d.PointCloud()
shape.points = open3d.Vector3dVector(pts.T)
shape.paint_uniform_color([0, 0.651, 0.929]) # blue

open3d.estimate_normals(shape, open3d.KDTreeSearchParamHybrid(radius = 0.5, max_nn = 30))

# show the shape
open3d.draw_geometries([shape])

If you write

pts[1] = X
pts[2] = Y

instead - it works as expected; if you use 0 and 1 or 0 and 2 as indices - it no longer works.

Expected:
Screenshot from 2019-03-26 23-56-53
Got:
Screenshot from 2019-03-26 23-57-29

Environment (please complete the following information):

  • OS: Ubuntu 18.04
  • Python version: 3.6.7
  • Open3D version: 0.5 release (also tested on the commit 6f493ef)
  • Is this remote workstation?: no
  • How did you install Open3D?: pip for the release; build myself the newer version
@mike239x mike239x added the bug label Mar 26, 2019
@qianyizh
Copy link
Collaborator

Good catch. Looks like a numerical issue of this function:
https://github.com/IntelVCL/Open3D/blob/377fc7d6a47ea47681c25a1e07a5383d62a612aa/src/Open3D/Geometry/EstimateNormals.cpp#L40

I will dig into it when I got time.

@mike239x
Copy link
Author

Fun fact: adding minimal noise to the points fixes the problem.

@griegler
Copy link
Contributor

Fixed in #1011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants