OpenCV 背景减法/密码本?
我正在尝试 codebook 方法,但并不真正理解 code_book 结构中 int t 的意义。它用于“计算每次访问”的变量,但这完全让我迷失了。算什么访问什么?由谁来?有人可以向我解释一下成员变量的用途吗?请尽量使用非技术术语
其次,在ce结构中,int t_last_update和int stale成员数据有什么意义? t_last_update 应该杀死过时的条目,但是什么是过时的条目?你说的“杀了它”是什么意思?对于 int stale,它应该计算最大负运行吗?什么是负运行以及它的用途是什么?
感谢您的帮助
PS:只是确认我需要什么:解释 code_book 结构中的 int t 的作用以及 ce 结构中的 int t_last_update 和 int _stale 的作用。
Im trying out the codebook method, but don't really understand the point of int t in a code_book struct. Its the variable used to "Count every access", but this completely lost me. Count what access to what? By whom? Could someone please explain the purpose of the member variable to me? Please try to use non-technical terms
Secondly, in the ce struct, whats the point of the int t_last_update and int stale member data? t_last_update is supposed to kill stale entries, but whats a stale entry? What do you mean by "kill it"? And for int stale, its supposed to count the max negative run? Whats a negative run and whats its used for?
Thanks for your help
PS: just confirming what I need: explain what int t in a code_book struct does and what int t_last_update and int _stale do in a ce struct.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在谈论 OpenCV 书中的这部分代码:
基本上,您可以将 t 字段视为每次将新帧添加到代码书中时的滴答计数。它用于确定从码本收集开始或最后一次清除陈旧像素以来已经过去了多长时间。
编辑:
您有两个正在跟踪的数据结构。 codeBook 就像存储在其中的 codeBook_elements(即 ce 结构)的父级。每次更新 codeBook 时,t 都会递增。但是,该更新可能不会增加所有 codeBook_elements。所以...
t_last_update 是最后一次访问特定 codeBook_element 的时间。
stale 有助于跟踪码本条目在码本中的“旧”程度。
negRun 代表负运行时间。它记录自访问密码簿条目以来已经过去了多长时间。如果时间太长,则它被认为是过时的并被删除以节省内存。
OpenCV 示例中的码本方法进行了更新。看一下 bgfg_codebook.cpp< /a> 样本。
希望这有帮助!
I assume you are talking about this section of code from the OpenCV book:
Basically, you can think of the t field as a tick count each time a new frame is added to the code book. It used to determine how long it has been from the start of the code book collection, or the last clear of stale pixels.
EDIT:
You have two data structures being tracked. codeBook is like the parent of the codeBook_elements (i.e., the ce structure) stored within it. t is incremented every time the codeBook is updated. But, that update may not increment all codeBook_elements. So...
t_last_update is the last time a particular codeBook_element was accessed.
stale helps to track how "old" the code book entries are in the code book.
negRun stands for negative run-time. It keeps track of how long it has been since a code book entry has been accessed. If it's been too long, then it's considered stale and is removed to conserve memory.
There is an update of the code book method in the OpenCV samples. Take a look at the bgfg_codebook.cpp sample.
Hope that was helpful!