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

Add erode and dilate methods to MaskedImage #599

Merged
merged 2 commits into from Jul 3, 2015

Conversation

Projects
None yet
2 participants
@jalabort
Member

jalabort commented Jun 30, 2015

  • erode returns a copy of the MaskedImage for which its mask has been shrunk by a particular number of pixels along its boundary.
  • dilate returns a copy of the MaskedImage for which its mask has been expanded by a particular number of pixels along its boundary
@patricksnape

This comment has been minimized.

Contributor

patricksnape commented Jul 2, 2015

Looks great - could we get a test for each one?

@jalabort

This comment has been minimized.

Member

jalabort commented Jul 2, 2015

Tests added.

However, both erode and dilate use the default structures used by scipy for eroding and dilating and that means that eroding a MaskedImage by 3 pixels and then dilating it by the same amount will not give us the originalmask. Would you guys expect the latter to happen?

@patricksnape

This comment has been minimized.

Contributor

patricksnape commented Jul 3, 2015

No, I think that those methods are lossy and you can't just erode something down and then dilate it back and expect the same result.

@patricksnape

This comment has been minimized.

Contributor

patricksnape commented Jul 3, 2015

+1 from me

patricksnape added a commit that referenced this pull request Jul 3, 2015

Merge pull request #599 from jalabort/erode_dilate
Add erode and dilate methods to MaskedImage

@patricksnape patricksnape merged commit b95475a into menpo:master Jul 3, 2015

3 checks passed

clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment