Created by Codex.
Jointly constrain two essential matrices and the calibrations used for three-view transfer.
Mathematical idea¶
This factor uses the same three-view line intersection as EssentialTransferFactor, but the calibration matrices are variables:
Here converts a homogeneous image point to ordinary pixel coordinates. Optimizing couples self-calibration to the transfer constraint.
import gtsam
import numpy as np
from gtsam import symbol_shorthand
C = symbol_shorthand.C
K = symbol_shorthand.K
P = symbol_shorthand.P
S = symbol_shorthand.S
X = symbol_shorthand.XModel¶
EssentialTransferFactorK<K> is a five-variable factor: two essential matrices plus calibrations for views a, b, and c. By default it derives calibration keys from the edge view indices with symbol k. The alternate constructor uses one shared calibration key.
Python exposes Cal3_S2, Cal3f, and Cal3Bundler variants.
triplets = [(np.array([310.0, 235.0]),
np.array([330.0, 236.0]),
np.array([320.0, 235.5]))]
factor = gtsam.EssentialTransferFactorKCal3_S2(
gtsam.EdgeKey(0, 2), gtsam.EdgeKey(1, 2), K(0), triplets
)
print("factor keys:", factor.keys())
print("residual dimension:", factor.dim())factor keys: [2, 4294967298, 7710162562058289152, 7710162562058289152, 7710162562058289152]
residual dimension: 2
Practical notes¶
Use the explicit keyK overload only when the same calibration variable truly applies to all views. Otherwise let the factor derive k(a), k(b), and k(c). Provide calibration priors or sufficient additional constraints to avoid an ill-conditioned self-calibration problem.