如何从单应性计算旋转和平移矩阵? [英] How to calculate Rotation and Translation matrices from homography?

查看:3831
本文介绍了如何从单应性计算旋转和平移矩阵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用emgucv(C#)中的 SURF 对同一场景的两个图像进行了比较,这两个图像由具有不同视角(例如左右)的摄像机拍摄。它给了我一个3x3单应矩阵的二维变换。但是现在我想在3D环境中使用这2个图像(使用DirectX)。为此,我需要计算第二图像(右)相对于第一图像(左)的3D形式的相对位置和方向。如何计算第二张图片的轮播和翻译矩阵?



我还需要第二张图片的z值。



我读了一些名为同形分解的东西。是这样吗?



有没有人熟悉单应性分解并且有什么算法可以实现?

同位素只适用于平面场景(即:所有点都是共平面的) 。如果是这样的话,单应性是一个投影变换,它可以分解成它的组成部分。



但是如果你的场景不是共面的(我认为是case从你的描述),那么它将需要一些更多的工作。您需要计算基本矩阵(其中 emgucv 会为你做)。基本矩阵是相机固有矩阵(K),两个视图之间的相对旋转(R)和平移(t)的组合。如果你知道K,恢复旋转和翻译很简单。看起来emgucv有相机校准。我不熟悉他们的特定方法,但这些通常涉及拍摄具有已知几何的场景的几个图像。


I have already done the comparison of 2 images of same scene which are taken by one camera with different view angles(say left and right) using SURF in emgucv (C#). And it gave me a 3x3 homography matrix for 2D transformation. But now I want to make those 2 images in 3D environment (using DirectX). To do that I need to calculate relative location and orientation of 2nd image(right) to the 1st image(left) in 3D form. How can I calculate Rotation and Translate matrices for 2nd image?

I need also z value for 2nd image.

I read something called 'Homograhy decomposition'. Is it the way?

Is there anybody who familiar with homography decomposition and is there any algorithm which it implement?

Thanks in advance for any help.

解决方案

Homography only works for planar scenes (ie: all of your points are coplanar). If that is the case then the homography is a projective transformation and it can be decomposed into its components.

But if your scene isn't coplanar (which I think is the case from your description) then it's going to take a bit more work. Instead of a homography you need to calculate the fundamental matrix (which emgucv will do for you). The fundamental matrix is a combination of the camera intrinsic matrix (K), the relative rotation (R) and translation (t) between the two views. Recovering the rotation and translation is pretty straight forward if you know K. It looks like emgucv has methods for camera calibration. I am not familiar with their particular method but these generally involve taking several images of a scene with know geometry.

这篇关于如何从单应性计算旋转和平移矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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