gpt4 book ai didi

c++ - OpenCV 束调整

转载 作者:太空狗 更新时间:2023-10-29 23:06:52 27 4
gpt4 key购买 nike

我正在尝试使用 OpenCV 束调整:LevMarqSparse::bundleAdjust不幸的是,输出似乎完全错误:

Iteration: 0, normError: 4.30244e+46 (3.64614e+44)
decreasing lambda to 0.024556
Iteration: 1, normError: 2.72985e+31 (2.31343e+29)
decreasing lambda to 0.0024556
Iteration: 2, normError: 8.00302e+25 (6.78222e+23)
move failed: lambda = 0.024556, e2 = 2.62043e+40 (2.2207e+38) > 8.00302e+25(6.78222e+23)
move failed: lambda = 0.24556, e2 = 7.31034e+40 (6.1952e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556, e2 = 1.59706e+40 (1.35344e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 24.556, e2 = 1.33882e+40 (1.13459e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 245.56, e2 = 1.31518e+40 (1.11456e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2455.6, e2 = 1.31283e+40 (1.11257e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 24556, e2 = 1.3126e+40 (1.11237e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 245560, e2 = 1.31257e+40 (1.11235e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+06, e2 = 1.31257e+40 (1.11235e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+07, e2 = 1.31257e+40 (1.11235e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+08, e2 = 1.31257e+40 (1.11235e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+09, e2 = 1.31257e+40 (1.11235e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+10, e2 = 1.3125e+40 (1.11229e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+11, e2 = 1.31102e+40 (1.11103e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+12, e2 = 1.3103e+40 (1.11042e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+13, e2 = 1.31471e+40 (1.11416e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+14, e2 = 1.29156e+40 (1.09454e+38) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+15, e2 = 1.15709e+40 (9.80585e+37) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+16, e2 = 3.81423e+39 (3.2324e+37) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+17, e2 = 6.59182e+36 (5.58629e+34) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+18, e2 = 8.07694e+34 (6.84487e+32) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+19, e2 = 7.73149e+52 (6.55211e+50) > 8.00302e+25 (6.78222e+23)
move failed: lambda = 2.4556e+20, e2 = 2.061e+40 (1.74661e+38) > 8.00302e+25 (6.78222e+23)
decreasing lambda to 2.4556e+19

如果我手动重新投影我对关键点的第一次猜测,我得到的总(求和)欧氏距离(以像素为单位(误差))为 169.541在每个关键点和它的三角点的重投影之间。调用 LevMarqSparse::bundleAdjust 后的相同错误检查给出了 5.50025e+12 的错误。

有人能给我指出正确的方向吗?谢谢。

最佳答案

一般来说,当 bundle 调整发生这样的事情时,至少有以下错误之一是很可能的:

  1. 3D点的2D投影不是正确的,所以一个3D点被重投影到错误的2D投影上,重投影误差会很大。也许 2D 投影和 3D 点之间的索引发生了一些变化。
  2. 您使用的相机与 OpenCV 要求的坐标系不同。想象一下大约 180° 的旋转或反向运动,3D 点将投影到某个地方,但肯定不会投影到正确的 2D 位置。所以,也许尝试采用逆相机矩阵。如果 P 是您的 4x4 齐次投影矩阵之一,则采用 P.inv() 而不是 P。

这将有助于获得平均重投影误差。总和意义不大,因为我们不知道您在重建中有多少 3D 点和 2D 投影。

关于c++ - OpenCV 束调整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14349582/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com