来自基本矩阵的投影矩阵 [英] Projection matrix from Fundamental matrix
问题描述
我已经获得了两台相机之间的基本矩阵.我也将它们的内部参数保存在3 X 3
矩阵中,该矩阵是我之前通过国际象棋棋盘获得的.使用基本矩阵,我通过
I have obtained fundamental matrix between two cameras. I also, have their internal parameters in a 3 X 3
matrix which I had obtained earlier through chess board. Using the fundamental matrix, I have obtained P1
and P2
by
P1 = [I | 0]
和P2 = [ [e']x * F | e']
这些投影矩阵对于获取确切的3D位置并不是很有用.
由于我具有内部参数K1
和K2
,因此将P1
和P2
更改为
These projection matrices are not really useful in getting the exact 3D location.
Since, I have the internal parameters K1
and K2
, I changed P1
and P2
as
P1 = K1 * [I | 0]
和P2 = K2 * [ [e']x * F | e']
- 这是获得真实投影矩阵的正确方法,该投影矩阵给出了3D世界与图像之间的实际关系吗?
- 如果没有,请帮助我了解正确的方法以及哪里出了问题.
- 如果这是正确的方法,我如何验证这些矩阵?
推荐答案
一本很好的参考书是Hartley和Zisserman撰写的计算机视觉中的多视图几何". 首先,您的P公式是错误的.如果您想在公式中包含K,那就更合适了
A good reference book is "Multiple View Geometry in Computer Vision" from Hartley and Zisserman. First, your formula for P is wrong. If you want the formula with K inside, it is rather
P = K * [R | t]
或
P = [ [e']x * F | e']
但不能两者兼而有之.
如果您是根据8点算法计算出F,那么您最多只能恢复3D单应性(即4x4变换)的射影几何.
If you computed F from the 8 points algorithm, then you can recover only projective geometry up to a 3D homography (i.e. a 4x4 transformation).
要升级到欧几里得空间,有两种可能性,两者都是从计算基本矩阵开始的.
To upgrade to euclidian space, there are 2 possibilities, both starting by computing the essential matrix.
第一种可能性是根据F计算基本矩阵:E = transpose(K2)* F * K1.
First possibility is to compute the essential matrix from F: E = transpose(K2)*F*K1.
第二种可能性是直接估算这两种视图的基本矩阵:
Second possibility, is to estimate directly the essential matrix for these 2 views:
- 通过对每个图像预先乘以K的逆值来归一化2D点(归一化的图像坐标")
- 在这些归一化点上应用(与F相同)8点算法
- 通过SVD分解并强制对角线值,强制使基本矩阵的2个奇异值等于1,最后一个为0.
- Normalize your 2D points by pre multiplying with inverse of K for each image ("normalized image coordinates")
- Apply the (same than for F) 8 points algorithm on these normalized points
- Enforce the fact that the essential matrix has its 2 singular values equal to 1 and last is 0, by SVD decomposition and forcing the diagonal values.
一旦有了基本矩阵,我们就可以以
Once you have the essential matrix, we can compute the projection matrix in the form
P = K * [R | t]
由于E的SVD的元素,因此可以找到
R和t(参见前面提到的书). 但是,您将有4种可能性.它们中只有一个在两个摄像机的前面投射点,因此您应该测试一个点(如果确定的话)以消除4个摄像机之间的歧义. 并且在这种情况下,您将能够在3D场景中放置相机及其方向(具有投影的R和t).
R and t can be found thanks to the elements of the SVD of E (cf the previously mentioned book). However, you will have 4 possibilities. Only one of them projects points in front of both cameras, so you shall test a point (if you are sure of it) to remove the ambiguity among the 4. And in this case you will be able to place the camera and its orientation (with R and t of the projection) in your 3D scene.
不是很明显,确实...
Not so obvious, indeed...
这篇关于来自基本矩阵的投影矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!