Open bidbest opened 3 years ago
Also thanks for the great work :) Please let me know if I missed something, or if you need more context!
I'm dealing with the same issue. Are there any workarounds for this? I'm creating a pointcloud from a depth image using the project_valid_depth_only = False parameter in PointCloud.create_from_depth_image. I do this because I want to be able to recreate the original size image with the agreements of the normals to a vector. I can only get correct normals when project_valid_depth_only = True but then I can recreate the original image size.
I found a workaround to get the correct normals for pcd, a bit tedious though:
pcd = o3d.geometry.PointCloud.create_from_depth_image(
o3d.geometry.Image(depth_image),
self.intrinsic,
self.T_cw,
self.depth_scale,
project_valid_depth_only = False)
points = np.asarray(pcd.points).T
indices_not_nans = np.nonzero(np.all(np.isnan(points) == False, axis=0))[0]
pcdn = pcd.select_by_index(indices_not_nans)
pcdn.estimate_normals()
normals_pcdn = np.asarray(pcdn.normals).T
pcd.estimate_normals()
normals_pcd = np.asarray(pcd.normals).T
normals_pcd[:,indices_not_nans] = normals_pcdn
pcd.normals = o3d.utility.Vector3dVector(normals_pcd.T)
Describe the bug Estimating Normals of a Pointcloud with Nans, results in wrong Normals (and no worning). Function: _Pointcloud.estimatenormals()
To Reproduce To reproduce the error, please download the attached pointcloud. Extract the .zip file and load the pointcloud with numpy. To reproduce:
Expected behavior Quick: return a warning, mentioning estimate normals doesn't support Pointclouds with Nans. Ideal: Ignore Nans in the computation, compute normals for valid points, and assign Nans for Nan points
Screenshots
Environment (please complete the following information):
Additional context Please use this Pointcloud to reproduce the error ordered_pointcloud.zip