织梦CMS - 轻松建站从此开始!

360BC游戏

当前位置: 主页 > 游戏攻略

How to compute Lucas Kanade flow?

时间:2025-09-17 17:35来源:本站 作者:admin666 点击:
I am currently working on a project of object tracking and have used C++ and OpenCV. I have successfully used Farneback dense optical flow to implement segmentation methods such as k means (using the displacement in each frame). Now I want

I am currently working on a project of object tracking and have used C++ and OpenCV. I have successfully used Farneback dense optical flow to implement segmentation methods such as k means (using the displacement in each frame). Now I want to do the same thing with Lucas Kanade sparse method. But the output of this function is:

nextPts – output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image; when OPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input.

(as stated by the official site)

My question is How I am going to get the result to a Mat flow? for example I have so far tried:


This is the optical flow presentation. Any ideas on how I should get a Mat flow similar to the result of the Farneback optical flow?

(http://docs.opencv.org/2.4/modules/video/doc/motion_analysis_and_object_tracking.html#calcopticalflowfarneback )

UPDATE: Very good answer. But now I have problems with showing the kmeans image. With farneback I used:


Any ideas?

(责任编辑:蚂蚁团队)
织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
推荐内容