问题描述
可以使用Lucas Kanade方法将OpenCV用于计算密集的光流吗?我知道gpu/ocl模块中的功能可以做到这一点(gpu :: PyrLKOpticalFlow :: dense),但是该功能是否具有非gpu等效功能?
Can OpenCV be used to calculate dense optical flow using Lucas Kanade method? I am aware of function in gpu/ocl module that can do that (gpu::PyrLKOpticalFlow::dense), but is there non-gpu equivalent of that function?
我也知道Farneback和TV L1,但是我需要LK/金字塔LK进行研究.
I'm also aware of Farneback and TV L1, but I need LK / pyramidal LK for my research.
推荐答案
否.实际上,没有良好的密集光流提取方法.我面临着同样的问题(光流中的粒子对流,对吗?)
No. Actually there is no good dense optical flow extraction method. I'm facing the same problem (particle advection on optical flow, right?)
有一个函数可以使用Farneback方法[ 1 ],但结果却很糟糕.它既不使用ocl也不使用gpu.
There is a function that evaluates optical flow with Farneback method [1], but it gives me bad results. It does not use ocl nor gpu.
您可以尝试使用phaseCorrelate
通过基于移位的算法将其提取.我用过这种方法.当我将其上传到github时,我会给你链接.
You may try with phaseCorrelate
to extract it with a shift based algorithm. I've used this method. When I will upload it to github I'll give you the link.
以下是代码.我决定将相位相关算法与整个项目分开,以使其更易于理解: https://github.com/MatteoRagni/OpticalFlow 如果您打算使用它,请加注星标.
Here is the code. I've decided to separate the phase correlation algorithm from the whole project, to make it more simple to understand:https://github.com/MatteoRagni/OpticalFlowPlease star it, if you intend to use it.
这篇关于卢卡斯·卡纳德(Lucas Kanade)密集的光流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!