opencv - object tracking using feature detection

牧云@^-^@ 提交于 2021-01-27 03:51:20

问题


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.


回答1:


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.

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:



来源:https://stackoverflow.com/questions/12196889/opencv-object-tracking-using-feature-detection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!