相机姿态估计:如何解释旋转和平移矩阵? [英] Camera pose estimation: How do I interpret rotation and translation matrices?

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

问题描述

假设我有两个图像之间的良好对应,并尝试恢复它们之间的相机运动。
我可以使用OpenCV 3的新设施,像这样:

  Mat E = findEssentialMat(imgpts1,imgpts2, focal,principalPoint,RANSAC,0.999,1,mask); 

int inliers = recoverPose(E,imgpts1,imgpts2,R,t,focal,principalPoint,mask);

Mat mtxR,mtxQ;
Mat Qx,Qy,Qz;
Vec3d angles = RQDecomp3x3(R,mtxR,mtxQ,Qx,Qy,Qz);

cout<< Translation:< t.t()<< endl;
cout<< 欧拉角[x y z]以度表示:< angle.t()<< endl;

现在,我无法围绕 R t 实际上意味着。是否需要将坐标从摄像机空间1映射到摄像机空间2,如 p_2 = R * p_1 + t



考虑这个例子,用ground-truth手动标记为对应





我得到的输出是:

 翻译:[-0.9661243151855488,-0.04921320381132761,0.253341406362796] 
欧拉角度[xyz],以度为单位:[9.780449804801876,46.49315494782735,15.66510133665445]

我尝试匹配这个和我在图片中看到的一样, c> [ - 0.96,-0.04,0.25] 告诉我,我已经移动到右边,坐标沿着负x轴移动,但它也会告诉我,更远,因为坐标已经沿着正z轴移动。



我还围绕y轴旋转摄像机(向左,我认为这是围绕负y轴的逆时针旋转,因为在OpenCV ,y轴向下,不是吗?)



问题:我的解释是否正确,如果没有,什么是正确的 c> p2 = R * p1 + t

/ code>确实有效。可以通过使用 cv :: triangulatePoints() cv :: convertPointsFromHomogeneous 来验证这一点(相对于相机1),然后应用上述等式。用相机2的相机矩阵乘法产生 p2 图像坐标。


Assume I have good correspondences between two images and attempt to recover the camera motion between them. I can use OpenCV 3's new facilities for this, like this:

 Mat E = findEssentialMat(imgpts1, imgpts2, focal, principalPoint, RANSAC, 0.999, 1, mask);

 int inliers = recoverPose(E, imgpts1, imgpts2, R, t, focal, principalPoint, mask);

 Mat mtxR, mtxQ;
 Mat Qx, Qy, Qz;
 Vec3d angles = RQDecomp3x3(R, mtxR, mtxQ, Qx, Qy, Qz);

 cout << "Translation: " << t.t() << endl;
 cout << "Euler angles [x y z] in degrees: " << angles.t() << endl;

Now, I have trouble wrapping my head around what R and t actually mean. Are they the transform needed to map coordinates from camera space 1 to camera space two, as in p_2 = R * p_1 + t?

Consider this example, with ground-truth manually labeled correspondences

The output I get is this:

Translation: [-0.9661243151855488, -0.04921320381132761, 0.253341406362796]
Euler angles [x y z] in degrees: [9.780449804801876, 46.49315494782735, 15.66510133665445]

I try to match this to what I see in the image and come up with the interpretation, that [-0.96,-0.04,0.25] tells me, I have moved to the right, as the coordinates have moved along the negative x-Axis, but it would also tell me, I have moved further away, as the coordinates have moved along the positive z-Axis.

I have also rotated the camera around the y-Axis (to the left, which I think would be a counter-clockwise rotation around the negative y-Axis because in OpenCV, the y-Axis points downwards, does it not?)

Question: Is my interpretation correct and if no, what is the correct one?

解决方案

It turns out my interpretation is correct, the relation p2 = R * p1 + t does indeed hold. One can verify this by using cv::triangulatePoints() and cv::convertPointsFromHomogeneous to obtain 3D coordinates from corresponding points (relative to camera 1) and then applying the above equation. Multiplication with camera 2's camera matrix then yields the p2 image coordinates.

这篇关于相机姿态估计:如何解释旋转和平移矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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