Closed tsandy closed 9 years ago
@tsandy Thank you for the detailed report. Yes this is a known behavior of the library in that the indices are not reset for points exceeding the distance threshold. You will need to evaluate the distance in order to see if a point is valid.
We have taken the decision to not have a dedicated index for invalid points: See https://github.com/ethz-asl/libnabo/issues/2 for a discussion.
The documentation (nabo.h:318 for instance) states that the indices will be filled with zero, and therefore is wrong, so we should update it.
@stephanemagnenat please take a look at #24
Points:
-0.999984 -0.0826997 -0.905911 0.869386 0.661931 0.0594004 -0.233169 0.373545 0.692334 0.307838
-0.736924 0.0655345 0.357729 -0.232996 -0.930856 0.342299 -0.866316 0.177953 0.0538576 -0.168001
0.511211 -0.562082 0.358593 0.0388327 -0.893077 -0.984604 -0.165028 0.860873 -0.81607 0.402381
Indices:
0 5 0 9 8 1 0 9 5 7
0 8 0 8 0 8 0 0 1 3
0 0 0 0 0 0 0 0 3 0
0 0 0 0 0 0 0 0 4 0
0 0 0 0 0 0 0 0 0 0
Dists:
inf 0.275316 inf 0.451728 0.976515 0.275316 inf 0.334217 0.512207 0.334217
inf 0.665324 inf 0.844491 inf 0.512207 inf inf 0.665324 0.451728
inf inf inf inf inf inf inf inf 0.844491 inf
inf inf inf inf inf inf inf inf 0.976515 inf
inf inf inf inf inf inf inf inf inf inf
Looks good to me
Thanks for the quick replies!
Hello, There seems to be a small bug in knn for matrix-type queries. Non-zero indices are reported even when dists2 returns 'inf'. See the code snippet and output below. Best, Tim
Code--------------------------------------------------
Output----------------------------------------