Repository navigation
Add the iterative Lucas-Kanade (iLK) optical flow method - #4161
Conversation
|
Hello @rfezzani! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2020-10-02 08:50:49 UTC |
|
Ha! I didn't realise the question of how to present multiple optical flow algorithms in the API would become so relevant so soon! 😂 Thanks @rfezzani! I also notice that it's nD out of the box, a very nice touch. ;) I don't have time for a deep review right this second but it looks pretty great on first glance! |
…into Add_ilk_optical_flow_method
Both failures are due to |
| # Estimate the flow at double precision | ||
| flow_f64 = optical_flow_ilk(image0, image1, dtype='float64') | ||
|
|
||
| assert flow_f64.dtype == 'float64' |
There was a problem hiding this comment.
First time seeing that way to check dtypes. Seems a bit brittle and doesn't seem to work for cases such as np.float64 == "float64" which will return False. So maybe use np.float64 here (and similar at other places) instead?
There was a problem hiding this comment.
You are right, np.float64 == "float64" returns False, but np.dtype(np.float64) == 'float64' is True. Here I compare data type object...
But I will check if this can be done differently ;-)
There was a problem hiding this comment.
flow.dtype == np.float64 should work?
Co-Authored-By: Lars Grueter <[email protected]>
Co-Authored-By: Lars Grueter <[email protected]>
I actually don't understand why that function returns the wrong dtype 😄. Since the tests pass in the other CI checks... |
|
OK, I finally reproduced the CI failure: It comes from |
|
The CI failure is related to the issue #4189. |
…into Add_ilk_optical_flow_method
…into Add_ilk_optical_flow_method
…into Add_ilk_optical_flow_method
…into Add_ilk_optical_flow_method
…into Add_ilk_optical_flow_method
…into Add_ilk_optical_flow_method
Co-authored-by: Gregory R. Lee <[email protected]>
Co-authored-by: Gregory R. Lee <[email protected]>
|
Thank you very much @grlee77 for your review 😉 |
|
Thank you again @grlee77 for your excellent review, I think I addressed all your requests now 😉. |
emmanuelle
left a comment
There was a problem hiding this comment.
just a few comments as I was reading
Co-authored-by: Emmanuelle Gouillart <[email protected]>
Co-authored-by: Emmanuelle Gouillart <[email protected]>
|
@rfezzani one thing which I've been missing either in docstrings or in the gallery example (maybe both) is when to use which optical flow algorithm. From what I understand, one should use TV-l1 to allow for discontinuities in the flow, but when the flow is smooth one should prefer ilk which is faster. Is this correct? Could you please add a few explanations on how to select an optical flow algorithm? Algorithm selection is maybe as hard as parameter selection for our users :-). |
|
@rfezzani thank you very much for the PR! I have finished reading through the Plyer et al. paper, and the PR is ready to go for me. The only caveat would be to add a few explanations about when to use which algorithm, please tell us if you have the time to add it now or not. But there should not be other comments from me! |
|
Sorry @emmanuelle, I didn't found time yesterday :/ I will try to manage adding notes in the doc today. |
|
Thanks @rfezzani :-). Still in time for the release, don't worry. |
|
@emmanuelle, I modified
Is it enough or should I elaborate more? |
|
Thanks @rfezzani . Let's wait for CI and then I'll merge! |
|
I think CI failure is not related... |
|
Merged :-) ! |
|
🎉 Thank you @emmanuelle ! |
Description
Here is an implementation of the iterative Lucas-Kanade (iLK) method for optical flow estimation [1].
The Lucas-Kanade method is a local approach for the estimation of optical flow (as opposed to global approaches such TV-L1 for example). It is fast, robust and requires basically only one parameter that is the size of the neighborhood considered for the estimation.
[1]: Le Besnerais, G., & Champagnat, F. (2005, September). Dense optical flow by iterative local window registration. In IEEE International Conference on Image Processing 2005 (Vol. 1, pp. I-137). IEEE.
Checklist
./doc/examples(new features only)./benchmarks, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py.doc/release/release_dev.rst.@meeseeksdev backport to v0.14.x