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.

BilinearAngleTranslationFactor

Created by Codex.

Use a per-edge scale variable to express a Bilinear Angle-based Translation Averaging (BATA) direction residual.

Open In Colab

Mathematical idea

For translations Ta,TbR3T_a,T_b\in\mathbb{R}^3 and a measured unit direction uabu_{ab}, the factor introduces one inverse-baseline scale sabs_{ab} and uses

rab=sab(TbTa)uab.r_{ab} = |s_{ab}|(T_b-T_a)-u_{ab}.

BATA means Bilinear Angle-based Translation Averaging. The auxiliary scale avoids differentiating the normalized baseline (TbTa)/TbTa(T_b-T_a)/\lVert T_b-T_a\rVert. The formulation comes from Zhuang, Cheong, and Lee, Baseline Desensitizing in Translation Averaging, IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018.

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 and availability

The residual is abs(scale) * (T_b - T_a) - measured_direction. This avoids normalization and follows the Bilinear Angle-based Translation Averaging (BATA) formulation. Each observation needs its own scalar scale key.

The class is currently C++-only. Python users obtain it through LocationRecovery.buildGraph(edges, bilinear=True).

C++ example

#include <gtsam/sfm/TranslationFactor.h>

using namespace gtsam;

const auto noise = noiseModel::Isotropic::Sigma(3, 0.01);
BilinearAngleTranslationFactor factor(
    Symbol('t', 0), Symbol('t', 1), Symbol('S', 0),
    Unit3(1.0, 0.0, 0.0), noise);

const Vector3 residual = factor.evaluateError(
    Point3(0, 0, 0), Point3(2, 0, 0), Vector1(0.5));
// residual is zero because 0.5 * (2, 0, 0) == (1, 0, 0).

Because sign is removed with abs(scale), initialize scales away from zero for informative derivatives.