立方体姿态估计

本文介绍了如何利用Ceres-solver最小化立方体的重投影误差和光度损失。通过旋转矢量和局部坐标系理解aruco标记,然后构建并优化6个参数(旋转和平移)。实验结果显示,aruco库提供的初始估计已经接近局部最优解,且在加入噪声后优化结果与未扰动时相近。同时,探讨了光度损失的计算和优化过程,尽管某些情况下未达到理想收敛状态。
摘要由CSDN通过智能技术生成

使用Ceres-solver最小化reprojection error和photometric loss

install (on Mac + Clion)

  1. CMD
brew install ceres-solver
brew install opencv
  1. CMakeList.txt
find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})
target_link_libraries(helloworld ${CERES_LIBRARIES})

Rotation Vector

  1. Three dimensions
  2. Direction is the axis and magnitude is the angle in radians (counter clockwise, axis centered)
  3. Use Rodrigues’ rotation formula to calculate (k is the unit vector of the rotation axis):

v r o t = v cos ⁡ θ + ( k × v ) sin ⁡ θ + k ( k ⋅ v ) ( 1 − cos ⁡ θ ) v_{rot} = v\cos\theta + (k \times v)\sin\theta + k(k \cdot v)(1-\cos\theta) vrot=vcosθ+(k×v)sinθ+k(kv)(1cosθ)

Local Coordinate of an Aruco Marker

  1. A detected marker: 4 corners, [top-left, top-right, down-right, down-left]
  2. Let length of one square side be L, corners’ coordinate:
    1. Top-left: [-L/2, L/2, 0]
    2. Top-right: [L/2, L/2, 0]
    3. Down-right: [L/2, -L/2, 0]
    4. Down-left: [-L/2, -L/2, 0]

Minimize Reprojection Error

(Ceres-solver优化时,需要计算loss function对各参数的偏导的解析解,因此在构造reprojection error时不能使用外部的库,只能使用直接的代数计算和ceres-solver提供的函数)

Optimize 6 parameters:

  1. R: 3 paramaters for rotation using Rodrigues’ rotation formula

  2. t: 3 parameters for translation

Convert from world to camera coordinate, (P: point in camera coordinate, X: point in world coordinate):
P = R ∗ X + t (1) P = R * X + t \tag{1} P=RX+t(1)
Perspective projection:
p = P / P . z (2) p = P / P.z \tag{2} p=P/P.z(2)
Radial distortion:
d i s t o r t ( p ) = 1.0 + k 1 ∗ ∣ ∣ p ∣ ∣ 2 + k 2 ∗ ∣ ∣ p ∣ ∣ 4 (3) distort(p) = 1.0 + k_1 * ||p||^2 + k_2 * ||p||^4 \tag{3} distort(p)=1.0+k1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值