2024年2月12日发(作者:饶兢群)
vector
for (int i = 0; i <() / 2; i++) //计算标定板与相机间的齐次矩阵(旋转矩阵与平移向量) {
double data[12] = { 0 }; for (auto &d : data) { fin >> d; //cout << " " << d << endl; } getRT_fromTxt(data, tempR, tempT); temp = R_T2HomogeneousMatrix(tempR, tempR); Homo__back(temp); //tempT = tempT / 1000; /*cout << i << "::" << temp << endl;*/ //cout << i << "::" << tempR << endl; cout << i << "end to ba ::" << tempT.t() << endl; R__back(tempR); T__back(tempT); } cout << "board to camera::" << endl; //for (size_t i = 0; i < ; ++i) for (size_t i = 0; i < () / 2;++i) {
string rgb_name = folder + "/" + to_string(i) + "_"; string depth_name = folder + "/" + to_string(i) + "_"; //std::cout << rgb_name << std::endl; cv::Mat rgb = cv::imread(rgb_name); cv::Mat depth = cv::imread(depth_name, -1); /*cv::imshow("depth", depth); cv::waitKey(0);*/ if (!) std::cerr << "Problem loading image" << std::endl;
cv::Mat pnp_R,pnp_t; inputParameter(rgb, depth, cv::Size(11, 8), 30,pnp_R,pnp_t); //cout << "标定板到相机mat_camera" << mat_camera << endl; Homo__back(mat_camera);
HomogeneousMtr2RT(mat_camera, tempR, tempT); //tempT = tempT / 1000; //cout << i << "标定板到相机 ::" << mat_camera << endl;
//cout << i << "::" << tempT << endl;
R = (Mat_
}/*************************************************** @brief 将旋转矩阵与平移向量合成为齐次矩阵* @note* @param Mat& R 3*3旋转矩阵* @param Mat& T 3*1平移矩阵* @return Mat 4*4齐次矩阵**************************************************/Mat R_T2HomogeneousMatrix(const Mat& R, const Mat& T){ Mat HomoMtr; Mat_
cv::solvePnPRansac(board_points,image_corners,intrinsic_matrix,dist_coeffs,rvec,pnp_t); cv::Mat R_; cv::Rodrigues(rvec,pnp_R); std::cout<<" PNP R_ "<
本文发布于:2024-02-12 14:54:59,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/fan/82/1211374.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |