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

Add an optional image mask for feature detections #206

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

helenol
Copy link
Collaborator

@helenol helenol commented Feb 20, 2019

In case you forget to mount your camera so that it doesn't look at your propellers or your frame. ;)
Simply prunes new feature detections before selecting best features to track based on whether their coordinates fall into the mask or not.

Before:
image

After:
image

Mask applied: (black = filter, white = don't filter)
gonzen_mask_big

Controlled by an optional ros param called "image_mask_path". If set to a path (here a png image), will automatically filter. Otherwise won't do anything.

@helenol helenol requested a review from bloesch February 20, 2019 15:02
@mhkabir
Copy link

mhkabir commented Feb 20, 2019

This should also be passed through to the FAST extractor call so that it doesn't detect points on masked regions in the first place.

@helenol
Copy link
Collaborator Author

helenol commented Feb 20, 2019

@mhkabir this is pruning the output of the fast feature detector to discard all features that are in the masked regions. Masking the image before putting it through the feature detector would result in features on the mask boundaries, which we don't want.

@mhkabir
Copy link

mhkabir commented Feb 20, 2019

I wasn't suggesting masking the image manually before passing it. What I meant was, you should pass the mask Mat through to the FAST detector call (https://github.com/ethz-asl/rovio/blob/master/include/rovio/ImagePyramid.hpp#L142). There is already an API:
image

This does not cause detections on the edges.

@helenol
Copy link
Collaborator Author

helenol commented Feb 21, 2019

@mhkabir Ah cool thanks a lot! Ok will see if it's faster to just switch to that.

@mfehr
Copy link

mfehr commented Mar 21, 2019

We added masking to the maplab_rovio version, based on this PR. However we refactored and extended it a bit, when we discovered some issues with this masking, as tracked features were still entering masked areas and then stayed for several frames (+ we added the keypoint masking suggested by @mhkabir ). Any feedback would be welcome :)

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.

3 participants