decomposeEssentialMat
import { decomposeEssentialMat } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Decompose an essential matrix to possible rotations and translation.
decomposeEssentialMat(E: Mat, R1: Mat, R2: Mat, t: Mat): void;EThe input essential matrix.
R1Output destination, filled by the native operation. One possible rotation matrix.
R2Output destination, filled by the native operation. Another possible rotation matrix.
tOutput 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] = 0between the image pointsp_1in the first image andp_2in 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.