且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

opencv - 使用特征检测的对象跟踪

更新时间:2022-02-05 08:00:11

假设您有对象的图片(参考图像)并且您检测特征并提取关键点.为了在场景中使用从 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: