Skip to content

Make TV-L1 rescaling flexible and add median filtering#693

Closed
stefan-w wants to merge 1 commit intoopencv:masterfrom
stefan-w:TVL1-updates
Closed

Make TV-L1 rescaling flexible and add median filtering#693
stefan-w wants to merge 1 commit intoopencv:masterfrom
stefan-w:TVL1-updates

Conversation

@stefan-w
Copy link
Copy Markdown

Previously the pyramid was done with a rescaling factor of 2 (implied by the
use of pyrDown). This often leads to inferior results compared to a scale step
of e.g. 0.8 (a factor of 2 is obviously faster). This commit makes the scale
step configurable and uses a resonable default value.

The other change in this commit is that median filtering is added. This is not
described in this paper but it is done in the author's implementation. (See
e.g. "Secrets of optical flow estimation and their principles", Sun et al.,
CVPR 2010) This serves as periodic outlier removal during optimization, leading
to smoother flow fields while preserving motion edges. This includes splitting
the optimization loop into two loops.

Previously the pyramid was done with a rescaling factor of 2 (implied by the
use of pyrDown). This often leads to inferior results compared to a scale step
of e.g. 0.8 (a factor of 2 is obviously faster). This commit makes the scale
step configurable and uses a resonable default value.

The other change in this commit is that median filtering is added. This is not
described in this paper but it is done in the author's implementation. (See
e.g. "Secrets of optical flow estimation and their principles", Sun et al.,
CVPR 2010) This serves as periodic outlier removal during optimization, leading
to smoother flow fields while preserving motion edges. This includes splitting
the optimization loop into two loops.
@ghost ghost assigned vpisarev Mar 23, 2013
@Daniil-Osokin
Copy link
Copy Markdown

@vpisarev Vadim, please, review this request.

@vpisarev
Copy link
Copy Markdown
Contributor

Vlad, can I reassign the pull request to you? You seem to be a better candidate for reviewing it

@vinograd47
Copy link
Copy Markdown
Contributor

👍
But we need to update data for regression test and sanity test.

@stefan-w
Copy link
Copy Markdown
Author

One thing I am not sure about here is that this takes a parameter away from the algorithm and introduces two new ones, which breaks compatibility. But I don't know if there's a nicer way to do it - if backwards compatibility is a high priority one could keep the "iterations" parameter, add a "filteringInterval" parameter that controls the interval of median filtering. But then you'd need to ensure that iterations % filteringInterval == 0 so that median filtering does not happen at or near the end of optimization, so an algorithm that sets iterations only also breaks. The only way to keep compatibility that I can think of would be to do the above and disable filtering by default, however then by default you get not-so-nice results ...

@vinograd47
Copy link
Copy Markdown
Contributor

master branch is not binary compatible with 2.4 version. So I think it's not a problem.

@vinograd47
Copy link
Copy Markdown
Contributor

@stefan-w

Thanks for your update.

I created new pull request with your commit and updated test data. I also updated GPU version.
Now all tests must pass.

@taka-no-me
Copy link
Copy Markdown

Closed coz #724 is in a good shape now.

@taka-no-me taka-no-me closed this Apr 3, 2013
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.

5 participants