简体   繁体   English

OpenCV / Python Bundle 调整

[英]OpenCV / Python Bundle adjustment

I have an application where I am attempting structure from motion for multiple views from the same camera using OpenCV in Python.我有一个应用程序,我在 Python 中使用 OpenCV 尝试从同一相机的多个视图的运动中构建结构。 (OpenCV isn't a hard requirement but Python is right now). (OpenCV 不是硬性要求,但 Python 现在是)。 Example: I have 16 camera images to work with with small motions between each frame.示例:我有 16 个相机图像可以处理每帧之间的小动作。 In the frames (200x200) I can track ~50 features and I'd like to estimate camera pose and 3D point locations for the features as accurately as possible.在帧 (200x200) 中,我可以跟踪约 50 个特征,并且我想尽可能准确地估计特征的相机姿势和 3D 点位置。

I'm at the point where I'd like to use a stream of frames (from video) to refine the estimates of camera pose and 3D point positions since estimating pose and triangulating 3D points from two frames produces a lot of noise.我现在想使用帧流(来自视频)来优化相机姿势和 3D 点位置的估计,因为从两帧估计姿势和三角测量 3D 点会产生很多噪音。 I believe Bundle Adjustment is the next obvious direction to go in, but I'm not finding any obvious Python implementation of bundle adjustment to use.我相信捆绑调整是下一个明显的方向,但我没有找到任何明显的捆绑调整的 Python 实现可以使用。 Many options (such as LevMarqSparse::bundleAdjust()) appear to be only partially completed or not fully adopted.许多选项(例如 LevMarqSparse::bundleAdjust())似乎仅部分完成或未完全采用。

What is a good place to start?什么是好的起点? I guess I'm looking for a relatively simple Python bundle adjustment to prototype with and see if that is a direction I want to invest more time into.我想我正在寻找一个相对简单的 Python 包调整来构建原型,看看这是否是我想投入更多时间的方向。

Assuming you have a calibrated camera and an initial estimate of intrinsics and extrinsic parameters, you could at first perform a simple bundle adjustment directly in Python.假设您有一个校准过的相机以及对内在和外在参数的初始估计,您可以首先直接在 Python 中执行简单的捆绑调整。 For instance, you could use stacks of three images, compute 3D points from the feature points via the homogeneous triangulation method.例如,您可以使用三个图像的堆栈,通过齐次三角测量方法从特征点计算 3D 点。 A simple bundle adjustment as a first prototype can be build for instance via scipy.least_squares and the Trusted Region Reflective non-linear optimization technique.例如,可以通过 scipy.least_squares 和可信区域反射非线性优化技术构建作为第一个原型的简单束调整。 Check out this tutorial .查看本教程

Afterwards you can decide, whether you want to implement or use a Levenberg-Marquardt optimization technique which is able to handle sparse Jacobians or even determine the Jacobian analytically to hypothetically increase the convergence if desired.之后,您可以决定是要实施还是使用 Levenberg-Marquardt 优化技术,该技术能够处理稀疏雅可比矩阵,甚至可以分析确定雅可比矩阵以在需要时假设增加收敛性。

So far, I think there is no adequate library in Python which provides a potent and high performant implementation of bundle adjustment.到目前为止,我认为 Python 中没有足够的库来提供强大且高性能的捆绑调整实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM