Skip to content

sfm_motionFromEssentialChooseSolution

sfmfunctionOpenCV 5.0.0
import { sfm_motionFromEssentialChooseSolution } from '@banou/opencv-wasm'

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

ARGUMENTSRs, ts, K1, x1
FUNCTIONsfm_motionFromEssentialChooseSolution
RETURN TYPEnumber
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Choose one of the four possible motion solutions from an essential matrix.

sfm_motionFromEssentialChooseSolution(Rs: MatVector, ts: MatVector, K1: Mat, x1: Mat, K2: Mat, x2: Mat): number;
Rs

Input vector of 3x3 rotation matrices.

ts

Input vector of 3x1 translation vectors.

K1

Input 3x3 first camera matrix K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}.

x1

Input 2x1 vector with first 2d point.

K2

Input 3x3 second camera matrix. The parameters are similar to K1.

x2

Input 2x1 vector with second 2d point.

Decides the right solution by checking that the triangulation of a match x1--x2 lies in front of the cameras. Return index of the right solution or -1 if no solution.

Reference: See [HartleyZ00] 9.6 pag 259 (9.6.3 Geometrical interpretation of the 4 solutions).

Returns

The number result.

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.