-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[filters] Refatoring VoxelGridCovariance to make it multi-thread safe (and more) #4251
[filters] Refatoring VoxelGridCovariance to make it multi-thread safe (and more) #4251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions:
- Should the added function require
Eigen<int, 4, Dynamic>
instead since that's the sole use in the function? - What happens if the neighborhood of a point contains the point itself? Does the accuracy increase in a similar fashion as in case of adjacent voxels?
- Do we need a better naming than
nighborhood
andadjacentvoxels
? I can see someone getting confused between the 2
I prefer
Possibly yes. I tried to use 27 neighbors once, and it was better than 26 neighbors (in both accuracy and processing speed). But, it was much slower than 7 neighbors, and the accuracy gain was not significant. If you like, we can add a function to retrieve 27 neighbors as well.
Should we rename them like |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you like, we can add a function to retrieve 27 neighbors as well
That'd be nice since it's better than 26 neighbors.
because we don't need to worry about what values should be placed at the fourth column
Makes sense. Please ignore that.
LGTM, can be merged once a good enough name and the next bit are done.
I added a method to get 3x3x3 neighbors and changed the method names (7neighbors: I considered to change the name of 26neighbors method to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it allowed to change a public method name?
Yes, via deprecation, but let's put that for another patch. This one doesn't have any issues from being included in 1.11.1, but addition of deprecation would force it to 1.12.0
Any changes (rebasing of commits) or we can go ahead and merge (squash and merge)? |
I was gonna squash merge. 😬 |
You didn't so I thought you were waiting on something. Merging now. |
This PR updates VoxelGridCovariance so that it can be used in multi-threaded NDT #4135
Although the second modification slightly changes the behavior of the methods in case a voxel found by
kdtree_
doesn't exist inleaves_
, this condition never happens becausekdtree_
is built from voxel coordinates inleaves_
.Regarding #4180 (comment):
I empirically found that using adjacent + center voxels (7 voxels) is the best for accuracy. I updated the doc comment of getAdjacentVoxelsAtPoint to clarify that it retrieves 7 voxels.