Repository navigation
Add params to filter out poor stereo flow matches - #1667
Merged
matlabbe merged 4 commits intoMar 18, 2026
Merged
Conversation
Member
|
Thanks for this new feature. I was stuck on that PR #1656 the past two weeks, I'll try to take a look at this one this week! |
…old, Vis/CorFlowErrorThreshold. Renamed Stereo/GetMinEigenVals to Stereo/UseMinEigenVals
Member
|
Looks pretty good, thank you for taking the time to open a PR! As suggested, I updated the PR with the same parameters for F2F/optical flow, using error threshold of 20 by default. You can find them under I renamed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using OpenCV's classic Lucas-Kanade optical flow, there are two error measures that can be used to filter out some bad results. A common configuration is to check the minimum eigenvalue of the spatial gradient matrix, which can filter out some features that are not rich enough in texture in advance. This was also a configuration that was previously hardcoded in RTAB-Map. Even if a feature has rich texture, optical flow may still result in an incorrect match. After experiencing some pitfalls, I now prefer to use L1 distance between patches for filtering.
For OpenCV's calcOpticalFlowPyrLK(), ErrorThreshold can generally be set to around 20. For the modified calcOpticalFlowPyrLKStereo(), since the stereo rectification may not be perfect, the error obtained after limiting the optical flow matching direction will generally be larger. Therefore, ErrorThreshold can be set to around 50.
We should probably also expose these params for the optical flow used in VO and visual registration.