是否可以使用 openCV 中的 matchTemplate 来跟踪电影中的模板区域?

发布于 2025-01-15 21:51:56 字数 388 浏览 0 评论 0原文

我有一个 .tif 文件(灰度,8 位),它本质上是一段时间内的图像序列。我有一个随着时间移动的对象,因此在每个帧中都有不同的位置,我想使用 matchTemplate 在我的电影过程中“跟随”这个对象。这可能吗?如果可以,我该怎么做?

我已将 matchTemplate 应用于我的电影的几个单独的帧,并且它对其中一些(第一个和最后一个以及中间的一些)效果非常好,我只是似乎无法弄清楚如何遍历我的所有时间点来获得跟踪此元素

额外的问题,是否可以在每一帧更新模板?更具体地说,我可以在第一帧上检测对象,然后使用检测到的区域作为下一帧检测的模板吗?原因是对象随着时间的推移稍微改变形状,特别是在中间帧中,因此我无法在某些中间帧上使用原始模板检测对象(它会在最终帧中返​​回到原始形状) , 尽管)。

谢谢,我感谢任何帮助!

I have a .tif file (greyscale, 8-bit), which is essentially a sequence of images over time. I have an object that is moving over time, so has a different position in each frame, and I'd like to use matchTemplate to "follow" this object over the course of my movie. Is this possible and, if so, how would I go about it?

I have applied matchTemplate to a few individual frames of my movie, and it worked really well on some of them (first and last and some in between), I just can't seem to figure out how to go through all my timepoints to get tracking of this element

Extra question, is it possible to update the template at each frame? More specifically, can I detect the object on the first frame, and then use the detected region as a template for detection on the next frame? The reason for this is that the object changes shape slightly over time, especially in the middle frames, so I couldn't detect the object using my original template on some of the intermediate frames (it goes back to the original shape in the final frames, though).

Thank you, I appreciate any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文