opencv(CalcOpticalFlowPyrLK)中的光流类别参数 [英] Optical Flow class in opencv(CalcOpticalFlowPyrLK) Parameters

查看:3059
本文介绍了opencv(CalcOpticalFlowPyrLK)中的光流类别参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于CalcOpticalFlowPyrLK()类中两个参数的问题。这是文档的链接:

I have a question concerning two parameters in CalcOpticalFlowPyrLK() class.Here is the link of the documentation:

http://docs.opencv.org/trunk/modules/video/doc/motion_analysis_and_object_tracking。 html?highlight = calcopticalflowpyrlk#cv2.calcOpticalFlowPyrLK

第一个参数是 err 。在文档中,这被定义为它的功能的跟踪错误,但它们没有给出任何细节。关于什么的错误?

The first parameter is the "err". In the documentation this is defined as the tracking error of it's feature, but they don't give any details. Error in respect of what?

其次,参数状态。如果找到相应的功能(1)或不是(0),则将其定义为状态。
我有这样的情况,一个特定功能的跟踪错误是低的,状态为未找到= 0这个功能。我也有相反的情况。

Secondly the parameter "status".They define it as the state if a corresponding feature is found(1) or not(0). I have cases that the error of the tracking for a specific feature is low and the status is "not found=0" for this feature.I have also the opposite case.

这两者之间有什么连接吗?我试图检测眼睛眨眼。显然,当眼睛闭合时眼睛角膜中的特征(闪烁)不存在。但是对于这个帧,状态保持为1(找到),但是错误爆炸。
例如我有帧t,我试图跟踪帧t + 1中的功能。在帧t所有的功能都有。在帧t + 1功能消失了(眨眼),但状态仍然是1 。

Is there any connection between those two? I try to detect eye blink.Obviously the feature i have in the cornea of the eye(glints) are not there when the eye is closed.But still for this frame the state remains 1(found) but the error explodes. Eg I have frame t and i try to track the feature in frame t+1.In frame t all the features are there.In frame t+1 the features are gone(eye blink) but the status is still 1.

推荐答案

这两个值的连接是你首先要检查状态数组。状态数组说明是否找到特征点。这个检查具有比错误更高的优先级。文档说:如果没有找到流,那么错误没有定义。但是内存必须得到分配以保持索引对应。在C ++中,你必须初始化值,如果这不发生,将有一些随机值。所以我认为OpenCV不是填充数组与零或之前的东西。所以这就是为什么它会发生的错误是真的很小,但没有状态位!

The connection of these two values is that you first have to check the status array. The status array says if a feature point was found or not. This "check" has a higher priority then the error. The documentation says: "if the flow wasn’t found then the error is not defined". But the memory has to get alloceted anyway to keep the index correspondences. In C++ you have to initalize values, if this not happend there will be some random value. So I think OpenCV is not fill the array with zeros or something before. So that is why it can happend that the error is really small, but there is no status bit!

Here is some explenation how it Lucas-Kanada Method works.

当我在OpenCV中实现光流时,发现这个好的链接。

When I was implementing Optical Flow in OpenCV i found this nice link.

此书掌握OpenCV与实用的计算机视觉项目有一个有用的章节。

Also the book Mastering OpenCV with Practical Computer Vision Projects has a usefull chapter about that.

这篇关于opencv(CalcOpticalFlowPyrLK)中的光流类别参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆