-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: optimization "createPlaneSegments" algorithm stage #45
Conversation
@@ -73,6 +74,7 @@ class PlaneExtractor::Impl { | |||
int32_t image_height_; | |||
int32_t image_width_; | |||
Eigen::MatrixXi labels_map_; | |||
std::vector<std::vector<Eigen::Index>> neighbours; |
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.
- Why do we need precomputed
neighbours
- Why is it a field of
PlaneExtractor
? It doesn't make sense for me.
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.
To get rid of numerous calls to the getNeighbours function, in which we look at neighboring cells every time and initialize a vector with them, when processing each image
unassigned_mask[i] = false; | ||
--remaining_planar_cells; | ||
} | ||
for (auto& v : cells_to_merge) { |
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.
Using reference for primitive type (e.g. int) is more expensive than using its copy. It's better to remove &
} | ||
++stacked_cell_id; | ||
} | ||
for (auto& v : cells_to_merge) { |
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.
Same. Remove &
cpp/deplex/src/deplex/cell_grid.cpp
Outdated
@@ -15,6 +15,7 @@ | |||
*/ | |||
#include "cell_grid.h" | |||
|
|||
#include <iostream> |
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.
Remove iostream
No description provided.