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.

TransferEdges

Created by Codex.

Resolve the shared target view and matrix orientations for transfer factors.

Open In Colab

Mathematical idea

An epipolar matrix reverses orientation by transposition: if FijF_{ij} maps a point in view ii to a line in view jj, then

Fji=FijT.F_{ji}=F_{ij}^{\mathsf T}.

TransferEdges finds the shared target view cc and orients both stored matrices so they produce lines in that same view before a transfer factor intersects them.

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

Purpose and availability

TransferEdges<F> is a public C++ helper base used by the transfer-factor family. Given edges (a,c) and (b,c) in either orientation, it finds views a, b, and shared target c, then transposes matrices as needed so both map into view c.

It is not exposed as a standalone Python class; Python users configure it indirectly through a transfer-factor constructor.

C++ example

#include <gtsam/sfm/TransferFactor.h>

using namespace gtsam;

const EdgeKey edgeAC(0, 2);
const EdgeKey edgeCB(2, 1);  // reversed relative to (b, c)

const size_t a = TransferEdges<FundamentalMatrix>::ViewA(edgeAC, edgeCB);
const size_t b = TransferEdges<FundamentalMatrix>::ViewB(edgeAC, edgeCB);
const size_t c = TransferEdges<FundamentalMatrix>::ViewC(edgeAC, edgeCB);
// a == 0, b == 1, c == 2

The edges must share exactly the intended target view. Disjoint edges throw at construction.