OpenCV投影点生成错误的Z轴(使用棋盘校准)
OpenCV Projectpoints makes wrong Z axis (calibrated with chessboard)
我想校准我的相机并绘制xyz轴。(如此链接所示:http://docs.opencv.org/3.1.0/d7/d53/tutorial_py_pose.html)
不幸的是,我的校准做了一些奇怪的事情,我似乎无法修复它。我制作了一个cad模型,以最大限度地减少其他可能的错误。。。
所以基本上,我做两个步骤:
- 校准每个摄像头
- 使用投影点绘制线
我不知道哪里出了问题。。。
来自cameraCalibration的变量。图像点中的点由棋盘找到。
vector< vector<cv::Point2f> > imagePoints;
vector< vector< cv::Point3f> > objectPoints;
vector<cv::Mat> rvecs, tvecs;
cv::Mat intrinsic_Matrix, distortion_coeffs;
查找点的代码
cv::Point2f clsCameraControl::FindSpecific(cv::Point3f o3Dpoint)
{
cv::Mat rvec, tvec;
rvec.create(1, 3, cv::DataType<double>::type);
tvec.create(1, 3, cv::DataType<double>::type);
rvec = rvecs[0].clone();
tvec = tvecs[0].clone();
cv::solvePnP(objectPoints[0], imagePoints[0], intrinsic_Matrix, distortion_coeffs, rvec, tvec);
vector<cv::Point3f> Input1;
vector <cv::Point2f> Output1;
Input1.insert(Input1.end(), o3Dpoint);
Output1.clear();
cv::projectPoints(Input1, rvec, tvec, intrinsic_Matrix, distortion_coeffs, Output1);
return Output1[0];
}
这张图代表了我得到的四个结果(绘制X(绿色)、Y(红色)和Z(蓝色)轴)
Z轴总是错误的。它应该只是向上(或者至少在同一方向上都错了)
我使用的基本图片在这本相册中,如果你想自己尝试的话(我自己制作的,每个人都可以免费使用!)
有人知道我为什么以及如何解决这个问题吗?
对于有这个问题的人:多拍一些照片。。。
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 代码在main()中运行,但在函数中出现错误
- 释放错误后堆使用
- (C++)分析树以计算返回错误值的简单算术表达式
- Project Euler问题4的错误解决方案
- 我的字符计数代码计算错误.为什么
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 在某些循环内使用vector.push_back时出现分段错误
- OpenGL 透视投影裁剪多边形与顶点在视锥体之外 = 错误的纹理映射?
- OpenCV投影点生成错误的Z轴(使用棋盘校准)
- 在C++中投影euler#8得到了错误的答案,这是uint_64值的最大值
- OpenGL 3.3投影矩阵错误