Speeding up optical flow (createOptFlow_DualTVL1)

六月ゝ 毕业季﹏ 提交于 2019-11-28 09:27:21

In order to speed up the computation, you need to reduce the total count of computations performed each time. This seems obvious, but the huge number of strategies to achieve that goal can be confusing. So, here are some proposals:

  1. Reduce the size of your images (input data). In particular, you should try to divide their size by 2 along each dimension, compute the flow, then compute a full size flow with linear interpolation. Unless your application requires a very high accuracy, this solution should be acceptable and will give you a huge speedup.

  2. Reduce the number of warps (parameter: warps) per scale. This will harm a little the accuracy, but unless you have very difficult motion patterns (e.g., when all the image pixels are moving in different directions, or when you have a very fast motion inside the image) the result should still be acceptable. The algorithms runs the minimization procedure warps times per level in the image pyramid, so even a small change in warps will give you a noticeable speedup.

  3. Reduce the number of levels in the image pyramid (parameter: scales). This can have an important impact on the accuracy though, so be careful and experiment a lot with it. It has been found in the literature that a good (for accuracy) scale factor between levels is 0.8, so you should compute your number of levels accordingly. Before 0.8, the standard in experimenting with optical flow was a scale factor of 0.5, so you can try to go down until this value.

  4. Convergence speed: the inner procedure for L1 minimization is stable for time steps (parameter: tau) up to 1/8 (0.125) in theory, but in practice values of 1/4 (0.25) are known to still work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!