opencv - 使用特征检测的对象跟踪 [英] opencv - object tracking using feature detection

查看:56
本文介绍了opencv - 使用特征检测的对象跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想跟踪视频中的对象(例如,移动的球).参考 opencv 教程 - 'Features2D + Homography to find a known object',我已经能够通过提供参考图像在静止图像中跟踪我的对象.我计划使用参考图像从输入视频的第一帧中检测移动对象.对于下一帧,在前一帧中检测到的对象应作为参考图像等.

I want to track an object(for example, a moving ball) in a video. Referring to opencv tutorial - 'Features2D + Homography to find a known object', I have been able to track my object in a still image by providing a reference image. I plan to use a reference image to detect the moving object from the first frame of input video. For the next frame the object detected in previous frame should act as a reference image and so on.

但我不知道如何从它的描述符中找回一个对象.一个包含多个对象的图像会有多个关键点,但是如何找到一个关键点或一组关键点属于图像中的哪个对象.

But I don't know how to find back an object from its descriptor. An image having several objects in it will have several keypoints, but how to find whick keypoint or bunch of keypoints belong to which object in an image.

推荐答案

假设您有对象的图片(参考图像)并且您检测特征并提取关键点.为了在场景中使用从 2D 图像到 3D 坐标的单应变换,您的对象应该是平面的.

Supose you have a picture of your object (reference image) and you detect features and extract keypoints. In order to use homography transformation from 2D image to 3D coordinates in the scene, your object should be planar.

现在,您必须处理帧,从场景中提取关键点.使您能够检测对象的是参考图像中的关键点与场景中的关键点的匹配.

Now, you have to process frames, extracting keypoints from the scene. What will allow you to detect the object is the matching of the keypoints in the reference image with the keypoints in the scene.

您的对象已被检测到,但如果您想知道它的 3D 位置,则必须对匹配的对使用 findHomography()(它将使用整个集合中的四个匹配).

Your object is detected, but if you you want to know its 3D position, you have to use findHomography() with the matched pairs (it will use four matches from the whole set).

所以关键是匹配.首先阅读这个:

So the key is the matching. Start by reading this:

这篇关于opencv - 使用特征检测的对象跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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