Skip to content

decomposeEssentialMat

geometryfunctionOpenCV 5.0.0
import { decomposeEssentialMat } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSE, R1, R2, t
FUNCTIONdecomposeEssentialMat
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Decompose an essential matrix to possible rotations and translation.

decomposeEssentialMat(E: Mat, R1: Mat, R2: Mat, t: Mat): void;
E

The input essential matrix.

R1

Output destination, filled by the native operation. One possible rotation matrix.

R2

Output destination, filled by the native operation. Another possible rotation matrix.

t

Output destination, filled by the native operation. One possible translation.

This function decomposes the essential matrix E using svd decomposition [HartleyZ00]. In general, four possible poses exist for the decomposition of E. They are [R_1, t], [R_1, -t], [R_2, t], [R_2, -t].

If E gives the epipolar constraint [p_2; 1]^T A^{-T} E A^{-1} [p_1; 1] = 0 between the image points p_1 in the first image and p_2 in second image, then any of the tuples [R_1, t], [R_1, -t], [R_2, t], [R_2, -t] is a change of basis from the first camera's coordinate system to the second camera's coordinate system. However, by decomposing E, one can only get the direction of the translation. For this reason, the translation t is returned with unit length.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.