Skip to content

decomposeProjectionMatrix

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

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

ARGUMENTSprojMatrix, cameraMatrix, rotMatrix, transVect
FUNCTIONdecomposeProjectionMatrix
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.

decomposeProjectionMatrix(projMatrix: Mat, cameraMatrix: Mat, rotMatrix: Mat, transVect: Mat, rotMatrixX: Mat, rotMatrixY: Mat, rotMatrixZ: Mat, eulerAngles: Mat): void;
5 available overloads
decomposeProjectionMatrix(projMatrix: Mat, cameraMatrix: Mat, rotMatrix: Mat, transVect: Mat): void;
decomposeProjectionMatrix(projMatrix: Mat, cameraMatrix: Mat, rotMatrix: Mat, transVect: Mat, rotMatrixX: Mat): void;
decomposeProjectionMatrix(projMatrix: Mat, cameraMatrix: Mat, rotMatrix: Mat, transVect: Mat, rotMatrixX: Mat, rotMatrixY: Mat): void;
decomposeProjectionMatrix(projMatrix: Mat, cameraMatrix: Mat, rotMatrix: Mat, transVect: Mat, rotMatrixX: Mat, rotMatrixY: Mat, rotMatrixZ: Mat): void;
decomposeProjectionMatrix(projMatrix: Mat, cameraMatrix: Mat, rotMatrix: Mat, transVect: Mat, rotMatrixX: Mat, rotMatrixY: Mat, rotMatrixZ: Mat, eulerAngles: Mat): void;
projMatrix

3x4 input projection matrix P.

cameraMatrix

Output destination, filled by the native operation. Output 3x3 camera intrinsic matrix \cameramatrix{A}.

rotMatrix

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

transVect

Output destination, filled by the native operation. Output 4x1 translation vector T.

rotMatrixX

Output destination, filled by the native operation. Optional 3x3 rotation matrix around x-axis.

rotMatrixY

Output destination, filled by the native operation. Optional 3x3 rotation matrix around y-axis.

rotMatrixZ

Output destination, filled by the native operation. Optional 3x3 rotation matrix around z-axis.

eulerAngles

Output destination, filled by the native operation. Optional three-element vector containing three Euler angles of rotation in degrees.

The function computes a decomposition of a projection matrix into a calibration and a rotation matrix and the position of a camera.

It optionally returns three rotation matrices, one for each axis, and three Euler angles that could be used in OpenGL. Note, there is always more than one sequence of rotations about the three principal axes that results in the same orientation of an object, e.g. see [Slabaugh] . Returned three rotation matrices and corresponding three Euler angles are only one of the possible solutions.

The function is based on #RQDecomp3x3 .

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.