app开发者平台在数字化时代的重要性与发展趋势解析
626
2022-10-31
vec2d
namespace :
cv::vec2d;
void src2ipm(cv::Mat &srcimage, cv::Mat& uvgrid, cv::Mat& outimage, cv::Mat& coord, cv::Size& sz, double ht, double roll, double pitch, double* camera_param_KK){ int height = (int)(ht*1000); //unit-mm. double fx = camera_param_KK[0]; double fy = camera_param_KK[4]; double cx = camera_param_KK[2]; double cy = camera_param_KK[5]; double c1 = cos(pitch*PI / 180); double s1 = sin(pitch*PI / 180); double c2 = cos(roll*PI / 180); double s2 = sin(roll*PI / 180); double means = cv::mean(srcimage).val[0]; outimage = cv::Mat::zeros(sz.height, sz.width, CV_64FC1); coord = cv::Mat::zeros(sz.height, sz.width, CV_64FC2);// for (int i = 0; i < sz.height; i++) { for (int j = 0; j < sz.width; j++) { float ui = uvgrid.at
cv::Mat temp = cv::Mat::ones(3, uv.cols, CV_64FC1);
void xyp2ipmp(cv::Mat& xyp, cv::Mat& ipmp, cv::Mat& xylim, Size sz){ //xylimist_[0]-latteral/xylimist_[1]-longitudinal... //ipmp-row0-cols-latteral/ipmp-row1-rows-longitudinal... std::cout << "start probp2ipmp: " << std::endl; double xmin = 0, xmax = 0, ymin = 0, ymax = 0; minMaxLoc(xylim.row(0), &xmin, &xmax); minMaxLoc(xylim.row(1), &ymin, &ymax); double stepcol = (xmax - xmin) / sz.width; double steprow = (ymax - ymin) / sz.height; cv::Mat tempx = cv::Mat::ones(1, xyp.cols, CV_64FC1) * xmin; cv::Mat tempy = cv::Mat::ones(1, xyp.cols, CV_64FC1) * ymax; ipmp = cv::Mat::zeros(2, xyp.cols, CV_8UC1); ipmp.rowRange(0, 1) = ( xyp.rowRange(0, 1) - tempx ) / stepcol; ipmp.rowRange(1, 2) = ( tempy - xyp.rowRange(1, 2) ) / steprow; }
save image:
char output_path[100];
sprintf(output_path,"./ipmp/00000%05d.png",cnt); cv::imwrite(output_path, ipm3);
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~