Q矩阵的信息解释

从Q矩阵中我们可以得到以下信息:

1.立体标定后的左相机主点坐标(cx,cy)

2.相机焦距f

3.相机基线距离Tx

4.Q矩阵Q[3][3]的分子两项是相等的,所以Q[3][3]=0

那么,左相机坐标系中点的X、Y、Z均可求得,代码如下:

//PL,PR分别为物体在左右图像中的匹配坐标点
Vec3d calXYZ(Point2d PL, Point2d PR)
{

	double cx = -Q.at<double>(0,3);
	double cy = -Q.at<double>(1,3);
	double f = Q.at<double>(2,3);
	double Tx = 1/Q.at<double>(3,2);
	double d = PL.x - PR.x;
	Vec3d real;
	real[0] = (PL.x - cx)*Tx / d;
	real[1] = (PL.y - cy)*Tx / d;
	real[2] = f*Tx / d;
	return real;
}

猜你喜欢

转载自blog.csdn.net/hankerbit/article/details/80556732
Q A
q