OpenCV捆绑调整

时间:2013-01-16 00:37:58

标签: c++ opencv bundle adjustment

我正在尝试使用OpenCV Bundle Adjustment: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的错误。

有人可以指出我正确的方向吗?感谢。

1 个答案:

答案 0 :(得分:1)

一般情况下,当捆绑调整发生类似这样的事情时,至少有一个以下错误:

  1. 2D投影不是3D点的正确投影,因此将一个3D点重新投影到错误的2D投影上,因此重投影误差将非常大。也许2D投影和3D点之间的指数已经发生了一些事情。
  2. 您使用的相机不在OpenCV要求的相同坐标系中。想象一下旋转大约180°或反向运动,3D点将投射到某处,但肯定不会在正确的2D位置。所以,也许尝试采用逆相机矩阵。如果P是您的4x4齐次投影矩阵之一,请使用P.inv()而不是P.
  3. 这将有助于获得平均重投影错误。总和不是很有意义,因为我们不知道你在重建中有多少3D点和2D投影。