Skip to content
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

DM-1128 #6

Merged
merged 3 commits into from Nov 21, 2014
Merged

DM-1128 #6

merged 3 commits into from Nov 21, 2014

Conversation

TallJimbo
Copy link
Member

New PR for code review of DM-1128, span-based grow operations for Footprint

if (r*r + c*c <= ngrow*ngrow) {
*row = 8;
}
PTR(Footprint) growFootprintRLE(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"growFootprintRLE" isn't actually a valid name according to our standards - we require acronyms to be camelcased as well, so it'd have to be "growFootprintRle". That's horrible, admittedly, and an example of why I'm not fond of that particular rule. Given that this is now the only implementation for growing Footprints, maybe just rename it to growFootprintImpl?

@TallJimbo
Copy link
Member Author

There are a few code comments above, nothing too serious. Beyond this, I'm a bit surprised that Footprint::normalize() was able to do so much of the work for you with no modification...I take it you verified that this was the case?

This gives a roughly order of magnitude performance improvement over the
convolution with a circle used previously.
enum class Shape { CIRCLE, DIAMOND };
typedef std::vector<Span>::const_iterator const_iterator;
StructuringElement(Shape shape, int radius);
StructuringElement(int left, int right, int up, int down);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constructor either needs a fair bit of documentation what it does and what it could be used for, or it should just be removed until we come up with a use case for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see that we actually did have a public method for doing this already. I wonder what it was used for. In any case, I suppose it's the job of that method to document what it does, though a pointer from this code to that documentation would be welcome.

This replaces the previous definition, based on std::map, and makes it
possible to have asymmetric structuring elements. We can therefore use the
RLE-based technique to grow in any (or all) of the up/down/left/right
directions.
@mjuric mjuric merged commit dddc9b3 into master Nov 21, 2014
@ktlim ktlim deleted the tickets/DM-1128 branch August 25, 2018 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants