首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >寻找两个平面间的透视变换

寻找两个平面间的透视变换
EN

Stack Overflow用户
提问于 2013-09-06 08:11:05
回答 1查看 1K关注 0票数 1

我有一个点云由多个图像创建。我从它中提取了一个平面,它也是在三维协调系统中,这意味着我有那个平面的平面方程。但在原始图像中,平面不具有正向正向视图,即平面与观察平面不平行。但是,由于我有飞机的三维云,我想把它投影在XY平面上,也就是我想让这个平面与观察平面平行,并从它创建一个图像。在C++/OpenCV中实现它的算法或函数是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-09-06 10:40:49

我不知道你到底想做什么,但这些可能会对你有帮助,我用棋盘做了这件事:

代码语言:javascript
复制
std::vector<cv::Point2f> not_a_rect_shape;  // In this vector you should save the x,y coordinates of your 3D rect  

// the not_a_rect_shapecoordinates are from you source frame 



// Define the destination image
            quad = cv::Mat::zeros(300, 220, CV_8UC3);  // the size is important, it depends on your application, I have to say that 300x220 isn't always the right one. you have to give more infomations!! 


// these will be the parallel plane vector of point 
quad_pts.push_back(cv::Point2f(0, 0));
            quad_pts.push_back(cv::Point2f(quad.cols, 0));
            quad_pts.push_back(cv::Point2f(quad.cols, quad.rows));
            quad_pts.push_back(cv::Point2f(0,quad.rows));


transformationMatrix= cv::getPerspectiveTransform(not_a_rect_shape, quad_pts);// this is you transformation matirx 

cv::warpPerspective(src, quad, transformationMatrix,quad.size(),CV_INTER_LINEAR,cv::BORDER_ISOLATED); // the flags could change 

现在四帧应该是你要找的!我希望它能帮上忙

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18652953

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档