Skip to content

sfm_computeOrientation

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

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

ARGUMENTSx1, x2, R, t
FUNCTIONsfm_computeOrientation
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Computes Absolute or Exterior Orientation (Pose Estimation) between 2 sets of 3D point.

sfm_computeOrientation(x1: MatVector, x2: MatVector, R: Mat, t: Mat, s: number): void;
x1

Input first 3xN or 2xN array of points.

x2

Input second 3xN or 2xN array of points.

R

Output destination, filled by the native operation. Output 3x3 computed rotation matrix.

t

Output destination, filled by the native operation. Output 3x1 computed translation vector.

s

Output computed scale factor.

Find the best transformation such that xp=projection*(sRx+t) (same as Pose Estimation, ePNP). The routines below are only for the orthographic case for now.

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.