使用基本矩阵opencv确定摄像机运动 [英] Determining camera motion with fundamental matrix opencv

查看:121
本文介绍了使用基本矩阵opencv确定摄像机运动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用opencv从基本矩阵确定相机运动.我目前正在使用光流跟踪每隔一帧中点的运动.基本矩阵是从基本矩阵和摄影机矩阵派生而来的.我的算法如下

I tried determining camera motion from fundamental matrix using opencv. I'm currently using optical flow to track movement of points in every other frame. Essential matrix is being derived from fundamental matrix and camera matrix. My algorithm is as follows

1.使用goodfeaturestotrack功能从帧中检测特征点.

1 . Use goodfeaturestotrack function to detect feature points from frame.

2.将点跟踪到接下来的两三个帧(Lk光流),在此期间使用相应的点计算平移和旋转向量

2 . Track the points to next two or three frames(Lk optical flow), during which calculate translation and rotation vectorsusing corresponding points

3.两三帧后刷新点(使用goodfeaturestotrack).再次找到平移和旋转向量.

3 . Refresh points after two or three frame (use goodfeaturestotrack). Once again find translation and rotation vectors.

我知道我无法添加平移矢量来从头算起总运动,因为刷新点并重新开始重新进行跟踪时,轴一直在变化.任何人都可以建议我如何从原点计算出运动的总和.

I understand that i cannot add the translation vectors to find the total movement from the beginning as the axis keep changing when I refresh points and start fresh tracking all over again. Can anyone please suggest me how to calculate the summation of movement from the origin.

推荐答案

您要问的是一个典型的视觉里程表问题.连接李群的变换矩阵SE3. 您只需将T_1 T_2 T_3乘以直到得到T_1to3

You are asking is a typical visual odometry problem. concatenate the transformation matrix SE3 of the Lie-Group. You just multiply the T_1 T_2 T_3 till you get T_1to3

您可以尝试使用以下代码 https://github .com/avisingh599/mono-vo/blob/master/src/visodo.cpp

You can try with this code https://github.com/avisingh599/mono-vo/blob/master/src/visodo.cpp

  for(int numFrame=2; numFrame < MAX_FRAME; numFrame++)
    if ((scale>0.1)&&(t.at<double>(2) > t.at<double>(0)) && (t.at<double>(2) > t.at<double>(1))) {

      t_f = t_f + scale*(R_f*t);
      R_f = R*R_f;

    }

它是简单的数学概念.如果您感到困难,只需看一下机器人技术的正向运动学,就可以更轻松地理解.只是串联部分,而不是DH算法. https://en.wikipedia.org/wiki/Forward_kinematics

Its simple math concept. If you feel difficult, just look at robotics forward kinematic for easier understanding. Just the concatenation part, not the DH algo. https://en.wikipedia.org/wiki/Forward_kinematics

这篇关于使用基本矩阵opencv确定摄像机运动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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