利用openMVG,解决pnp问题,实现后方交会
0、参考工程项目
openMVG源码中,software文件夹下的项目:
1、核心实现-lib库源码理解
1.0、lib库源码文件
1.1、算法核心:求解P【K+相机pose(rotation + center )】
- 多种方式,主要分为两类:
- K未知,求解整个P
case resection::SolverType::DLT_6POINTS:
- K已知,求解pose即可
case resection::SolverType::P3P_NORDBERG_ECCV18:
case resection::SolverType::P3P_KE_CVPR17:
case resection::SolverType::P3P_KNEIP_CVPR11:
case resection::SolverType::UP2P_KUKELOVA_ACCV10:
ps:P6P\P3P值求解的最小配置,在实际操作时,可以增加配置,求超定解
注意:代码在实现是,默认为超定解,且对配置的数目做了最小要求,eg:2.5*minimum
-
// Robust estimation of the pose and its precision
求解pose时,基于ACRANSAC Robust 估计 -
后续refine,基于ba进行捆绑调整
输入初值:
Intrinsic:未知时,由localize计算P分解得到K,并根据i_User_camera_model构建;
已知时,直接作为初值,或者作为不变量
// A valid pose has been found (try to refine it):
// If not intrinsic as input:
// init a new one from the projection matrix decomposition
// Else use the existing one and consider as static.
Pose:由localize计算得到
Resection_data_ptr:原始的2D-3D对应
2、 其他
采用原来方法配置环境,核心实现被封装,无法进入函数内部调试,依照software中项目进行环境配置,可以进入源码 (why??include路径与源码相关,可以直接在解决方案里打开该路径下.cpp文件;若include路径与output有关(单独由源码整理的),在解决方案里没法打开,毕竟不属于该解决方案??)