这次我们利用下面几个函数实现一个AR建模功能。
Projects 3D points to an image plane.
§ projectPoints()
void cv::projectPoints ( InputArray objectPoints,
InputArray rvec,
InputArray tvec,
InputArray cameraMatrix,
InputArray distCoeffs,
OutputArray imagePoints,
OutputArray jacobian = noArray(),
double aspectRatio = 0
)
实例
/*
事先标定好的左相机的内参矩阵
fx 0 cx
0 fy cy
0 0 1
*/
const Mat camMatrix_p = (Mat_<double>(3, 3) << 550.7876, 0, 331.2659,
0, 550.5972, 264.1054,
0 , 0 , 1.0000);
/*k1,k2,p1,p2,k3*/
const Mat distCoeffs_p = (Mat_<double>(5, 1) << -0.3804 , 0.1771, 0.0012 , 0.0001, 0);
// Define
Vec3d Rvec, Tvec;
// Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel
float s