Skip to content

Add an optional image mask for feature detections - #206

Open
helenol wants to merge 4 commits into
masterfrom
feature/image_mask
Open

Add an optional image mask for feature detections#206
helenol wants to merge 4 commits into
masterfrom
feature/image_mask

Conversation

@helenol

@helenol helenol commented Feb 20, 2019

Copy link
Copy Markdown
Contributor

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

mhkabir commented Feb 20, 2019

Copy link
Copy Markdown

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

helenol commented Feb 20, 2019

Copy link
Copy Markdown
Contributor Author

@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

mhkabir commented Feb 20, 2019

Copy link
Copy Markdown

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

helenol commented Feb 21, 2019

Copy link
Copy Markdown
Contributor Author

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

@mfehr

mfehr commented Mar 21, 2019

Copy link
Copy Markdown

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