## Tan

Main interests: Unity, Kinect, AR, VR

# 对极几何——本质矩阵E和基础矩阵F

（1）Essential Matrix

Pr = R(Pl-T) 和 RT=R-1 可得：(RTPr)T·(Pl×T) = 0。

（2）Fundamental Matrix

（3）OpenCV的相关计算

    /*
Compute initial estimate of pose

For each image, compute:
R(om) is the rotation matrix of om
om(R) is the rotation vector of R
R_ref = R(om_right) * R(om_left)'
T_ref_list = [T_ref_list; T_right - R_ref * T_left]
om_ref_list = {om_ref_list; om(R_ref)]

om = median(om_ref_list)
T = median(T_ref_list)
*/

    if( matE || matF )
{
double* t = T_LR.data.db;
double tx[] =
{
0, -t[2], t[1],
t[2], 0, -t[0],
-t[1], t[0], 0
};
CvMat Tx = cvMat(3, 3, CV_64F, tx);
double e[9], f[9];
CvMat E = cvMat(3, 3, CV_64F, e);
CvMat F = cvMat(3, 3, CV_64F, f);
cvMatMul( &Tx, &R_LR, &E );
if( matE )
cvConvert( &E, matE );
if( matF )
{
double ik[9];
CvMat iK = cvMat(3, 3, CV_64F, ik);
cvInvert(&K[1], &iK);
cvGEMM( &iK, &E, 1, 0, 0, &E, CV_GEMM_A_T );
cvInvert(&K[0], &iK);
cvMatMul(&E, &iK, &F);
cvConvertScale( &F, matF, fabs(f[8]) > 0 ? 1./f[8] : 1 );
}
}

01-05 2703

08-27 9110

05-02 8110

02-14 1325

05-15 5561

02-01 1827

05-04 47

12-13 1.1万

08-23 4704

11-18 1228