Skip to content

sfm_KRtFromProjection

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

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

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

Get K, R and t from projection matrix P, decompose using the RQ decomposition.

sfm_KRtFromProjection(P: Mat, K: Mat, R: Mat, t: Mat): void;
P

Input 3x4 projection matrix.

K

Output destination, filled by the native operation. Output 3x3 camera matrix K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}.

R

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

t

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

Reference: [HartleyZ00] A4.1.1 pag.579

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.