Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Points in Lidar Point Cloud appear to be dublicated #72

Closed
plpalmer opened this issue Sep 29, 2023 · 1 comment
Closed

Points in Lidar Point Cloud appear to be dublicated #72

plpalmer opened this issue Sep 29, 2023 · 1 comment

Comments

@plpalmer
Copy link

Hello,

i have noticed that Points in the Lidar Point Cloud seem to be dublicated.
There always are tow points at exactly the same position.

This an be checked by

x_nn = sklearn.neighbors.NearestNeighbors(n_neighbors=2, leaf_size=1, algorithm='kd_tree', metric='l2').fit(lidar_pc)
min_y_to_x = x_nn.kneighbors(lidar_pc)[0]
sumofdistances = min_y_to_x.sum()

the sumofdistances is always zero. Which means that for every point there are two points at the same position.

@andraspalffy
Copy link
Member

Hello,

I checked and it seems like you are right. I will have to see where the error is coming from. Luckily, it does not influence anything. To get rid of the duplicates, just run:

tolerance = 1e-6
point_cloud = np.unique(np.round(point_cloud / tolerance) * tolerance, axis=0)

Thank you for bringing this to my attention!

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

No branches or pull requests

2 participants