-
Notifications
You must be signed in to change notification settings - Fork 24
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
[ransac] Refactor ransac_ground.h #14
base: master
Are you sure you want to change the base?
Conversation
- Refactor find_inlier_indices function: - Replace std::function with template argument for better inlining - Rewrite algo - replace translations with signed distances calculation - Refactor remove_ground_ransac function: - Calculate number of ransac iterations for given error probability and expected plane point share - Improve complexity: O(N * logN) -> O(N) - Replace unnecessary shared pointers - A few other improvements
- Refactor remove_ground_ransac function: - Add check for sample plane normal vector validity - Add check for resulting best pair validity
- Refactor remove_ground_ransac and find_inlier_indices functions: - Use std::vector instead of std::shared_ptr whenever it is possible without API change - Refactor find_inlier_indices in a std::algo manner - use input iterators
- Add SFINAE input iterator check in find_inlier_indices function header
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.
Even though the task asked for a complete re-implementation, this code refactoring is okay since the amound and depth of changes is significant. Accepted.
// To reduce the number of outliers (non-ground points) we can roughly crop | ||
// the point cloud by Z coordinate in the range (-rough_filter_thr, rough_filter_thr). | ||
// Simultaneously we perform decimation of the remaining points since the full | ||
// point cloud is excessive for RANSAC. | ||
std::mt19937::result_type decimation_seed = 41; | ||
std::mt19937 rng_decimation(decimation_seed); | ||
std::mt19937 rng_decimation(std::random_device {}()); |
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.
"std::random_device is a uniformly-distributed integer random number generator that produces non-deterministic random numbers."
This is not good for reproducability. No benefit over the pseudo RNG.
|
||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ||
}; | ||
|
||
// Helper alias for input iterator SFINAE check |
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.
Looks like a random over-engineering. Why do we need this?
Refactor find_inlier_indices function:
Refactor remove_ground_ransac function:
A few other improvements