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

查看:40
本文介绍了使用基本矩阵 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

  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天全站免登陆