您的位置:首页 > 财经 > 产业 > 深圳网站建站建设公司地址_北京互联网公司待遇排名_制作网页app_百度拉新推广平台

深圳网站建站建设公司地址_北京互联网公司待遇排名_制作网页app_百度拉新推广平台

2024/12/22 20:52:07 来源:https://blog.csdn.net/weixin_40059786/article/details/144020976  浏览:    关键词:深圳网站建站建设公司地址_北京互联网公司待遇排名_制作网页app_百度拉新推广平台
深圳网站建站建设公司地址_北京互联网公司待遇排名_制作网页app_百度拉新推广平台

参考文献: Single View Point Omnidirectional Camera Calibration from Planar Grids

1. 相机模型如下:

   // 相机坐标系下的点投影到畸变图像// 输入:相机坐标系点坐标cam  输出: 畸变图像素点坐标disPtvoid FisheyeCamAdapter::cam2DistImg(cv::Point3f &cam, cv::Point2f &disPt){double r = cv::norm(cam);double dx_u = 0, dy_u = 0;if (r != 0){cv::Point3f ps = cam / r;double x = ps.x / (ps.z + camInt.fXi);double y = ps.y / (ps.z + camInt.fXi);distortion(x, y, &dx_u, &dy_u);x += dx_u;y += dy_u;disPt.x = x * camInt.fGammaX + camInt.fCx;disPt.y = y * camInt.fGammaY + camInt.fCy;}else{disPt.x = camInt.fCx;disPt.y = camInt.fCy;}}// 无畸变图像到畸变图像void FisheyeCamAdapter::distortion(double mx_u, double my_u, double *dx_u, double *dy_u){double mx2_u = 0., my2_u = 0., mxy_u = 0., rho2_u = 0., rad_dist_u = 0.;double k1 = camInt.distortCoeff[0];double k2 = camInt.distortCoeff[1];double p1 = camInt.distortCoeff[2];double p2 = camInt.distortCoeff[3];double k5 = camInt.distortCoeff[4];mx2_u = mx_u * mx_u;my2_u = my_u * my_u;mxy_u = mx_u * my_u;rho2_u = mx2_u + my2_u;rad_dist_u = k1 * rho2_u + k2 * rho2_u * rho2_u + k5 * rho2_u * rho2_u * rho2_u;*dx_u = mx_u * rad_dist_u + 2 * p1 * mxy_u + p2 * (rho2_u + 2 * mx2_u);*dy_u = my_u * rad_dist_u + 2 * p2 * mxy_u + p1 * (rho2_u + 2 * my2_u);}

   反投影过程:畸变图中的像素坐标计算相机坐标系下坐标

    cv::Point3f FisheyeCamAdapter::pointDis2Camera(const cv::Point2f &disPoint){double mx_d, my_d, mx_u, my_u;double lambda;double xi = camInt.fXi;// Lift points to normalised planefloat inv_K11 = 1 / camInt.fGammaX;float inv_K13 = -camInt.fCx / camInt.fGammaX;float inv_K22 = 1 / camInt.fGammaY;float inv_K23 = -camInt.fCy / camInt.fGammaY;mx_d = inv_K11 * (disPoint.x) + inv_K13;my_d = inv_K22 * (disPoint.y) + inv_K23;undistortGN(mx_d, my_d, &mx_u, &my_u, 100); // 去畸变坐标// Lift normalised points to the sphere (inv_hslash)cv::Point3f camera;if (xi == 1){lambda = 2 / (mx_u * mx_u + my_u * my_u + 1);camera.x = lambda * mx_u;camera.y = lambda * my_u;camera.z = lambda - 1;}else{double sqrt_i = 1.0 + (1.0 - xi * xi) * (mx_u * mx_u + my_u * my_u);if (sqrt_i < 0){camera.x = -1000000;camera.y = -1000000;camera.z = 1;}else{lambda = (xi + sqrt(sqrt_i)) / (1.0 + mx_u * mx_u + my_u * my_u);camera.x = lambda * mx_u;camera.y = lambda * my_u;camera.z = lambda - xi;}}return camera;}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com