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

ch8 optical_flow.cpp 中有关逆向光流法的实现部分是否出错了 #326

Open
qfxlslyz opened this issue Nov 23, 2024 · 0 comments

Comments

@qfxlslyz
Copy link

出错的地方发生在optical_flow.cpp 235行到243行。

倘若某次执行optical_flow.cpp时选择逆向光流法。

那么调用OpticalFlowTracker()函数时,inverse变量将被赋值为true,雅可比矩阵J将由optical_flow.cpp 235行到243行对应的代码进行计算。

此时除了第一次迭代计算的残差b是对的。后续的迭代过程中,由于J不再更新,optical_flow.cpp 246行更新b时用到的J永远是第一次迭代计算时“img1中位于(kp.pt.x + half_patch_size - 1, kp.pt.y + half_patch_size - 1)处的像素点”所对应的J。

而正确的J应当是optical_flow.cpp 226行每次计算error时用到的“img1中位于(kp.pt.x + x, kp.pt.y + y)处的像素点”所对应的J。

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

No branches or pull requests

1 participant