Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

EssentialTransferFactorK

Created by Codex.

Jointly constrain two essential matrices and the calibrations used for three-view transfer.

Open In Colab

Mathematical idea

This factor uses the same three-view line intersection as EssentialTransferFactor, but the calibration matrices are variables:

c(a)EacKa1u~a,c(b)EbcKb1u~b,ucpred=π(Kc(c(a)×c(b))).\ell_c^{(a)} \propto E_{ac}K_a^{-1}\tilde u_a, \qquad \ell_c^{(b)} \propto E_{bc}K_b^{-1}\tilde u_b, \qquad u_c^{\mathrm{pred}}=\pi(K_c(\ell_c^{(a)}\times\ell_c^{(b)})).

Here π\pi converts a homogeneous image point to ordinary pixel coordinates. Optimizing Ka,Kb,KcK_a,K_b,K_c 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.X

Model

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.